[clangd] Make sure working directory is set during preamble validation

This commit is contained in:
Kadir Cetinkaya 2020-06-16 11:02:08 +02:00
parent 9b72b47ed6
commit 3725142449
No known key found for this signature in database
GPG Key ID: E39E36B8D2057ED6
1 changed files with 3 additions and 1 deletions

View File

@ -397,10 +397,12 @@ bool isPreambleCompatible(const PreambleData &Preamble,
llvm::MemoryBuffer::getMemBuffer(Inputs.Contents, FileName);
auto Bounds =
ComputePreambleBounds(*CI.getLangOpts(), ContentsBuffer.get(), 0);
auto VFS = Inputs.FSProvider->getFileSystem();
VFS->setCurrentWorkingDirectory(Inputs.CompileCommand.Directory);
return compileCommandsAreEqual(Inputs.CompileCommand,
Preamble.CompileCommand) &&
Preamble.Preamble.CanReuse(CI, ContentsBuffer.get(), Bounds,
Inputs.FSProvider->getFileSystem().get());
VFS.get());
}
void escapeBackslashAndQuotes(llvm::StringRef Text, llvm::raw_ostream &OS) {