Re: AST capture in gcc (Steven Bosscher)
21 Sep 2004 22:17:34 -0400

          From comp.compilers

Related articles
AST capture in gcc (2004-09-14)
Re: AST capture in gcc (George Huber) (2004-09-21)
Re: AST capture in gcc (2004-09-21)
Re: AST capture in gcc (Joan Pujol) (2004-09-21)
| List of all articles for this month |

From: (Steven Bosscher)
Newsgroups: comp.compilers
Date: 21 Sep 2004 22:17:34 -0400
References: 04-09-099
Keywords: GCC, code
Posted-Date: 21 Sep 2004 22:17:34 EDT (Gregory Seront) wrote in message news:04-09-099...
> Hello,
> I need to capture an intermediate representation for C++ in order to
> take measurements on the code.
> I was thinking of hacking gcc in order to capture the abstract
> synthatic tree (AST) it is building.
> So I was asking myself:
> 1) do gcc produce an AST?
> 2) can I capture it?

1) From GCC 4.0 (ie. CVS HEAD) onwards, yes it does.
2) Yes you can, GCC has options to dump the AST after
      every optimization pass.

Whether the dump is good enough for you depends on what measurements
you want to do. The dumps are not self contained nor compilable.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.