diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-24 22:20:20 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-24 22:20:20 +0000 |
commit | f29c5233085a5af795c3c01b94d319e5b3235d56 (patch) | |
tree | 29a09575d6701839943ab6c54aab7ac4a476db0e /lib/Lex/PPExpressions.cpp | |
parent | db918646c0d549a48b85734cb735e094886890d2 (diff) |
Implement code completion for preprocessor expressions and in macro
arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPExpressions.cpp')
-rw-r--r-- | lib/Lex/PPExpressions.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp index 73f3d4ee7a..163e869400 100644 --- a/lib/Lex/PPExpressions.cpp +++ b/lib/Lex/PPExpressions.cpp @@ -149,6 +149,12 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT, bool ValueLive, Preprocessor &PP) { DT.State = DefinedTracker::Unknown; + if (PeekTok.is(tok::code_completion)) { + if (PP.getCodeCompletionHandler()) + PP.getCodeCompletionHandler()->CodeCompletePreprocessorExpression(); + PP.LexUnexpandedToken(PeekTok); + } + // If this token's spelling is a pp-identifier, check to see if it is // 'defined' or if it is a macro. Note that we check here because many // keywords are pp-identifiers, so we can't check the kind. |