[all-commits] [llvm/llvm-project] 0be9ca: [VFS] Fix inconsistencies between relative paths a...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Fri Jan 22 14:16:07 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0be9ca7c0f9a733f846bb6bc4e8e36d46b518162
      https://github.com/llvm/llvm-project/commit/0be9ca7c0f9a733f846bb6bc4e8e36d46b518162
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2021-01-22 (Fri, 22 Jan 2021)

  Changed paths:
    M llvm/include/llvm/Support/VirtualFileSystem.h
    M llvm/lib/Support/VirtualFileSystem.cpp
    M llvm/unittests/Support/VirtualFileSystemTest.cpp

  Log Message:
  -----------
  [VFS] Fix inconsistencies between relative paths and fallthrough.

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).

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




More information about the All-commits mailing list