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).
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
- Implement makeCanonical using canonicalize
- Add missing call to makeCanonical is isLocal
llvm/lib/Support/VirtualFileSystem.cpp | ||
---|---|---|
1754 | I was trying to avoid the copy into the SmallString, but that didn't work out because you need a buffer to copy from (otherwise you're copying from yourself). We could add an overload to remove_leading_dotslash that performs the operation in-place, but that would be for a separate patch. |
I think you need to call makeCanonical here.