[cfe-dev] CompilerInstance and C++

Lukas Vogel lukedirtwalkerdev at gmail.com
Fri Mar 1 01:42:38 PST 2013


Okay I will look into this thank you.

Can you please tell me if I will be able to have control over all
Preprocessor directives and over the full C++ AST using either Libclang or
Libtooling?

The aim of my project is to import C++ code (including included files) into
a Visual Environment.
Meaning i need to know in which file something was declared/defined is
there a way to see this in just the AST?

I just have the fear that LibClang and LibTooling will not be enough for
the whole task..?

I appreciate any comment/help on this.

Cheers,
Lukas






2013/3/1 Manuel Klimek <klimek at google.com>

> Using CompilerInstance is non-trivial. To make your life easier, there's
> LibTooling:
> http://clang.llvm.org/docs/LibTooling.html
>
> If you want a more stable interface I'd suggest you also take a look at
> LibClang.
>
> Cheers,
> /Manuel
>
>
> On Thu, Feb 28, 2013 at 11:18 PM, Lukas Vogel <lukedirtwalkerdev at gmail.com
> > wrote:
>
>> Hi,
>>
>> I try to parse c++ code, for now just very simple code like this:
>>
>> class Testing {
>>
>> public:
>>
>>     Testing(){}
>>
>> };
>>
>>
>>
>>
>> My Code is based on a CompilerInstance but I always get the following
>>
>> error: unknown type name 'class'
>>
>>
>>
>> I tried to somehow set the LangOptions but still didn't get it to work...
>>
>>
>> My code is here https://github.com/lukedirtwalker/Envision/blob/cppimport/CppImport/src/cppimportmanager.cpp
>>
>>
>> Thanks for any help :)
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130301/23f2600a/attachment.html>


More information about the cfe-dev mailing list