llvm-project/clang/test/VFS
Alex Lorenz 4dc5573acc Introduce FileEntryRef and use it when handling includes to report correct dependencies
when the FileManager is reused across invocations

This commit introduces a parallel API to FileManager's getFile: getFileEntryRef, which returns
a reference to the FileEntry, and the name that was used to access the file. In the case of
a VFS with 'use-external-names', the FileEntyRef contains the external name of the file,
not the filename that was used to access it.

The new API is adopted only in the HeaderSearch and Preprocessor for include file lookup, so that the
accessed path can be propagated to SourceManager's FileInfo. SourceManager's FileInfo now can report this accessed path, using
the new getName method. This API is then adopted in the dependency collector, which now correctly reports dependencies when a file
is included both using a symlink and a real path in the case when the FileManager is reused across multiple Preprocessor invocations.

Note that this patch does not fix all dependency collector issues, as the same problem is still present in other cases when dependencies
are obtained using FileSkipped, InclusionDirective, and HasInclude. This will be fixed in follow-up commits.

Differential Revision: https://reviews.llvm.org/D65907

llvm-svn: 369680
2019-08-22 18:15:50 +00:00
..
Inputs [VFS] Add property 'fallthrough' that controls fallback to real file system. 2018-10-26 22:16:24 +00:00
external-names.c Introduce FileEntryRef and use it when handling includes to report correct dependencies 2019-08-22 18:15:50 +00:00
framework-import.m
implicit-include.c
include-mixed-real-and-virtual.c
include-real-from-virtual.c
include-virtual-from-real.c
include.c
incomplete-umbrella.m
module-import.m
module_missing_vfs.m [vfs] Don't bail out after a missing -ivfsoverlay file 2018-03-23 17:37:27 +00:00
parse-errors.c
real-path-found-first.m
relative-path.c
subframework-symlink.m [VFS] Implement `RedirectingFileSystem::getRealPath`. 2018-11-16 01:18:04 +00:00
test_nonmodular.c
umbrella-framework-import-skipnonexist.m [CMake] Use normalized Windows target triples 2018-08-09 02:16:18 +00:00
umbrella-mismatch.m [Modules][ObjC] Warn on the use of '@import' in framework headers 2018-06-27 20:29:36 +00:00
vfsroot-include.c [VFS] Add property 'fallthrough' that controls fallback to real file system. 2018-10-26 22:16:24 +00:00
vfsroot-module.m [VFS] Add property 'fallthrough' that controls fallback to real file system. 2018-10-26 22:16:24 +00:00
vfsroot-with-overlay.c [VFS] Add property 'fallthrough' that controls fallback to real file system. 2018-10-26 22:16:24 +00:00