summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPExpressions.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-04 03:32:15 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-04 03:32:15 +0000
commit5cec2aea3f5c402bbf570bc71dc173562424c8d6 (patch)
tree831c0bb13a4db8c277d53fc819130d1abdb188d6 /clang/lib/Lex/PPExpressions.cpp
parenta3deaeeb52acdc863ee98eb5bb20b419518bc592 (diff)
downloadbcm5719-llvm-5cec2aea3f5c402bbf570bc71dc173562424c8d6.tar.gz
bcm5719-llvm-5cec2aea3f5c402bbf570bc71dc173562424c8d6.zip
Support code-completion for C++ inline methods and ObjC buffering methods.
Previously we would cut off the source file buffer at the code-completion point; this impeded code-completion inside C++ inline methods and, recently, with buffering ObjC methods. Have the code-completion inserted into the source buffer so that it can be buffered along with a method body. When we actually hit the code-completion point the cut-off lexing or parsing. Fixes rdar://10056932&8319466 llvm-svn: 139086
Diffstat (limited to 'clang/lib/Lex/PPExpressions.cpp')
-rw-r--r--clang/lib/Lex/PPExpressions.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPExpressions.cpp b/clang/lib/Lex/PPExpressions.cpp
index 7f00e6ee960..2f810973b1a 100644
--- a/clang/lib/Lex/PPExpressions.cpp
+++ b/clang/lib/Lex/PPExpressions.cpp
@@ -96,6 +96,7 @@ static bool EvaluateDefined(PPValue &Result, Token &PeekTok, DefinedTracker &DT,
if (PeekTok.is(tok::code_completion)) {
if (PP.getCodeCompletionHandler())
PP.getCodeCompletionHandler()->CodeCompleteMacroName(false);
+ PP.setCodeCompletionReached();
PP.LexUnexpandedNonComment(PeekTok);
}
@@ -156,6 +157,7 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT,
if (PeekTok.is(tok::code_completion)) {
if (PP.getCodeCompletionHandler())
PP.getCodeCompletionHandler()->CodeCompletePreprocessorExpression();
+ PP.setCodeCompletionReached();
PP.LexNonComment(PeekTok);
}
OpenPOWER on IntegriCloud