[cfe-dev] Once I have an AST, how do I compile it?

Eli Friedman eli.friedman at gmail.com
Mon Apr 5 13:58:53 PDT 2010


On Mon, Apr 5, 2010 at 1:06 PM, Martin C.Martin
<martin at martincmartin.com> wrote:
> I've managed to create a test program, included below for the curious,
> which creates a super simple AST corresponding to "void foo() { }".
> What do I call to generate code from it?  Any pointers on what
> classes/files to look at?

Call CreateLLVMCodeGen in include/clang/CodeGen/ModuleBuilder.h to get
an ASTConsumer, then call the appropriate APIs (see
include/clang/AST/ASTConsumer.h) to make it generate code.

-Eli




More information about the cfe-dev mailing list