]> granicus.if.org Git - llvm/commit
[VirtualFileSystem] Support virtual working directory in the RedirectingFS
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 15 Oct 2019 17:14:24 +0000 (17:14 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 15 Oct 2019 17:14:24 +0000 (17:14 +0000)
commitfcfdbbfceaa79a5320b8a8898a17154e81a56c0b
tree48f6b014b576f984c3a0a2b65fd0daf6cf313140
parentab175251314d3bd96fd2179ddef9af79580d5b63
[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@374917 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/VirtualFileSystem.h
lib/Support/VirtualFileSystem.cpp
unittests/Support/VirtualFileSystemTest.cpp