aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erikjv@me.com>2012-04-12 10:31:12 +0000
committerErik Verbruggen <erikjv@me.com>2012-04-12 10:31:12 +0000
commit2fca3c2c87baef6d0bc481f8c9503b7f6a6e21f4 (patch)
treee95e55cd987aedd155e2c13f63693b083944cb83 /clang/lib/Frontend/CompilerInstance.cpp
parent6e92251f9b8191e0bad9e73b4a2a5932a4f35f91 (diff)
downloadllvm-2fca3c2c87baef6d0bc481f8c9503b7f6a6e21f4.zip
llvm-2fca3c2c87baef6d0bc481f8c9503b7f6a6e21f4.tar.gz
llvm-2fca3c2c87baef6d0bc481f8c9503b7f6a6e21f4.tar.bz2
Changed all direct calls to CompletionConsumer.reset(..) to go call
CompilerInstance::setCodeCompletionConsumer instead, in order to change the SkipFunctionBodies flag accordingly. Also fixed setCodeCompletionConsumer to take a reset() to null into account. llvm-svn: 154585
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 27cfc9d..cab6b90 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -88,7 +88,7 @@ void CompilerInstance::setASTConsumer(ASTConsumer *Value) {
void CompilerInstance::setCodeCompletionConsumer(CodeCompleteConsumer *Value) {
CompletionConsumer.reset(Value);
- getFrontendOpts().SkipFunctionBodies = true;
+ getFrontendOpts().SkipFunctionBodies = Value != 0;
}
// Diagnostics
@@ -384,7 +384,7 @@ static bool EnableCodeCompletion(Preprocessor &PP,
void CompilerInstance::createCodeCompletionConsumer() {
const ParsedSourceLocation &Loc = getFrontendOpts().CodeCompletionAt;
if (!CompletionConsumer) {
- CompletionConsumer.reset(
+ setCodeCompletionConsumer(
createCodeCompletionConsumer(getPreprocessor(),
Loc.FileName, Loc.Line, Loc.Column,
getFrontendOpts().ShowMacrosInCodeCompletion,
@@ -395,14 +395,14 @@ void CompilerInstance::createCodeCompletionConsumer() {
return;
} else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName,
Loc.Line, Loc.Column)) {
- CompletionConsumer.reset();
+ setCodeCompletionConsumer(0);
return;
}
if (CompletionConsumer->isOutputBinary() &&
llvm::sys::Program::ChangeStdoutToBinary()) {
getPreprocessor().getDiagnostics().Report(diag::err_fe_stdout_binary);
- CompletionConsumer.reset();
+ setCodeCompletionConsumer(0);
}
}