[cfe-dev] Transforming the AST

John McCall rjmccall at apple.com
Tue Jul 6 10:34:07 PDT 2010


On Jul 6, 2010, at 8:34 AM, Zakkak Foivos wrote:
> i need some help with AST transformations. I searched through the api
> but didn't find anything straight forward except some build*type functions.
> How can i create a new stmt and insert it in the tree? I don't want to
> use the Rewriter for the transformations.

If you're interested in producing transformed source code, you should really
use the rewriter (and tell us if that's insufficient for some reason).  If you're
interested in producing transformed machine code, you can either follow one
of Doug's suggestions or, if the code you want to emit is pretty straightforward,
you can alter the LLVM IR after CodeGen is done with it.

John.



More information about the cfe-dev mailing list