From eb66e2ffe787658976e133ab9a69d0e9a9cf3ac5 Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Lopes Date: Fri, 12 Aug 2016 02:17:26 +0000 Subject: [PATCH] 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 --- lib/Basic/VirtualFileSystem.cpp | 34 ++++------------ test/VFS/Inputs/Bar.framework/Headers/A.h | 1 - test/VFS/Inputs/Bar.framework/Headers/B.h | 1 - test/VFS/Inputs/Bar.framework/Headers/C.h | 1 - .../Bar.framework/Modules/module.modulemap | 6 --- test/VFS/Inputs/bar-headers.yaml | 39 ------------------- .../umbrella-framework-import-skipnonexist.m | 14 ------- 7 files changed, 8 insertions(+), 88 deletions(-) delete mode 100644 test/VFS/Inputs/Bar.framework/Headers/A.h delete mode 100644 test/VFS/Inputs/Bar.framework/Headers/B.h delete mode 100644 test/VFS/Inputs/Bar.framework/Headers/C.h delete mode 100644 test/VFS/Inputs/Bar.framework/Modules/module.modulemap delete mode 100644 test/VFS/Inputs/bar-headers.yaml delete mode 100644 test/VFS/umbrella-framework-import-skipnonexist.m 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 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 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(); } diff --git a/test/VFS/Inputs/Bar.framework/Headers/A.h b/test/VFS/Inputs/Bar.framework/Headers/A.h deleted file mode 100644 index 975f1f0437..0000000000 --- a/test/VFS/Inputs/Bar.framework/Headers/A.h +++ /dev/null @@ -1 +0,0 @@ -// A.h diff --git a/test/VFS/Inputs/Bar.framework/Headers/B.h b/test/VFS/Inputs/Bar.framework/Headers/B.h deleted file mode 100644 index 761540b09c..0000000000 --- a/test/VFS/Inputs/Bar.framework/Headers/B.h +++ /dev/null @@ -1 +0,0 @@ -// B.h diff --git a/test/VFS/Inputs/Bar.framework/Headers/C.h b/test/VFS/Inputs/Bar.framework/Headers/C.h deleted file mode 100644 index a0121d46b4..0000000000 --- a/test/VFS/Inputs/Bar.framework/Headers/C.h +++ /dev/null @@ -1 +0,0 @@ -// C.h diff --git a/test/VFS/Inputs/Bar.framework/Modules/module.modulemap b/test/VFS/Inputs/Bar.framework/Modules/module.modulemap deleted file mode 100644 index d5c759aceb..0000000000 --- a/test/VFS/Inputs/Bar.framework/Modules/module.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Bar [extern_c] { - umbrella "Headers" - export * - module * { export * } -} - diff --git a/test/VFS/Inputs/bar-headers.yaml b/test/VFS/Inputs/bar-headers.yaml deleted file mode 100644 index 846d55cc9e..0000000000 --- a/test/VFS/Inputs/bar-headers.yaml +++ /dev/null @@ -1,39 +0,0 @@ -{ - 'version': 0, - 'case-sensitive': 'false', - 'ignore-non-existent-contents': 'true', - 'roots': [ - { - 'type': 'directory', - 'name': "VDIR/Bar.framework/Headers", - 'contents': [ - { - 'type': 'file', - 'name': "A.h", - 'external-contents': "OUT_DIR/Bar.framework/Headers/A.h" - }, - { - 'type': 'file', - 'name': "B.h", - 'external-contents': "OUT_DIR/Bar.framework/Headers/B.h" - }, - { - 'type': 'file', - 'name': "C.h", - 'external-contents': "OUT_DIR/Bar.framework/Headers/C.h" - } - ] - }, - { - 'type': 'directory', - 'name': "VDIR/Bar.framework/Modules", - 'contents': [ - { - 'type': 'file', - 'name': "module.modulemap", - 'external-contents': "OUT_DIR/Bar.framework/Modules/module.modulemap" - } - ] - }, - ] -} diff --git a/test/VFS/umbrella-framework-import-skipnonexist.m b/test/VFS/umbrella-framework-import-skipnonexist.m deleted file mode 100644 index 39af83139a..0000000000 --- a/test/VFS/umbrella-framework-import-skipnonexist.m +++ /dev/null @@ -1,14 +0,0 @@ -// REQUIRES: crash-recovery, shell - -// FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it? -// XFAIL: mingw32 - -// RUN: rm -rf %t -// RUN: mkdir -p %t/vdir %t/outdir %t/cache -// RUN: cp -a %S/Inputs/Bar.Framework %t/outdir -// -// RUN: sed -e "s:VDIR:%t/vdir:g" -e "s:OUT_DIR:%t/outdir:g" %S/Inputs/bar-headers.yaml > %t/vdir/bar-headers.yaml -// RUN: rm -f %t/outdir/Bar.framework/Headers/B.h -// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -ivfsoverlay %t/vdir/bar-headers.yaml -F %t/vdir -fsyntax-only %s - -@import Bar; -- 2.40.0