[clang] support relative roots to vfs overlays
authorRichard Howell <rhow@fb.com>
Wed, 19 Jan 2022 18:12:32 +0000 (10:12 -0800)
committerEllis Hoag <ellis.sparky.hoag@gmail.com>
Wed, 19 Jan 2022 18:13:06 +0000 (10:13 -0800)
commit4f61749e16f63b0c9ebd9bdd1f8bf4f570a31692
tree164d33e7e105a53d2b797dcf1315aa88d98fce42
parent88d81770f1101c8306bd1717755ef4eea0724deb
[clang] support relative roots to vfs overlays

This diff adds support for relative roots to VFS overlays. The directory root
will be made absolute from the current working directory and will be used to
determine the path style to use. This supports the use of VFS overlays with
remote build systems that might use a different working directory for each
compilation.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D116174
clang/test/VFS/Inputs/vfsoverlay-root-relative.yaml [new file with mode: 0644]
clang/test/VFS/vfsoverlay-relative-root.c [new file with mode: 0644]
llvm/include/llvm/Support/VirtualFileSystem.h
llvm/lib/Support/VirtualFileSystem.cpp
llvm/unittests/Support/VirtualFileSystemTest.cpp