[clang] [clang Dependency Scanning] Enhance File Caching Diagnostics (PR #144105)
Qiongsi Wu via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 13 09:08:28 PDT 2025
================
@@ -220,13 +220,41 @@ class DependencyScanningFilesystemSharedCache {
CacheShard &getShardForFilename(StringRef Filename) const;
CacheShard &getShardForUID(llvm::sys::fs::UniqueID UID) const;
- /// Visits all cached entries and re-stat an entry using FS if
- /// it is negatively stat cached. If re-stat succeeds on a path,
- /// the path is added to InvalidPaths, indicating that the cache
- /// may have erroneously negatively cached it. The caller can then
- /// use InvalidPaths to issue diagnostics.
- std::vector<StringRef>
- getInvalidNegativeStatCachedPaths(llvm::vfs::FileSystem &UnderlyingFS) const;
+ struct InvalidEntryDiagInfo {
+ // A null terminated string that contains a path.
+ const char *Path = nullptr;
+
+ enum class Type : unsigned char { NegativeCaching = 1, SizeChanged = 2 };
----------------
qiongsiwu wrote:
This enum class is redundant here, because we can check if `SizeInfo` below exists to tell which kind of diagnostics we are producing. However, it feels opaque to do that. Additionally, having a enum will allow us to easily add more kinds of diagnostics. Are we in favor of keeping the enum?
https://github.com/llvm/llvm-project/pull/144105
More information about the cfe-commits
mailing list