aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/VirtualFileSystem.cpp
diff options
context:
space:
mode:
authorBen Barham <ben_barham@apple.com>2022-04-04 16:38:46 -0700
committerBen Barham <ben_barham@apple.com>2022-04-05 14:24:40 -0700
commitf65b0b5dcfeb04e9e6794b32a075432ce3de1ccd (patch)
treee71988b58638ca3123b773026406edda326e3351 /llvm/lib/Support/VirtualFileSystem.cpp
parentc2f6460145175d265cd1a7ad7906b778bb11fa3d (diff)
downloadllvm-f65b0b5dcfeb04e9e6794b32a075432ce3de1ccd.zip
llvm-f65b0b5dcfeb04e9e6794b32a075432ce3de1ccd.tar.gz
llvm-f65b0b5dcfeb04e9e6794b32a075432ce3de1ccd.tar.bz2
Revert "[VFS] RedirectingFileSystem only replace path if not already mapped"
This reverts commit 3fda0edc51fd68192a30e302d45db081bb02d7f9, which breaks crash reproducers in very specific circumstances. Specifically, since crash reproducers have `UseExternalNames` set to false, the `File->getFileEntry().getDir()->getName()` call in `DoFrameworkLookup` would use the *cached* directory name instead of the directory of the looked-up file. The plan is to re-commit this patch but to *add* `ExposesExternalVFSPath` rather than replace `IsVFSMapped`. Differential Revision: https://reviews.llvm.org/D123103
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
-rw-r--r--llvm/lib/Support/VirtualFileSystem.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp
index 14e9f02..cb34fa60 100644
--- a/llvm/lib/Support/VirtualFileSystem.cpp
+++ b/llvm/lib/Support/VirtualFileSystem.cpp
@@ -2163,16 +2163,10 @@ RedirectingFileSystem::lookupPathImpl(
static Status getRedirectedFileStatus(const Twine &OriginalPath,
bool UseExternalNames,
Status ExternalStatus) {
- // The path has been mapped by some nested VFS, don't override it with the
- // original path.
- if (ExternalStatus.ExposesExternalVFSPath)
- return ExternalStatus;
-
Status S = ExternalStatus;
if (!UseExternalNames)
S = Status::copyWithNewName(S, OriginalPath);
- else
- S.ExposesExternalVFSPath = true;
+ S.IsVFSMapped = true;
return S;
}
@@ -2274,9 +2268,7 @@ public:
ErrorOr<std::unique_ptr<File>>
File::getWithPath(ErrorOr<std::unique_ptr<File>> Result, const Twine &P) {
- // See \c getRedirectedFileStatus - don't update path if it's already been
- // mapped.
- if (!Result || (*Result)->status()->ExposesExternalVFSPath)
+ if (!Result)
return Result;
ErrorOr<std::unique_ptr<File>> F = std::move(*Result);