summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPMacroExpansion.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-12 17:31:43 +0000
committerChris Lattner <sabre@nondot.org>2009-03-12 17:31:43 +0000
commitcf35ce9d0de3d3d6221dd6b9b0f7865bc307021a (patch)
treeec51c9149ece246e568dd292a9972e03d407a840 /clang/lib/Lex/PPMacroExpansion.cpp
parentb0a553b9259768b13eeea60f57489d992d259f21 (diff)
downloadbcm5719-llvm-cf35ce9d0de3d3d6221dd6b9b0f7865bc307021a.tar.gz
bcm5719-llvm-cf35ce9d0de3d3d6221dd6b9b0f7865bc307021a.zip
add a callback for macro expansion, based on a patch by Paolo Bolzoni!
llvm-svn: 66799
Diffstat (limited to 'clang/lib/Lex/PPMacroExpansion.cpp')
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index 84056c3f4b5..712918b7c3b 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -150,6 +150,8 @@ bool Preprocessor::isNextPPTokenLParen() {
/// expanded as a macro, handle it and return the next token as 'Identifier'.
bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier,
MacroInfo *MI) {
+ if (Callbacks) Callbacks->MacroExpands(Identifier, MI);
+
// If this is a macro exapnsion in the "#if !defined(x)" line for the file,
// then the macro could expand to different things in other contexts, we need
// to disable the optimization in this case.
OpenPOWER on IntegriCloud