Skip to content

Commit 2405253

Browse files
authored
Emit BeginSourceFile failure with elog. (llvm#104845)
There are 3 ways in which `ParseAST::build` can fail and return `std::nullopt`. 2 of the ways we emit the error message using `elog`, but for the 3rd way, `log` is used. We should emit all 3 of these reasons with `elog`.
1 parent 54c6b93 commit 2405253

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang-tools-extra/clangd/ParsedAST.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
512512
auto Action = std::make_unique<ClangdFrontendAction>();
513513
const FrontendInputFile &MainInput = Clang->getFrontendOpts().Inputs[0];
514514
if (!Action->BeginSourceFile(*Clang, MainInput)) {
515-
log("BeginSourceFile() failed when building AST for {0}",
516-
MainInput.getFile());
515+
elog("BeginSourceFile() failed when building AST for {0}",
516+
MainInput.getFile());
517517
return std::nullopt;
518518
}
519519
// If we saw an include guard in the preamble section of the main file,

0 commit comments

Comments
 (0)