Skip to content

Commit

Permalink
[clangd] Unlink VFS working dir from OS working dir.
Browse files Browse the repository at this point in the history
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.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351051 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
sam-mccall committed Jan 14, 2019
1 parent b1f1d47 commit f391d9a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clangd/FSProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f391d9a

Please sign in to comment.