]> granicus.if.org Git - clang/commit
[VFS] Skip non existent files from the VFS tree
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 12 Aug 2016 01:51:04 +0000 (01:51 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 12 Aug 2016 01:51:04 +0000 (01:51 +0000)
commita0c9770b8c3afadebfc93269576a51edc792e3a1
treecca7cf7bd2c748f49313f4ac05df9ac50b06d624
parent3360e87f6e3d33ac8942c99938bdcc26761c643d
[VFS] Skip non existent files from the VFS tree

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@278457 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Basic/VirtualFileSystem.cpp
test/VFS/Inputs/Bar.framework/Headers/A.h [new file with mode: 0644]
test/VFS/Inputs/Bar.framework/Headers/B.h [new file with mode: 0644]
test/VFS/Inputs/Bar.framework/Headers/C.h [new file with mode: 0644]
test/VFS/Inputs/Bar.framework/Modules/module.modulemap [new file with mode: 0644]
test/VFS/Inputs/bar-headers.yaml [new file with mode: 0644]
test/VFS/umbrella-framework-import-skipnonexist.m [new file with mode: 0644]