r278459 - Revert "[VFS] Skip non existent files from the VFS tree"

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 11 19:17:27 PDT 2016


Author: bruno
Date: Thu Aug 11 21:17:26 2016
New Revision: 278459

URL: http://llvm.org/viewvc/llvm-project?rev=278459&view=rev
Log:
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.

Removed:
    cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/A.h
    cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/B.h
    cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/C.h
    cfe/trunk/test/VFS/Inputs/Bar.framework/Modules/module.modulemap
    cfe/trunk/test/VFS/Inputs/bar-headers.yaml
    cfe/trunk/test/VFS/umbrella-framework-import-skipnonexist.m
Modified:
    cfe/trunk/lib/Basic/VirtualFileSystem.cpp

Modified: cfe/trunk/lib/Basic/VirtualFileSystem.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/VirtualFileSystem.cpp?rev=278459&r1=278458&r2=278459&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/VirtualFileSystem.cpp (original)
+++ cfe/trunk/lib/Basic/VirtualFileSystem.cpp Thu Aug 11 21:17:26 2016
@@ -1778,47 +1778,29 @@ VFSFromYamlDirIterImpl::VFSFromYamlDirIt
     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();
 }
 

Removed: cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/A.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/A.h?rev=278458&view=auto
==============================================================================
--- cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/A.h (original)
+++ cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/A.h (removed)
@@ -1 +0,0 @@
-// A.h

Removed: cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/B.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/B.h?rev=278458&view=auto
==============================================================================
--- cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/B.h (original)
+++ cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/B.h (removed)
@@ -1 +0,0 @@
-// B.h

Removed: cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/C.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/C.h?rev=278458&view=auto
==============================================================================
--- cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/C.h (original)
+++ cfe/trunk/test/VFS/Inputs/Bar.framework/Headers/C.h (removed)
@@ -1 +0,0 @@
-// C.h

Removed: cfe/trunk/test/VFS/Inputs/Bar.framework/Modules/module.modulemap
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/VFS/Inputs/Bar.framework/Modules/module.modulemap?rev=278458&view=auto
==============================================================================
--- cfe/trunk/test/VFS/Inputs/Bar.framework/Modules/module.modulemap (original)
+++ cfe/trunk/test/VFS/Inputs/Bar.framework/Modules/module.modulemap (removed)
@@ -1,6 +0,0 @@
-framework module Bar [extern_c] {
-  umbrella "Headers"
-  export *
-  module * { export * }
-}
-

Removed: cfe/trunk/test/VFS/Inputs/bar-headers.yaml
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/VFS/Inputs/bar-headers.yaml?rev=278458&view=auto
==============================================================================
--- cfe/trunk/test/VFS/Inputs/bar-headers.yaml (original)
+++ cfe/trunk/test/VFS/Inputs/bar-headers.yaml (removed)
@@ -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"
-        }
-      ]
-    },
-  ]
-}

Removed: cfe/trunk/test/VFS/umbrella-framework-import-skipnonexist.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/VFS/umbrella-framework-import-skipnonexist.m?rev=278458&view=auto
==============================================================================
--- cfe/trunk/test/VFS/umbrella-framework-import-skipnonexist.m (original)
+++ cfe/trunk/test/VFS/umbrella-framework-import-skipnonexist.m (removed)
@@ -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
-
- at import Bar;




More information about the cfe-commits mailing list