Re: AST capture in gcc

s.bosscher@student.tudelft.nl (Steven Bosscher)
21 Sep 2004 22:17:34 -0400

          From comp.compilers

Related articles
AST capture in gcc gs@cetic.be (2004-09-14)
Re: AST capture in gcc kharmon@optonline.net (George Huber) (2004-09-21)
Re: AST capture in gcc s.bosscher@student.tudelft.nl (2004-09-21)
Re: AST capture in gcc joanpujol@gmail.com (Joan Pujol) (2004-09-21)
| List of all articles for this month |
From: s.bosscher@student.tudelft.nl (Steven Bosscher)
Newsgroups: comp.compilers
Date: 21 Sep 2004 22:17:34 -0400
Organization: http://groups.google.com
References: 04-09-099
Keywords: GCC, code
Posted-Date: 21 Sep 2004 22:17:34 EDT

gs@cetic.be (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.


Gr.
Steven


Post a followup to this message

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