|
clang 22.0.0git
|
This class is a shared cache, that caches the 'stat' and 'open' calls to the underlying real file system, and the scanned preprocessor directives of files. More...
#include "clang/DependencyScanning/DependencyScanningFilesystem.h"
Classes | |
| struct | CacheShard |
| struct | OutOfDateEntry |
Public Member Functions | |
| DependencyScanningFilesystemSharedCache () | |
| CacheShard & | getShardForFilename (StringRef Filename) const |
| Returns shard for the given key. | |
| CacheShard & | getShardForUID (llvm::sys::fs::UniqueID UID) const |
| std::vector< OutOfDateEntry > | getOutOfDateEntries (llvm::vfs::FileSystem &UnderlyingFS) const |
| Visits all cached entries and re-stat an entry using UnderlyingFS to check if the cache contains out-of-date entries. | |
This class is a shared cache, that caches the 'stat' and 'open' calls to the underlying real file system, and the scanned preprocessor directives of files.
It is sharded based on the hash of the key to reduce the lock contention for the worker threads.
Definition at line 153 of file DependencyScanningFilesystem.h.
| DependencyScanningFilesystemSharedCache::DependencyScanningFilesystemSharedCache | ( | ) |
Definition at line 83 of file DependencyScanningFilesystem.cpp.
| std::vector< DependencyScanningFilesystemSharedCache::OutOfDateEntry > DependencyScanningFilesystemSharedCache::getOutOfDateEntries | ( | llvm::vfs::FileSystem & | UnderlyingFS | ) | const |
Visits all cached entries and re-stat an entry using UnderlyingFS to check if the cache contains out-of-date entries.
An entry can be out-of-date for two reasons:
Definition at line 110 of file DependencyScanningFilesystem.cpp.
References clang::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::CacheByFilename, clang::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::CacheLock, clang::dependencies::CachedFileSystemEntry::getError(), and clang::dependencies::CachedFileSystemEntry::getStatus().
| DependencyScanningFilesystemSharedCache::CacheShard & DependencyScanningFilesystemSharedCache::getShardForFilename | ( | StringRef | Filename | ) | const |
Returns shard for the given key.
Definition at line 96 of file DependencyScanningFilesystem.cpp.
References llvm::hash_value().
| DependencyScanningFilesystemSharedCache::CacheShard & DependencyScanningFilesystemSharedCache::getShardForUID | ( | llvm::sys::fs::UniqueID | UID | ) | const |
Definition at line 103 of file DependencyScanningFilesystem.cpp.