diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-04-21 03:42:09 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-04-21 03:42:09 +0000 |
| commit | cd6d4b105ab4874e4a9bc9618d05eca86e5b7ff5 (patch) | |
| tree | 34813fb2ba709ed1f374f624b9c628ab4779c1dc /clang/lib/Lex | |
| parent | 0ec0537403ac4c90160e39bed248bbc4aaba0633 (diff) | |
| download | bcm5719-llvm-cd6d4b105ab4874e4a9bc9618d05eca86e5b7ff5.tar.gz bcm5719-llvm-cd6d4b105ab4874e4a9bc9618d05eca86e5b7ff5.zip | |
add a preprocessor callback function for #undef, patch by
Alexei Svitkine!
llvm-svn: 69656
Diffstat (limited to 'clang/lib/Lex')
| -rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 15477b63d3a..a6e1e7ee2ca 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -1466,7 +1466,11 @@ void Preprocessor::HandleUndefDirective(Token &UndefTok) { if (!MI->isUsed()) Diag(MI->getDefinitionLoc(), diag::pp_macro_not_used); - + + // If the callbacks want to know, tell them about the macro #undef. + if (Callbacks) + Callbacks->MacroUndefined(MacroNameTok.getIdentifierInfo(), MI); + // Free macro definition. ReleaseMacroInfo(MI); setMacroInfo(MacroNameTok.getIdentifierInfo(), 0); |

