aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/VirtualFileSystem.cpp
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2018-05-18 13:22:49 +0000
committerEric Liu <ioeric@google.com>2018-05-18 13:22:49 +0000
commita840a465579a91418575c77ca6c04ded28f55b1a (patch)
tree9b0ce6636eb8df0197e8b5d100ed8960cb3c78c1 /clang/lib/Basic/VirtualFileSystem.cpp
parent215e4718caa1529ff48471f8a179fb530fd1838d (diff)
downloadllvm-a840a465579a91418575c77ca6c04ded28f55b1a.zip
llvm-a840a465579a91418575c77ca6c04ded28f55b1a.tar.gz
llvm-a840a465579a91418575c77ca6c04ded28f55b1a.tar.bz2
[VFS] Implement getRealPath for OverlayFileSystem.
Reviewers: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47060 llvm-svn: 332717
Diffstat (limited to 'clang/lib/Basic/VirtualFileSystem.cpp')
-rw-r--r--clang/lib/Basic/VirtualFileSystem.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Basic/VirtualFileSystem.cpp b/clang/lib/Basic/VirtualFileSystem.cpp
index 1727b7d..b2eb5b9 100644
--- a/clang/lib/Basic/VirtualFileSystem.cpp
+++ b/clang/lib/Basic/VirtualFileSystem.cpp
@@ -381,6 +381,15 @@ OverlayFileSystem::setCurrentWorkingDirectory(const Twine &Path) {
return {};
}
+std::error_code
+OverlayFileSystem::getRealPath(const Twine &Path,
+ SmallVectorImpl<char> &Output) const {
+ for (auto &FS : FSList)
+ if (FS->exists(Path))
+ return FS->getRealPath(Path, Output);
+ return errc::no_such_file_or_directory;
+}
+
clang::vfs::detail::DirIterImpl::~DirIterImpl() = default;
namespace {