summaryrefslogtreecommitdiff
path: root/clang-tools-extra/clangd/ClangdUnit.cpp
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2018-02-13 17:15:06 +0000
committerIlya Biryukov <ibiryukov@google.com>2018-02-13 17:15:06 +0000
commit016d88eb5264b8f8efaf5cd74fa3f627d33e3695 (patch)
treedfa73465fbf739867f55a29d2d0b55169922856f /clang-tools-extra/clangd/ClangdUnit.cpp
parent25454e5b3ef8688ba7496dbbdfd295772da066de (diff)
[clangd] Log if CWD could not be changed. NFC.
Diffstat (limited to 'clang-tools-extra/clangd/ClangdUnit.cpp')
-rw-r--r--clang-tools-extra/clangd/ClangdUnit.cpp6
1 files changed, 5 insertions, 1 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;