]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/name-lookup.h
* reload1.c (reload_cse_move2add): Fix a comment typo.
[thirdparty/gcc.git] / gcc / cp / name-lookup.h
CommitLineData
aed81407
GDR
1/* Declarations for C++ name lookup routines.
2 Copyright (C) 2003 Free Software Foundation, Inc.
3 Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22#ifndef GCC_CP_NAME_LOOKUP_H
23#define GCC_CP_NAME_LOOKUP_H
24
25#include "c-common.h"
26
27/* Datatype used to temporarily save C++ bindings (for implicit
28 instantiations purposes and like). Implemented in decl.c. */
29typedef struct cxx_saved_binding cxx_saved_binding;
30
31/* Datatype that represents binding established by a declaration between
32 a name and a C++ entity. */
33typedef struct cxx_binding cxx_binding;
34
35/* Nonzero if this binding is for a local scope, as opposed to a class
36 or namespace scope. */
37#define LOCAL_BINDING_P(NODE) ((NODE)->is_local)
38
39/* Nonzero if BINDING_VALUE is from a base class of the class which is
40 currently being defined. */
41#define INHERITED_VALUE_BINDING_P(NODE) ((NODE)->value_is_inherited)
42
43/* For a binding between a name and an entity at a non-local scope,
44 defines the scope where the binding is declared. (Either a class
45 _TYPE node, or a NAMESPACE_DECL.) This macro should be used only
46 for namespace-level bindings; on the IDENTIFIER_BINDING list
47 BINDING_LEVEL is used instead. */
48#define BINDING_SCOPE(NODE) ((NODE)->scope.scope)
49
50/* Nonzero if NODE has BINDING_LEVEL, rather than BINDING_SCOPE. */
51#define BINDING_HAS_LEVEL_P(NODE) ((NODE)->has_level)
52
53/* This is the declaration bound to the name. Possible values:
54 variable, overloaded function, namespace, template, enumerator. */
55#define BINDING_VALUE(NODE) ((NODE)->value)
56
57/* If name is bound to a type, this is the type (struct, union, enum). */
58#define BINDING_TYPE(NODE) ((NODE)->type)
59
60/* Zero out a cxx_binding pointed to by B. */
61#define cxx_binding_clear(B) memset ((B), 0, sizeof (cxx_binding))
62
63struct cxx_binding GTY(())
64{
65 /* Link to chain together various bindings for this name. */
66 cxx_binding *previous;
67 /* The non-type entity this name is bound to. */
68 tree value;
69 /* The type entity this name is bound to. */
70 tree type;
71 union tree_binding_u {
72 tree GTY ((tag ("0"))) scope;
73 struct cp_binding_level * GTY ((tag ("1"))) level;
74 } GTY ((desc ("%0.has_level"))) scope;
75 unsigned has_level : 1;
76 unsigned value_is_inherited : 1;
77 unsigned is_local : 1;
78};
79
80extern cxx_binding *cxx_binding_make (tree, tree);
81extern void cxx_binding_free (cxx_binding *);
82\f
83
84
85#endif /* GCC_CP_NAME_LOOKUP_H */