This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Intermediate representation


Nicolas COLLIN <nicolas.collin@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]