summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-24 19:08:16 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-24 19:08:16 +0000
commit3a7ad25eb695a1d83a35de02aa489a18cc7b1278 (patch)
tree0c26598e6025308293187eeca75b0bf927cf75b8 /clang/lib/Parse/Parser.cpp
parentb77d67f318f28e5028254a94502ff1125b75d0b9 (diff)
downloadbcm5719-llvm-3a7ad25eb695a1d83a35de02aa489a18cc7b1278.tar.gz
bcm5719-llvm-3a7ad25eb695a1d83a35de02aa489a18cc7b1278.zip
Introduce basic code-completion support for preprocessor directives,
e.g., after a "#" we'll suggest #if, #ifdef, etc. llvm-svn: 111943
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r--clang/lib/Parse/Parser.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index 8fd1e489944..230506d85f7 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -50,6 +50,8 @@ Parser::Parser(Preprocessor &pp, Action &actions)
WeakHandler.reset(new PragmaWeakHandler(actions));
PP.AddPragmaHandler(WeakHandler.get());
+
+ PP.setCodeCompletionHandler(*this);
}
/// If a crash happens while the parser is active, print out a line indicating
@@ -316,6 +318,7 @@ Parser::~Parser() {
UnusedHandler.reset();
PP.RemovePragmaHandler(WeakHandler.get());
WeakHandler.reset();
+ PP.clearCodeCompletionHandler();
}
/// Initialize - Warm up the parser.
@@ -1126,3 +1129,13 @@ void Parser::CodeCompletionRecovery() {
// performance-sensitive.
void Parser::FieldCallback::_anchor() {
}
+
+// Code-completion pass-through functions
+
+void Parser::CodeCompleteDirective(bool InConditional) {
+ Actions.CodeCompletePreprocessorDirective(getCurScope(), InConditional);
+}
+
+void Parser::CodeCompleteInConditionalExclusion() {
+ Actions.CodeCompleteInPreprocessorConditionalExclusion(getCurScope());
+}
OpenPOWER on IntegriCloud