aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PPExpressions.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-10-14 00:49:43 +0000
committerDouglas Gregor <dgregor@apple.com>2011-10-14 00:49:43 +0000
commit3d5f955855cab5a831cc6b9339dc77a7d46f1a30 (patch)
tree1b50f01a9641fc4ab29ac2a80e06adb98798ae96 /lib/Lex/PPExpressions.cpp
parent78f0ea710875425d501a4736565b3a34cf1840c8 (diff)
Add a preprocessor callback that is invoked every time the 'defined'
operator is seen, from Jason Haslam! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPExpressions.cpp')
-rw-r--r--lib/Lex/PPExpressions.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp
index 66a12eca0f..84156d59b9 100644
--- a/lib/Lex/PPExpressions.cpp
+++ b/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.