[PATCH] D95188: [VFS] Fix inconsistencies between relative paths and fallthrough in the RedirectingFileSystem

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 17:18:12 PST 2021


JDevlieghere created this revision.
JDevlieghere added a reviewer: dexonsmith.
Herald added a subscriber: hiraditya.
JDevlieghere requested review of this revision.
Herald added a project: LLVM.

This patch addresses inconsistencies in the way fallthrough is handled in the RedirectingFileSystem. Rather than trying to change the working directory of the external filesystem, the RedirectingFileSystem will canonicalize every path before handing it down. This guarantees that relative paths are resolved relative to the RedirectingFileSystem's working directory. This allows us to have a strictly virtual working directory, and still fallthrough for absolute paths, but not for relative paths that would get resolved incorrectly at the lower layer (for example, in case of the RealFileSystem, because the strictly virtual path does not exist).


https://reviews.llvm.org/D95188

Files:
  llvm/include/llvm/Support/VirtualFileSystem.h
  llvm/lib/Support/VirtualFileSystem.cpp
  llvm/unittests/Support/VirtualFileSystemTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95188.318363.patch
Type: text/x-patch
Size: 8274 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210122/44a07135/attachment.bin>


More information about the llvm-commits mailing list