bool IsVolatile = false);
/// \brief Get a directory_iterator for \p Dir.
- /// \note The 'end' iterator is directory_iterator()
+ /// \note The 'end' iterator is directory_iterator().
virtual directory_iterator dir_begin(const Twine &Dir,
std::error_code &EC) = 0;
};
typedef llvm::sys::fs::recursive_directory_iterator
recursive_directory_iterator;
const DirectoryEntry *Dir = Mod->getUmbrellaDir();
+ vfs::FileSystem &FS = *FileMgr.getVirtualFileSystem();
std::error_code EC;
- for (recursive_directory_iterator Entry(Dir->getName(), EC), End;
+ for (vfs::recursive_directory_iterator Entry(FS, Dir->getName(), EC), End;
Entry != End && !EC; Entry.increment(EC)) {
using llvm::StringSwitch;
// Check whether this entry has an extension typically associated with
// headers.
- if (!StringSwitch<bool>(llvm::sys::path::extension(Entry->path()))
+ if (!StringSwitch<bool>(llvm::sys::path::extension(Entry->getName()))
.Cases(".h", ".H", ".hh", ".hpp", true)
.Default(false))
continue;
- if (const FileEntry *Header = getFileManager().getFile(Entry->path()))
+ if (const FileEntry *Header =
+ getFileManager().getFile(Entry->getName()))
if (!getSourceManager().hasFileInfo(Header)) {
if (!ModMap.isHeaderInUnavailableModule(Header)) {
// Find the relative path that would access this header.
--- /dev/null
+// does not include IncompleteVFS.h or IncompleteReal.h
--- /dev/null
+// IncompleteVFS.h
--- /dev/null
+framework module Incomplete {
+ umbrella header "Incomplete.h"
+ export *
+ module * { export * }
+}
},
{ 'name': 'Foo.framework/Headers/Foo.h', 'type': 'file',
'external-contents': 'INPUT_DIR/Foo.h'
+ },
+ { 'name': 'Incomplete.framework', 'type': 'directory',
+ 'contents': [
+ { 'name': 'Headers', 'type': 'directory',
+ 'contents': [
+ { 'name': 'Incomplete.h', 'type': 'file',
+ 'external-contents': 'INPUT_DIR/Incomplete.h'
+ },
+ { 'name': 'IncompleteVFS.h', 'type': 'file',
+ 'external-contents': 'INPUT_DIR/IncompleteVFS.h'
+ }
+ ]
+ },
+ { 'name': 'Modules/module.modulemap', 'type': 'file',
+ 'external-contents': 'INPUT_DIR/incomplete-umbrella.modulemap'
+ }
+ ]
}
]
}
--- /dev/null
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/Incomplete.framework/Headers
+// RUN: echo '// IncompleteReal.h' > %t/Incomplete.framework/Headers/IncompleteReal.h
+// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml
+// RUN: not %clang_cc1 -Werror -fmodules -fmodules-cache-path=%t \
+// RUN: -ivfsoverlay %t.yaml -F %t -fsyntax-only %s 2>&1 | FileCheck %s
+// REQUIRES: shell
+
+@import Incomplete;
+// CHECK: umbrella header for module 'Incomplete' {{.*}}IncompleteVFS.h
+// CHECK: umbrella header for module 'Incomplete' {{.*}}IncompleteReal.h
+// CHECK: could not build module 'Incomplete'