[clang] [llvm] [clang][deps] Cache `VFS::getRealPath()` (PR #68645)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 11 13:00:47 PDT 2024


================
@@ -130,11 +130,11 @@ DependencyScanningFilesystemSharedCache::CacheShard::
     getOrEmplaceEntryForFilename(StringRef Filename,
                                  llvm::ErrorOr<llvm::vfs::Status> Stat) {
   std::lock_guard<std::mutex> LockGuard(CacheLock);
-  auto Insertion = EntriesByFilename.insert({Filename, nullptr});
-  if (Insertion.second)
-    Insertion.first->second =
+  const CachedFileSystemEntry *StoredEntry = CacheByFilename[Filename].first;
+  if (!StoredEntry)
+    StoredEntry =
----------------
jansvoboda11 wrote:

Ah, I only fixed this bug in `getOrEmplaceRealPathForFilename()`.

https://github.com/llvm/llvm-project/pull/68645


More information about the cfe-commits mailing list