[cfe-dev] Type Information for C++ classes

Douglas Gregor dgregor at apple.com
Wed Oct 17 10:14:08 PDT 2012


On Oct 17, 2012, at 10:08 AM, Mohammad Adil <madil90 at gmail.com> wrote:

> Unfortunately not. I am just seeing an int. That is because the header files which contain type information for FILE namely <stdio.h> is not found by the program.

Oh! Clang is just falling back to 'int' as part of it's recovery. You aren't likely to get good results.

> Is there a way to include default C++ paths using the CompilerInstance? I want to add these paths in a re-writing program.

If you use the tooling infrastructure (http://clang.llvm.org/docs/LibTooling.html), it handles default C++ paths for you. It's far, far better than trying to construct a CompilerInstance yourself.

	- Doug

> On Wed, Oct 17, 2012 at 9:56 PM, Douglas Gregor <dgregor at apple.com> wrote:
> 
> On Oct 17, 2012, at 4:08 AM, Mohammad Adil <madil90 at gmail.com> wrote:
>> ---------- Forwarded message ----------
>> From: Mohammad Adil <madil90 at gmail.com>
>> Date: Wed, Oct 17, 2012 at 4:08 PM
>> Subject: Re: [cfe-dev] Type Information for C++ classes
>> To: Manuel Klimek <klimek at google.com>
>> 
>> 
>> I am analyzing an AST with clang and I have a code which uses "FILE" type. Clang reports FILE type as int rather than FILE. I need to distinguish between FILE and int because both of them behave differently with streams. Is there a way I can distinguish between these two in clang?
> 
> Presumably, you'll see a TypedefType for FILE, whose underlying type is 'int'. 
> 
> 	- Doug
> 
> 
> 
> 
> -- 
> Mohammad Adil
> LUMS SSE
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121017/81e11bbb/attachment.html>


More information about the cfe-dev mailing list