llvm-project/clang/test/VFS
Ben Barham 502f14d6f2 [VFS] Add a "redirecting-with" field to overlays
Extend "fallthrough" to allow a third option: "fallback". Fallthrough
allows the original path to used if the redirected (or mapped) path
fails. Fallback is the reverse of this, ie. use the original path and
fallback to the mapped path otherwise.

While this result *can* be achieved today using multiple overlays, this
adds a much more intuitive option. As an example, take two directories
"A" and "B". We would like files from "A" to be used, unless they don't
exist, in which case the VFS should fallback to those in "B".

With the current fallthrough option this is possible by adding two
overlays: one mapping from A -> B and another mapping from B -> A. Since
the frontend *nests* the two RedirectingFileSystems, the result will
be that "A" is mapped to "B" and back to "A", unless it isn't in "A" in
which case it fallsthrough to "B" (or fails if it exists in neither).

Using "fallback" semantics allows a single overlay instead: one mapping
from "A" to "B" but only using that mapping if the operation in "A"
fails first.

"redirect-only" is used to represent the current "fallthrough: false"
case.

Differential Revision: https://reviews.llvm.org/D117937
2022-02-03 13:10:23 -08:00
..
Inputs [VFS] Add a "redirecting-with" field to overlays 2022-02-03 13:10:23 -08:00
broken-vfs-module-dep.c
directory.c
external-names.c
fallback.c [VFS] Add a "redirecting-with" field to overlays 2022-02-03 13:10:23 -08: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-header-mismatches.m [Modules] Do not remove failed modules after the control block phase 2021-08-17 16:46:51 -07:00
module-import.m
module_missing_vfs.m
parse-errors.c [VFS] Add a "redirecting-with" field to overlays 2022-02-03 13:10:23 -08:00
real-path-found-first.m
relative-path-errors.c reland: [VFS] Use original path when falling back to external FS 2021-11-13 12:14:34 -08:00
relative-path.c
subframework-symlink.m
test_nonmodular.c
umbrella-framework-import-skipnonexist.m
vfsoverlay-relative-root.c [clang] support relative roots to vfs overlays 2022-01-19 10:13:06 -08:00
vfsroot-include.c
vfsroot-module.m
vfsroot-with-overlay.c