aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Basic/FileManagerTest.cpp
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2022-08-01 13:30:41 -0700
committerBen Langmuir <blangmuir@apple.com>2022-08-01 15:45:51 -0700
commit98cf745a032ea0d29fbddaa204760d4e823c237f (patch)
tree38b1a91cd961f0491818611a06a14463b2667fec /clang/unittests/Basic/FileManagerTest.cpp
parentda5b1bf5bb0f1c3d7553a286ad50245bb11694b9 (diff)
downloadllvm-98cf745a032ea0d29fbddaa204760d4e823c237f.zip
llvm-98cf745a032ea0d29fbddaa204760d4e823c237f.tar.gz
llvm-98cf745a032ea0d29fbddaa204760d4e823c237f.tar.bz2
[clang] Only modify FileEntryRef names that are externally remapped
As progress towards having FileEntryRef contain the requested name of the file, this commit narrows the "remap" hack to only apply to paths that were remapped to an external contents path by a VFS. That was always the original intent of this code, and the fact it was making relative paths absolute was an unintended side effect. Differential Revision: https://reviews.llvm.org/D130935
Diffstat (limited to 'clang/unittests/Basic/FileManagerTest.cpp')
-rw-r--r--clang/unittests/Basic/FileManagerTest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/unittests/Basic/FileManagerTest.cpp b/clang/unittests/Basic/FileManagerTest.cpp
index 535d4d9..6e60bba 100644
--- a/clang/unittests/Basic/FileManagerTest.cpp
+++ b/clang/unittests/Basic/FileManagerTest.cpp
@@ -44,16 +44,16 @@ private:
}
}
- if (!StatPath)
- StatPath = Path;
-
auto fileType = IsFile ?
llvm::sys::fs::file_type::regular_file :
llvm::sys::fs::file_type::directory_file;
- llvm::vfs::Status Status(StatPath, llvm::sys::fs::UniqueID(1, INode),
+ llvm::vfs::Status Status(StatPath ? StatPath : Path,
+ llvm::sys::fs::UniqueID(1, INode),
/*MTime*/{}, /*User*/0, /*Group*/0,
/*Size*/0, fileType,
llvm::sys::fs::perms::all_all);
+ if (StatPath)
+ Status.ExposesExternalVFSPath = true;
StatCalls[Path] = Status;
}