How to get source range from MacroInfo?

What’s the best way to get the source range information from a MacroInfo from the Preprocessor?

The start location is available, but how would one go about getting the end location for the macro definition?

-Alexei

We don't currently store this, but it would make sense to add. Please prepare a patch, thanks!

-Chris

Patch attached. I’ve tested it manually with a number of cases (object like macros, function like macros, #define’s with no value) and the results are as expected.

-Alexei

MacroInfo.diff (2.76 KB)

Looks great! Applied:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090420/015959.html

-Chris