[clang] [clang Dependency Scanning] Enhance File Caching Diagnostics (PR #144105)
Qiongsi Wu via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 13 17:55:31 PDT 2025
================
@@ -107,31 +107,39 @@ DependencyScanningFilesystemSharedCache::getShardForUID(
return CacheShards[Hash % NumShards];
}
-std::vector<StringRef>
-DependencyScanningFilesystemSharedCache::getInvalidNegativeStatCachedPaths(
+std::vector<DependencyScanningFilesystemSharedCache::InvalidEntryDiagInfo>
+DependencyScanningFilesystemSharedCache::getInvalidEntryDiagInfo(
llvm::vfs::FileSystem &UnderlyingFS) const {
// Iterate through all shards and look for cached stat errors.
- std::vector<StringRef> InvalidPaths;
+ std::vector<InvalidEntryDiagInfo> InvalidDiagInfo;
for (unsigned i = 0; i < NumShards; i++) {
const CacheShard &Shard = CacheShards[i];
std::lock_guard<std::mutex> LockGuard(Shard.CacheLock);
----------------
qiongsiwu wrote:
How much do we worry about the performance of going through the whole cache iteratively in this loop? I think a simple thing to do is to check a single shard per thread using a thread pool. Do we think it is worth doing?
https://github.com/llvm/llvm-project/pull/144105
More information about the cfe-commits
mailing list