[clangd] Unlink VFS working dir from OS working dir.

A lot of our previous FS manipulation was thread-unsafe in practice with
the RealFS implementation.

This switches to a different RealFS mode where path-manipulation is used
to simulate multiple working dirs.
r351050 both added this mode and removed the cache. If we want to
move back to the old implementation we need to put the cache back.

llvm-svn: 351051
This commit is contained in:
Sam McCall 2019-01-14 11:06:48 +00:00
parent c2b310aedf
commit 2dccf13538
1 changed files with 3 additions and 2 deletions

View File

@ -75,9 +75,10 @@ clang::clangd::RealFileSystemProvider::getFileSystem() const {
// FIXME: Try to use a similar approach in Sema instead of relying on
// propagation of the 'isVolatile' flag through all layers.
#ifdef _WIN32
return new VolatileFileSystem(llvm::vfs::getRealFileSystem());
return new VolatileFileSystem(
llvm::vfs::createPhysicalFileSystem().release());
#else
return llvm::vfs::getRealFileSystem();
return llvm::vfs::createPhysicalFileSystem().release();
#endif
}
} // namespace clangd