[cfe-dev] automatically generated declarations in the AST

Douglas Gregor dgregor at apple.com
Thu Aug 19 12:22:53 PDT 2010



Sent from my iPhone

On Aug 19, 2010, at 11:53 AM, Jan Bierbaum <s3306700 at inf.tu-dresden.de> wrote:

> Douglas Gregor meinte am 19.08.2010 19:13:
>>> Is there any mechanism to identify automatically generated nodes
>>> inside the AST?
>> 
>> Decl::isImplicit()
> 
> Thanks, that helps a lot!
> 
> But even that does not cover all the auto insertions. The first
> instruction in every translation unit is
> 
> typedef char* __builtin_va_list;
> 
> which states its source location as <built-in>:102:15. This is not
> marked implicit. I guess it's from some internal include directive. In
> that case I can just check that it doesn't come from the main file.

You can check that it comes from the predefines buffer. It is, admittedly, a bit weird. 

> Are
> there any other things like that I should keep an eye on?

I don't think so. 

>> However, the broken SourceRange is a bug. Please file a bug at
>> llvm.org/bugs or, better yet, provide a fix :)
> 
> http://llvm.org/bugs/show_bug.cgi?id=7939
> 
> I'll also give the bugfix a try, but don't expect too much. Until now I
> never had a look at that part of Clang...

Thanks!



More information about the cfe-dev mailing list