[llvm] f9dbf73 - [llvm] Use the VFS to get the real path in `FileCollector` (#160943)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 29 09:00:42 PDT 2025
Author: Jan Svoboda
Date: 2025-09-29T09:00:37-07:00
New Revision: f9dbf738d81492eb7891655c5d4b2f481215eee0
URL: https://github.com/llvm/llvm-project/commit/f9dbf738d81492eb7891655c5d4b2f481215eee0
DIFF: https://github.com/llvm/llvm-project/commit/f9dbf738d81492eb7891655c5d4b2f481215eee0.diff
LOG: [llvm] Use the VFS to get the real path in `FileCollector` (#160943)
This PR starts using the correct VFS for getting file's real path in
`FileCollector` instead of using the real FS directly. This matches
compiler's behavior for other input files.
Added:
Modified:
llvm/lib/Support/FileCollector.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/FileCollector.cpp b/llvm/lib/Support/FileCollector.cpp
index 5dc224a6d427b..1e5de2c49a2b3 100644
--- a/llvm/lib/Support/FileCollector.cpp
+++ b/llvm/lib/Support/FileCollector.cpp
@@ -68,9 +68,8 @@ void FileCollector::PathCanonicalizer::updateWithRealPath(
SmallString<256> RealPath;
auto DirWithSymlink = CachedDirs.find(Directory);
if (DirWithSymlink == CachedDirs.end()) {
- // FIXME: Should this be a call to FileSystem::getRealpath(), in some
- // cases? What if there is nothing on disk?
- if (sys::fs::real_path(Directory, RealPath))
+ // FIXME: What if there is nothing on disk?
+ if (VFS->getRealPath(Directory, RealPath))
return;
CachedDirs[Directory] = std::string(RealPath);
} else {
More information about the llvm-commits
mailing list