|GNU Compiler Collection (GCC) Internals|
The root of the entire intermediate representation is the variable
global_namespace. This is the namespace specified with
in C++ source code. All other namespaces, types, variables, functions,
and so forth can be found starting with this namespace.
However, except for the fact that it is distinguished as the root of the representation, the global namespace is no different from any other namespace. Thus, in what follows, we describe namespaces generally, rather than the global namespace in particular.
A namespace is represented by a
The following macros and functions can be used on a
IDENTIFIER_NODEcorresponding to the unqualified name of the name of the namespace (see Identifiers). The name of the global namespace is ‘::’, even though in C++ the global namespace is unnamed. However, you should use comparison with
global_namespace, rather than
DECL_NAMEto determine whether or not a namespace is the global one. An unnamed namespace will have a
anonymous_namespace_name. Within a single translation unit, all unnamed namespaces will have the same name.
DECL_NAMESPACE_ALIASis the namespace for which this one is an alias.
Do not attempt to use
cp_namespace_decls for a namespace which is
an alias. Instead, follow
DECL_NAMESPACE_ALIAS links until you
reach an ordinary, non-alias, namespace, and call
NULL_TREE. The declarations are connected through their
Although most entries on this list will be declarations,
TREE_LIST nodes may also appear. In this case, the
TREE_VALUE will be an
OVERLOAD. The value of the
TREE_PURPOSE is unspecified; back ends should ignore this value.
As with the other kinds of declarations returned by
TREE_CHAIN will point to the next
declaration in this list.
For more information on the kinds of declarations that can occur on this
list, See Declarations. Some declarations will not appear on this
list. In particular, no
PARM_DECL nodes will appear here.
This function cannot be used with namespaces that have