[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.
This commit is contained in:
Jan Svoboda 2025-09-29 09:00:37 -07:00 committed by GitHub
parent dd3507b6c0
commit f9dbf738d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {