On Thu, Oct 12, 2006 at 07:45:52AM -0700, Ian Lance Taylor wrote:
> Bob Rossi <[EMAIL PROTECTED]> writes:
> 
> > Hopefully I'll be able to debug gcc nicely after this is built. Two
> > more questions that could save me a lot of time. Do you know where the
> > abstract syntax tree is stored in GCC after a file is parsed?
> 
> I'm not sure what kind of answer you are looking for.  One place to
> look is in the cgraph code.
> 
> > Does GCC
> > still create an AST for C/C++, or does it go directly to GIMPLE?
> 
> gcc generates an AST, of sorts, for C++.  For C it goes directly to
> GIMPLE (really GENERIC, but they are pretty similar).

Hi Ian,

Basically, I want to use GCC with C,C++. I want to walk a tree that GCC
creates for the translation units. I would like to know if for these two
languages if I should use a language dependent tree, the generic tree or 
the gimple tree. In general, I would like to use the tree that most closely
resembles the source language, and that is documented best.

For starters, can you recommend which tree structure I should use in
GCC? If so, would it be to much to ask to point me to the object in the
source code that represents the tree after the tree has been populated?

If I should be using gimple, I found this paper.
ftp://gcc.gnu.org/pub/gcc/summit/2003/GENERIC%20and%20GIMPLE.pdf
Is there any other good documentation on this?

Thanks,
Bob Rossi


Reply via email to