JohnTitor created this revision. Herald added a project: All. JohnTitor requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Fixes llvm#53545 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D126524 Files: clang/lib/Frontend/CompilerInstance.cpp Index: clang/lib/Frontend/CompilerInstance.cpp =================================================================== --- clang/lib/Frontend/CompilerInstance.cpp +++ clang/lib/Frontend/CompilerInstance.cpp @@ -710,15 +710,13 @@ 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; - } else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName, - Loc.Line, Loc.Column)) { + setCodeCompletionConsumer(createCodeCompletionConsumer( + getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column, + getFrontendOpts().CodeCompleteOpts, llvm::outs())); + return; + } else if (!CompletionConsumer && + EnableCodeCompletion(getPreprocessor(), Loc.FileName, Loc.Line, + Loc.Column)) { setCodeCompletionConsumer(nullptr); return; }
Index: clang/lib/Frontend/CompilerInstance.cpp =================================================================== --- clang/lib/Frontend/CompilerInstance.cpp +++ clang/lib/Frontend/CompilerInstance.cpp @@ -710,15 +710,13 @@ 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; - } else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName, - Loc.Line, Loc.Column)) { + setCodeCompletionConsumer(createCodeCompletionConsumer( + getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column, + getFrontendOpts().CodeCompleteOpts, llvm::outs())); + return; + } else if (!CompletionConsumer && + EnableCodeCompletion(getPreprocessor(), Loc.FileName, Loc.Line, + Loc.Column)) { setCodeCompletionConsumer(nullptr); return; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits