aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/FileCollector.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2021-02-16 20:19:25 +0100
committerRaphael Isemann <teemperor@gmail.com>2021-02-16 20:21:32 +0100
commitf88b502d9bc7c2d7db8db340d5b98fc7f46eba9c (patch)
tree0ad5993494f529d5b895b663203158d7cc7d52a1 /llvm/lib/Support/FileCollector.cpp
parentecea7218fb9b994b26471e9877851cdb51a5f1d4 (diff)
downloadllvm-f88b502d9bc7c2d7db8db340d5b98fc7f46eba9c.zip
llvm-f88b502d9bc7c2d7db8db340d5b98fc7f46eba9c.tar.gz
llvm-f88b502d9bc7c2d7db8db340d5b98fc7f46eba9c.tar.bz2
[FileCollector] Fix that the file system case-sensitivity check was inverted
real_path returns an `std::error_code` which evaluates to `true` in case an error happens and `false` if not. This code was checking the inverse, so case-insensitive file systems ended up being detected as case sensitive. Tested using an LLDB reproducer test as we anyway need a real file system and also some matching logic to detect whether the respective file system is case-sensitive (which the test is doing via some Python checks that we can't really emulate with the usual FileCheck logic). Fixes rdar://67003004 Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D96795
Diffstat (limited to 'llvm/lib/Support/FileCollector.cpp')
-rw-r--r--llvm/lib/Support/FileCollector.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/FileCollector.cpp b/llvm/lib/Support/FileCollector.cpp
index 9948207..7d23d03 100644
--- a/llvm/lib/Support/FileCollector.cpp
+++ b/llvm/lib/Support/FileCollector.cpp
@@ -35,7 +35,7 @@ static bool isCaseSensitivePath(StringRef Path) {
SmallString<256> TmpDest = Path, UpperDest, RealDest;
// Remove component traversals, links, etc.
- if (!sys::fs::real_path(Path, TmpDest))
+ if (sys::fs::real_path(Path, TmpDest))
return true; // Current default value in vfs.yaml
Path = TmpDest;
@@ -44,7 +44,7 @@ static bool isCaseSensitivePath(StringRef Path) {
// sensitive in the absence of real_path, since this is the YAMLVFSWriter
// default.
UpperDest = Path.upper();
- if (sys::fs::real_path(UpperDest, RealDest) && Path.equals(RealDest))
+ if (!sys::fs::real_path(UpperDest, RealDest) && Path.equals(RealDest))
return false;
return true;
}