diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-08-12 18:18:24 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-08-12 18:18:24 +0000 |
commit | 5ce39e34c75bb51dbff07e3daa9d032f8d2f08fc (patch) | |
tree | d64aa74af5b2bce6f2887fe3f0a027dc5b7cfb74 /test/VFS | |
parent | a7362da637ced80c7a1087357b917863aa6a6fc7 (diff) |
Reapply [VFS] Skip non existent files from the VFS tree
Reapply r278457 with test fixed to not abouse fs case sensitivity.
When the VFS uses a YAML file, the real file path for a
virtual file is described in the "external-contents" field. Example:
...
{
'type': 'file',
'name': 'a.h',
'external-contents': '/a/b/c/a.h'
}
Currently, when parsing umbrella directories, we use
vfs::recursive_directory_iterator to gather the header files to generate the
equivalent modules for. If the external contents for a header does not exist,
we currently are unable to build a module, since the VFS
vfs::recursive_directory_iterator will fail when it finds an entry without a
reliable real path.
Since the YAML file could be prepared ahead of time and shared among
different compiler invocations, an entry might not yet have a reliable
path in 'external-contents', breaking the iteration.
Give the VFS the capability to skip such entries whenever
'ignore-non-existent-contents' property is set in the YAML file.
rdar://problem/27531549
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/VFS')
-rw-r--r-- | test/VFS/Inputs/Bar.framework/Headers/A.h | 1 | ||||
-rw-r--r-- | test/VFS/Inputs/Bar.framework/Headers/B.h | 1 | ||||
-rw-r--r-- | test/VFS/Inputs/Bar.framework/Headers/C.h | 1 | ||||
-rw-r--r-- | test/VFS/Inputs/Bar.framework/Modules/module.modulemap | 6 | ||||
-rw-r--r-- | test/VFS/Inputs/bar-headers.yaml | 39 | ||||
-rw-r--r-- | test/VFS/umbrella-framework-import-skipnonexist.m | 14 |
6 files changed, 62 insertions, 0 deletions
diff --git a/test/VFS/Inputs/Bar.framework/Headers/A.h b/test/VFS/Inputs/Bar.framework/Headers/A.h new file mode 100644 index 0000000000..975f1f0437 --- /dev/null +++ b/test/VFS/Inputs/Bar.framework/Headers/A.h @@ -0,0 +1 @@ +// A.h diff --git a/test/VFS/Inputs/Bar.framework/Headers/B.h b/test/VFS/Inputs/Bar.framework/Headers/B.h new file mode 100644 index 0000000000..761540b09c --- /dev/null +++ b/test/VFS/Inputs/Bar.framework/Headers/B.h @@ -0,0 +1 @@ +// B.h diff --git a/test/VFS/Inputs/Bar.framework/Headers/C.h b/test/VFS/Inputs/Bar.framework/Headers/C.h new file mode 100644 index 0000000000..a0121d46b4 --- /dev/null +++ b/test/VFS/Inputs/Bar.framework/Headers/C.h @@ -0,0 +1 @@ +// C.h diff --git a/test/VFS/Inputs/Bar.framework/Modules/module.modulemap b/test/VFS/Inputs/Bar.framework/Modules/module.modulemap new file mode 100644 index 0000000000..d5c759aceb --- /dev/null +++ b/test/VFS/Inputs/Bar.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +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 new file mode 100644 index 0000000000..846d55cc9e --- /dev/null +++ b/test/VFS/Inputs/bar-headers.yaml @@ -0,0 +1,39 @@ +{ + '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 new file mode 100644 index 0000000000..5c7cd6d9db --- /dev/null +++ b/test/VFS/umbrella-framework-import-skipnonexist.m @@ -0,0 +1,14 @@ +// 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; |