]> granicus.if.org Git - clang/commit
Stopgap fix for finding module for a file mapped in the VFS
authorBen Langmuir <blangmuir@apple.com>
Fri, 23 May 2014 18:15:47 +0000 (18:15 +0000)
committerBen Langmuir <blangmuir@apple.com>
Fri, 23 May 2014 18:15:47 +0000 (18:15 +0000)
commit68d890da0854b4257c2fc2ab461cd6bfacf05c82
tree2702f6f054f8e91180832ce9a82338f0b598ad95
parent4c92d444ffb0c65cfc85e60edca08d32fb10fdae
Stopgap fix for finding module for a file mapped in the VFS

If we lookup a path using its 'real' path first, we need to ensure that
when we run header search we still use the VFS-mapped path or we will
not be able to find the corresponding module for the header.

The real problem is that we tie the name of a file to its underlying
FileEntry, which is uniqued by inode, so we only ever get the first name
it is looked up by. This doesn't work with modules, which rely on a
specific file system structure.  I'm hoping to have time to write up a
proposal for fixing this more permanently soon, but as a stopgap this
patch updates the name of the file's directory if it comes from a VFS
mapping.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209534 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/clang/Basic/FileSystemStatCache.h
include/clang/Basic/VirtualFileSystem.h
lib/Basic/FileManager.cpp
lib/Basic/FileSystemStatCache.cpp
lib/Basic/VirtualFileSystem.cpp
test/VFS/Inputs/actual_module.map
test/VFS/Inputs/import_some_frame.h [new file with mode: 0644]
test/VFS/Inputs/public_header.h
test/VFS/Inputs/public_header2.h [new file with mode: 0644]
test/VFS/Inputs/some_frame_module.map [new file with mode: 0644]
test/VFS/Inputs/vfsoverlay.yaml
test/VFS/real-path-found-first.m [new file with mode: 0644]