]> granicus.if.org Git - llvm/commit
[Reland][VirtualFileSystem] Support virtual working directory in the RedirectingFS
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 15 Oct 2019 23:08:57 +0000 (23:08 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 15 Oct 2019 23:08:57 +0000 (23:08 +0000)
commitb46098e73d22b7c80e2895edeccfddb7496fd6a8
tree97910a6c40b391d2109935cf351e164ff929ea2b
parent72deff436dcd881c23ec2bef65b8f6eb4f309ea7
[Reland][VirtualFileSystem] Support virtual working directory in the RedirectingFS

Before this patch, changing the working directory of the RedirectingFS
would just forward to its external file system. This prevented us from
having a working directory that only existed in the VFS mapping.

This patch adds support for a virtual working directory in the
RedirectingFileSystem. It now keeps track of its own WD in addition to
updating the WD of the external file system. This ensures that we can
still fall through for relative paths.

This change was originally motivated by the reproducer infrastructure in
LLDB where we want to deal transparently with relative paths.

Differential revision: https://reviews.llvm.org/D65677

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374955 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/VirtualFileSystem.h
lib/Support/VirtualFileSystem.cpp
unittests/Support/VirtualFileSystemTest.cpp