[cfe-dev] accessing clang's AST
ochipara at gmail.com
Fri Feb 26 18:21:21 PST 2010
Thanks for the info. Is there an plug-in the exports the AST? I tried the
ast-dump, however, it crashes:
0x10490e360 Assertion failed: (0 && "Unexpected decl"), function
DumpDeclarator, file StmtDumper.cpp, line 263.
On Fri, Feb 26, 2010 at 5:25 PM, Charles Davis <cdavis at mymail.mines.edu>wrote:
> Octav Chipara wrote:
> > Hi,
> > I would like to use the AST already generated by clang to perform some
> > transformations. I am new to clang & llvm and I was wondering if I could
> > get a couple of pointers. Is there a good example which initializes the
> > parser and traverser the AST?
> Yes! Take a look at lib/Frontend/RewriteObjC.cpp. It uses the Rewriter
> library to take a fully-parsed AST for an ObjC program and turn it into
> Also, have a look at the CompilerInstance and CompilerInvocation classes
> from the Frontend library. They will really come in handy for setting up
> your environment.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev