[cfe-commits] [PATCH] Invoke MacroUndefined callback for macros that aren't defined

Jason Haslam jason.haslam at gmail.com
Thu Feb 23 15:41:58 PST 2012


The attached patch changes PPCallbacks::MacroUndefined to be called even when the macro wasn't defined. This drops the MacroInfo parameter which would be null in that case. The only client (within clang) that used this parameter was PreprocessingRecord. The bulk of this patch adds a Preprocessor member to PreprocessingRecord so that it can look up the MacroInfo.

For us it's just as interesting to see an #undef for a macro without any #define as a defined one. This also makes it more consistent with the other callbacks like ifdef, ifndef, etc.

Jason

-------------- next part --------------
A non-text attachment was scrubbed...
Name: undef.diff
Type: application/octet-stream
Size: 7578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120223/cde93347/attachment.obj>
-------------- next part --------------




More information about the cfe-commits mailing list