[cfe-dev] Clang Library

Jean-Daniel Dupas devlists at shadowlab.org
Wed Feb 17 00:45:58 PST 2010


Le 17 févr. 2010 à 01:57, Glenn R. Martin a écrit :

> On 16 Feb 2010, at 19:23 , Charles Davis wrote:
>> There's several different objects you need to look into creating:
>> 
>> - Preprocessing is handled by a Preprocessor object.
>> - If you want to compile C code, you need to create an ASTContext (in
>> addition to a Preprocessor).
>> - The Sema (SEMAntic analyzer) object handles semantic checking, etc.
>> - The CodeGen library turns a fully-annotated AST into LLVM IR, which
>> you can then pass to LLVM libraries (like LLVM CodeGen and the Target
>> family) to generate executable code.
>> - The Frontend library handles much of the tedious process of setting up
>> these objects for you. In particular, look into the "CompilerInvocation"
>> and "CompilerInstance" classes.
>> 
>> HTH
>> 
>> Chip
> 
> Chip,
> Thank you for the insight. I shall look in to it shortly.
> 

And you may also have a look at lib/Driver. It contains the code that take care of all of this when you use the command line clang tool.

-- Jean-Daniel








More information about the cfe-dev mailing list