forked from OSchip/llvm-project
[CompilerInstance] Fix weird condition on `createCodeCompletionConsumer`
Fixes llvm#53545 Differential Revision: https://reviews.llvm.org/D126524
This commit is contained in:
parent
3b4500014a
commit
d3d3e2528e
|
@ -710,13 +710,10 @@ static bool EnableCodeCompletion(Preprocessor &PP,
|
|||
void CompilerInstance::createCodeCompletionConsumer() {
|
||||
const ParsedSourceLocation &Loc = getFrontendOpts().CodeCompletionAt;
|
||||
if (!CompletionConsumer) {
|
||||
setCodeCompletionConsumer(
|
||||
createCodeCompletionConsumer(getPreprocessor(),
|
||||
Loc.FileName, Loc.Line, Loc.Column,
|
||||
getFrontendOpts().CodeCompleteOpts,
|
||||
llvm::outs()));
|
||||
if (!CompletionConsumer)
|
||||
return;
|
||||
setCodeCompletionConsumer(createCodeCompletionConsumer(
|
||||
getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column,
|
||||
getFrontendOpts().CodeCompleteOpts, llvm::outs()));
|
||||
return;
|
||||
} else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName,
|
||||
Loc.Line, Loc.Column)) {
|
||||
setCodeCompletionConsumer(nullptr);
|
||||
|
|
Loading…
Reference in New Issue