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() {
|
void CompilerInstance::createCodeCompletionConsumer() {
|
||||||
const ParsedSourceLocation &Loc = getFrontendOpts().CodeCompletionAt;
|
const ParsedSourceLocation &Loc = getFrontendOpts().CodeCompletionAt;
|
||||||
if (!CompletionConsumer) {
|
if (!CompletionConsumer) {
|
||||||
setCodeCompletionConsumer(
|
setCodeCompletionConsumer(createCodeCompletionConsumer(
|
||||||
createCodeCompletionConsumer(getPreprocessor(),
|
getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column,
|
||||||
Loc.FileName, Loc.Line, Loc.Column,
|
getFrontendOpts().CodeCompleteOpts, llvm::outs()));
|
||||||
getFrontendOpts().CodeCompleteOpts,
|
return;
|
||||||
llvm::outs()));
|
|
||||||
if (!CompletionConsumer)
|
|
||||||
return;
|
|
||||||
} else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName,
|
} else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName,
|
||||||
Loc.Line, Loc.Column)) {
|
Loc.Line, Loc.Column)) {
|
||||||
setCodeCompletionConsumer(nullptr);
|
setCodeCompletionConsumer(nullptr);
|
||||||
|
|
Loading…
Reference in New Issue