On Aug 17, 2012, at 13:32 , Andy Gibbs <[email protected]> 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

Attachment: verify.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to