summaryrefslogtreecommitdiffstats
path: root/lib/Basic/VirtualFileSystem.cpp
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2016-08-12 02:17:26 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2016-08-12 02:17:26 +0000
commiteb66e2ffe787658976e133ab9a69d0e9a9cf3ac5 (patch)
tree08c2bc077b586ca9bbbd5df8dde1de3c8bbed9cf /lib/Basic/VirtualFileSystem.cpp
parentd28be6c82c5d90f137c9831f0346fb4e1e485db9 (diff)
Revert "[VFS] Skip non existent files from the VFS tree"
Breaking bots: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/27281/ This reverts commit r278457. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/VirtualFileSystem.cpp')
-rw-r--r--lib/Basic/VirtualFileSystem.cpp34
1 files changed, 8 insertions, 26 deletions
diff --git a/lib/Basic/VirtualFileSystem.cpp b/lib/Basic/VirtualFileSystem.cpp
index a56c9115fb..62a386b735 100644
--- a/lib/Basic/VirtualFileSystem.cpp
+++ b/lib/Basic/VirtualFileSystem.cpp
@@ -1778,47 +1778,29 @@ VFSFromYamlDirIterImpl::VFSFromYamlDirIterImpl(
RedirectingDirectoryEntry::iterator Begin,
RedirectingDirectoryEntry::iterator End, std::error_code &EC)
: Dir(_Path.str()), FS(FS), Current(Begin), End(End) {
- while (Current != End) {
+ if (Current != End) {
SmallString<128> PathStr(Dir);
llvm::sys::path::append(PathStr, (*Current)->getName());
llvm::ErrorOr<vfs::Status> S = FS.status(PathStr);
- if (S) {
+ if (S)
CurrentEntry = *S;
- return;
- }
- // Skip entries which do not map to a reliable external content.
- if (FS.ignoreNonExistentContents() &&
- S.getError() == llvm::errc::no_such_file_or_directory) {
- ++Current;
- continue;
- } else {
+ else
EC = S.getError();
- break;
- }
}
}
std::error_code VFSFromYamlDirIterImpl::increment() {
assert(Current != End && "cannot iterate past end");
- while (++Current != End) {
+ if (++Current != End) {
SmallString<128> PathStr(Dir);
llvm::sys::path::append(PathStr, (*Current)->getName());
llvm::ErrorOr<vfs::Status> S = FS.status(PathStr);
- if (!S) {
- // Skip entries which do not map to a reliable external content.
- if (FS.ignoreNonExistentContents() &&
- S.getError() == llvm::errc::no_such_file_or_directory) {
- continue;
- } else {
- return S.getError();
- }
- }
+ if (!S)
+ return S.getError();
CurrentEntry = *S;
- break;
- }
-
- if (Current == End)
+ } else {
CurrentEntry = Status();
+ }
return std::error_code();
}