[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
This commit is contained in:
Benjamin Kramer
2015-10-05 13:55:20 +00:00
parent a25dcfd906
commit 7708b2a4b6
3 changed files with 100 additions and 8 deletions

View File

@@ -43,6 +43,12 @@ public:
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;