class DependencyScanningFilesystemSharedCache

Declaration

class DependencyScanningFilesystemSharedCache { /* full declaration omitted */ };

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.

Declared at: clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h:151

Member Variables

private std::unique_ptr<CacheShard[]> CacheShards
private unsigned int NumShards

Method Overview

Methods

DependencyScanningFilesystemSharedCache()

Declared at: clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h:199

clang::tooling::dependencies::
    DependencyScanningFilesystemSharedCache::
        CacheShard&
        getShardForFilename(
            llvm::StringRef Filename) const

Description

Returns shard for the given key.

Declared at: clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h:202

Parameters

llvm::StringRef Filename

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

Declared at: clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h:203

Parameters

llvm::sys::fs::UniqueID UID