clang  15.0.0git
Classes | Public Member Functions | List of all members
clang::tooling::dependencies::DependencyScanningFilesystemSharedCache Class Reference

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/Tooling/DependencyScanning/DependencyScanningFilesystem.h"

Classes

struct  CacheShard
 

Public Member Functions

 DependencyScanningFilesystemSharedCache ()
 
CacheShardgetShardForFilename (StringRef Filename) const
 Returns shard for the given key. More...
 
CacheShardgetShardForUID (llvm::sys::fs::UniqueID UID) const
 

Detailed Description

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 151 of file DependencyScanningFilesystem.h.

Constructor & Destructor Documentation

◆ DependencyScanningFilesystemSharedCache()

DependencyScanningFilesystemSharedCache::DependencyScanningFilesystemSharedCache ( )

Definition at line 84 of file DependencyScanningFilesystem.cpp.

References max().

Member Function Documentation

◆ getShardForFilename()

DependencyScanningFilesystemSharedCache::CacheShard & DependencyScanningFilesystemSharedCache::getShardForFilename ( StringRef  Filename) const

Returns shard for the given key.

Definition at line 96 of file DependencyScanningFilesystem.cpp.

References Filename, and clang::hash_value().

◆ getShardForUID()

DependencyScanningFilesystemSharedCache::CacheShard & DependencyScanningFilesystemSharedCache::getShardForUID ( llvm::sys::fs::UniqueID  UID) const

Definition at line 102 of file DependencyScanningFilesystem.cpp.

References clang::format::hash_combine().


The documentation for this class was generated from the following files: