summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorVassil Vassilev <v.g.vassilev@gmail.com>2016-07-27 14:56:59 +0000
committerVassil Vassilev <v.g.vassilev@gmail.com>2016-07-27 14:56:59 +0000
commit644ea61d2dc1d185994c845e7e3de173d95a5674 (patch)
tree3aaf0cf24fcc3e9ced186a9e02905af6c3db8eaf /clang/lib/Lex/Preprocessor.cpp
parent5267d53779b45002837c779e513811aa8e9ad755 (diff)
downloadbcm5719-llvm-644ea61d2dc1d185994c845e7e3de173d95a5674.tar.gz
bcm5719-llvm-644ea61d2dc1d185994c845e7e3de173d95a5674.zip
Implement filtering for code completion of identifiers.
Patch by Cristina Cristescu and Axel Naumann! Agreed on post commit review (D17820). llvm-svn: 276878
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 3654ba080d4..8832c7f80c4 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -74,7 +74,7 @@ Preprocessor::Preprocessor(IntrusiveRefCntPtr<PreprocessorOptions> PPOpts,
IncrementalProcessing(false), TUKind(TUKind), CodeComplete(nullptr),
CodeCompletionFile(nullptr), CodeCompletionOffset(0),
LastTokenWasAt(false), ModuleImportExpectsIdentifier(false),
- CodeCompletionReached(0), MainFileDir(nullptr),
+ CodeCompletionReached(0), CodeCompletionII(0), MainFileDir(nullptr),
SkipMainFilePreamble(0, true), CurPPLexer(nullptr), CurDirLookup(nullptr),
CurLexerKind(CLK_Lexer), CurSubmodule(nullptr), Callbacks(nullptr),
CurSubmoduleState(&NullSubmoduleState), MacroArgCache(nullptr),
@@ -744,6 +744,9 @@ void Preprocessor::Lex(Token &Result) {
}
} while (!ReturnedToken);
+ if (Result.is(tok::code_completion))
+ setCodeCompletionIdentifierInfo(Result.getIdentifierInfo());
+
LastTokenWasAt = Result.is(tok::at);
}
OpenPOWER on IntegriCloud