Nicolas COLLIN <nicolas.col...@fr.thalesgroup.com> writes:

> I read that there is a variable global_namespace, I searched for it
> but I didn't find anything. Would you know how I can get the root ?

global_namespace is specific to the C++ frontend.  It is defined in
cp/name-lookup.c.

I'm not sure what you mean by "the root," but not that gcc does not have
a global symbol table.

> There is a variable tree decl among parameters of the function
> rest_of_compilation, I found out it's a function decl most of time,
> but can I the whole tree from it ?

The representation of the body of the function is in DECL_SAVED_TREE of
the function decl.

> How can I get the parent of a tree ? Maybe the field CONTEXT ?

I don't know what you mean by "the parent."  DECL_CONTEXT will tell you
where a decl is defined (see the comment above DECL_CONTEXT in tree.h),
TYPE_CONTEXT will tell you where a type is defined.

Ian

Reply via email to