This is the mail archive of the
mailing list for the GCC project.
Re: Intermediate representation
- From: Ian Lance Taylor <iant at google dot com>
- To: Nicolas COLLIN <nicolas dot collin at fr dot thalesgroup dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 14 May 2009 06:49:36 -0700
- Subject: Re: Intermediate representation
- References: <4A0BFE0F.email@example.com>
Nicolas COLLIN <firstname.lastname@example.org> 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
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.