aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-21 03:42:09 +0000
committerChris Lattner <sabre@nondot.org>2009-04-21 03:42:09 +0000
commit41c17473e3ece9e60d97c5d9397866b7730cf7ee (patch)
tree657724e153c77d5d6817b66547be45dbffdc3f4c /lib/Lex/PPDirectives.cpp
parent19d28a650ca6d98f7907ad891557fccca7baaea8 (diff)
add a preprocessor callback function for #undef, patch by
Alexei Svitkine! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69656 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPDirectives.cpp')
-rw-r--r--lib/Lex/PPDirectives.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp
index 15477b63d3..a6e1e7ee2c 100644
--- a/lib/Lex/PPDirectives.cpp
+++ b/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);