aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-12 01:39:54 +0000
committerChris Lattner <sabre@nondot.org>2009-04-12 01:39:54 +0000
commitf4a72b07747cd6ae1a9f6974e148ae504c879349 (patch)
tree1eaeb95882fd6628689187d315bdc142d6fd6fef /lib/Lex/PPDirectives.cpp
parent7356a31327be9b3c3434a0c88746028980da5684 (diff)
add a ppcallback hook for macro definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68883 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPDirectives.cpp')
-rw-r--r--lib/Lex/PPDirectives.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp
index ba321a7f67..52f673c6d3 100644
--- a/lib/Lex/PPDirectives.cpp
+++ b/lib/Lex/PPDirectives.cpp
@@ -1402,6 +1402,10 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok) {
}
setMacroInfo(MacroNameTok.getIdentifierInfo(), MI);
+
+ // If the callbacks want to know, tell them about the macro definition.
+ if (Callbacks)
+ Callbacks->MacroDefined(MacroNameTok.getIdentifierInfo(), MI);
}
/// HandleUndefDirective - Implements #undef.