[clangd] Log if CWD could not be changed. NFC.

llvm-svn: 325024
This commit is contained in:
Ilya Biryukov 2018-02-13 17:15:06 +00:00
parent b39094e39e
commit a9cf311d5b
2 changed files with 10 additions and 2 deletions

View File

@ -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;

View File

@ -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(