diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-10-14 00:49:43 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-10-14 00:49:43 +0000 |
commit | 82e0d728e8b8d2d80f6c8bf12afa69f53c2552a0 (patch) | |
tree | 84f19375e4a1ffe165a362317ac8442162d0072f /clang/lib/Lex/PPExpressions.cpp | |
parent | 01a678603a0d39a52eff956b5eb5a83ccb7a9fa3 (diff) | |
download | bcm5719-llvm-82e0d728e8b8d2d80f6c8bf12afa69f53c2552a0.tar.gz bcm5719-llvm-82e0d728e8b8d2d80f6c8bf12afa69f53c2552a0.zip |
Add a preprocessor callback that is invoked every time the 'defined'
operator is seen, from Jason Haslam!
llvm-svn: 141926
Diffstat (limited to 'clang/lib/Lex/PPExpressions.cpp')
-rw-r--r-- | clang/lib/Lex/PPExpressions.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPExpressions.cpp b/clang/lib/Lex/PPExpressions.cpp index 66a12eca0ff..84156d59b98 100644 --- a/clang/lib/Lex/PPExpressions.cpp +++ b/clang/lib/Lex/PPExpressions.cpp @@ -117,6 +117,10 @@ static bool EvaluateDefined(PPValue &Result, Token &PeekTok, DefinedTracker &DT, PP.markMacroAsUsed(Macro); } + // Invoke the 'defined' callback. + if (PPCallbacks *Callbacks = PP.getPPCallbacks()) + Callbacks->Defined(PeekTok); + // If we are in parens, ensure we have a trailing ). if (LParenLoc.isValid()) { // Consume identifier. |