@@ -91,10 +91,10 @@ void ModuleDependencyCollector::attachToPreprocessor(Preprocessor &PP) {
9191 std::make_unique<ModuleDependencyMMCallbacks>(*this ));
9292}
9393
94- static bool isCaseSensitivePath (StringRef Path) {
94+ static bool isCaseSensitivePath (llvm::vfs::FileSystem &VFS, StringRef Path) {
9595 SmallString<256 > TmpDest = Path, UpperDest, RealDest;
9696 // Remove component traversals, links, etc.
97- if (llvm::sys::fs::real_path (Path, TmpDest))
97+ if (VFS. getRealPath (Path, TmpDest))
9898 return true ; // Current default value in vfs.yaml
9999 Path = TmpDest;
100100
@@ -104,7 +104,7 @@ static bool isCaseSensitivePath(StringRef Path) {
104104 // already expects when sensitivity isn't setup.
105105 for (auto &C : Path)
106106 UpperDest.push_back (toUppercase (C));
107- if (!llvm::sys::fs::real_path (UpperDest, RealDest) && Path == RealDest)
107+ if (!VFS. getRealPath (UpperDest, RealDest) && Path == RealDest)
108108 return false ;
109109 return true ;
110110}
@@ -121,7 +121,8 @@ void ModuleDependencyCollector::writeFileMap() {
121121
122122 // Explicitly set case sensitivity for the YAML writer. For that, find out
123123 // the sensitivity at the path where the headers all collected to.
124- VFSWriter.setCaseSensitivity (isCaseSensitivePath (VFSDir));
124+ VFSWriter.setCaseSensitivity (
125+ isCaseSensitivePath (Canonicalizer.getFileSystem (), VFSDir));
125126
126127 // Do not rely on real path names when executing the crash reproducer scripts
127128 // since we only want to actually use the files we have on the VFS cache.
@@ -153,7 +154,7 @@ std::error_code ModuleDependencyCollector::copyToRoot(StringRef Src,
153154 } else {
154155 // When collecting entries from input vfsoverlays, copy the external
155156 // contents into the cache but still map from the source.
156- if (!fs:: exists (Dst))
157+ if (!Canonicalizer. getFileSystem (). exists (Dst))
157158 return std::error_code ();
158159 path::append (CacheDst, Dst);
159160 Paths.CopyFrom = Dst;
0 commit comments