[cfe-commits] r161650 - in /cfe/trunk: include/clang/Frontend/VerifyDiagnosticConsumer.h lib/ARCMigrate/ARCMT.cpp lib/Frontend/VerifyDiagnosticConsumer.cpp test/ARCMT/verify.m test/ASTMerge/function.c test/Frontend/verify.c test/Frontend/verify2.c test/Frontend/veri

Jordan Rose jordan_rose at apple.com
Fri Aug 17 18:47:21 PDT 2012


On Aug 17, 2012, at 13:32 , Andy Gibbs <andyg1001 at hotmail.co.uk> wrote:

>>>> Why not look at where the macro is instantiated?
>>> 
>>> Is it necessary?  A macro expansion itself will not contain comments,
>>> and hence no directive?... (that's right isn't it?)
>> 
>> I'll agree that directives should not come from macros, but a macro
>> /instantiation/ can result in diagnostics (that's this case), in which
>> case we definitely want to make sure that the file containing the macro
>> instantiation location (not its definition location!) has been parsed
>> for directives. I'm not sure we'll ever actually see an issue like this,
>> but it seems better than dropping it on the floor.
> 
> No, I take your point.  I've added in a simple "get to top caller" loop
> to pull this location out.

getExpansionLoc() will handle this for you (and actually includes the test for "not a macro" as well). And I take your point about insert(), though it still looks less than pretty to my eyes.

I made a few small tweaks, but before I commit I want to confirm again that this patch works for cling. Vassil?

Jordan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: verify.patch
Type: application/octet-stream
Size: 13418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120817/a83efff9/attachment.obj>


More information about the cfe-commits mailing list