diff options
-rw-r--r-- | clang-tools-extra/clangd/ClangdUnit.cpp | 6 | ||||
-rw-r--r-- | clang-tools-extra/clangd/CodeComplete.cpp | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/clang-tools-extra/clangd/ClangdUnit.cpp b/clang-tools-extra/clangd/ClangdUnit.cpp index 9db97b466c9..d0dfe6833a8 100644 --- a/clang-tools-extra/clangd/ClangdUnit.cpp +++ b/clang-tools-extra/clangd/ClangdUnit.cpp @@ -379,7 +379,11 @@ CppFile::rebuild(ParseInputs &&Inputs) { for (const auto &S : Inputs.CompileCommand.CommandLine) ArgStrs.push_back(S.c_str()); - Inputs.FS->setCurrentWorkingDirectory(Inputs.CompileCommand.Directory); + if (Inputs.FS->setCurrentWorkingDirectory(Inputs.CompileCommand.Directory)) { + log("Couldn't set working directory"); + // We run parsing anyway, our lit-tests rely on results for non-existing + // working dirs. + } // Prepare CompilerInvocation. std::unique_ptr<CompilerInvocation> CI; diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index b418d2b7305..dcbf00cad9e 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -642,7 +642,11 @@ bool semaCodeComplete(std::unique_ptr<CodeCompleteConsumer> Consumer, for (const auto &S : Input.Command.CommandLine) ArgStrs.push_back(S.c_str()); - Input.VFS->setCurrentWorkingDirectory(Input.Command.Directory); + if (Input.VFS->setCurrentWorkingDirectory(Input.Command.Directory)) { + log("Couldn't set working directory"); + // We run parsing anyway, our lit-tests rely on results for non-existing + // working dirs. + } IgnoreDiagnostics DummyDiagsConsumer; auto CI = createInvocationFromCommandLine( |