[VFS] Add working directories to every virtual file system.
For RealFileSystem this is getcwd()/chdir(), the synthetic file systems can
make up one for themselves. OverlayFileSystem now synchronizes the working
directories when a new FS is added to the overlay or the overlay working
directory is set. This allows purely artificial file systems that have zero
ties to the underlying disks.
Differential Revision: http://reviews.llvm.org/D13430
llvm-svn: 249316
diff --git a/clang/unittests/Basic/VirtualFileSystemTest.cpp b/clang/unittests/Basic/VirtualFileSystemTest.cpp
index 4e5ec87..5362e59 100644
--- a/clang/unittests/Basic/VirtualFileSystemTest.cpp
+++ b/clang/unittests/Basic/VirtualFileSystemTest.cpp
@@ -43,6 +43,12 @@
openFileForRead(const Twine &Path) override {
llvm_unreachable("unimplemented");
}
+ llvm::ErrorOr<std::string> getCurrentWorkingDirectory() const override {
+ return std::string();
+ }
+ std::error_code setCurrentWorkingDirectory(const Twine &Path) override {
+ return std::error_code();
+ }
struct DirIterImpl : public clang::vfs::detail::DirIterImpl {
std::map<std::string, vfs::Status> &FilesAndDirs;