clang 23.0.0git
clang::dependencies::DependencyScanningFilesystemSharedCache::CacheShard Struct Reference

#include "clang/DependencyScanning/DependencyScanningFilesystem.h"

Classes

struct  FilenameCacheState
 Cache state per filename: resolved entry, real path, and an in-flight slot (if any). More...
struct  UIDCacheState
 Cache state stored per unique ID; similar to FilenameCacheState. More...

Public Member Functions

const CachedRealPathfindRealPathByFilename (StringRef Filename) const
 Returns the real path associated with the filename or nullptr if none is found.
const CachedRealPathgetOrEmplaceRealPathForFilename (StringRef Filename, llvm::ErrorOr< StringRef > RealPath)
 Returns the real path associated with the filename if there is some.

Public Attributes

std::mutex CacheLock
 The mutex that needs to be locked before mutation of any member.
llvm::StringMap< FilenameCacheState, llvm::BumpPtrAllocator > CacheByFilename
 Map from filenames to their cached state.
llvm::DenseMap< llvm::sys::fs::UniqueID, UIDCacheStateEntriesByUID
 Map from unique IDs to their cached state.
llvm::SpecificBumpPtrAllocator< CachedFileSystemEntryEntryStorage
 The backing storage for cached entries.
llvm::SpecificBumpPtrAllocator< CachedFileContentsContentsStorage
 The backing storage for cached contents.
llvm::SpecificBumpPtrAllocator< CachedRealPathRealPathStorage
 The backing storage for cached real paths.

Detailed Description

Definition at line 182 of file DependencyScanningFilesystem.h.

Member Function Documentation

◆ findRealPathByFilename()

const CachedRealPath * DependencyScanningFilesystemSharedCache::CacheShard::findRealPathByFilename ( StringRef Filename) const

Returns the real path associated with the filename or nullptr if none is found.

Definition at line 198 of file DependencyScanningFilesystem.cpp.

References CacheByFilename, CacheLock, and clang::nullptr.

◆ getOrEmplaceRealPathForFilename()

const CachedRealPath & DependencyScanningFilesystemSharedCache::CacheShard::getOrEmplaceRealPathForFilename ( StringRef Filename,
llvm::ErrorOr< StringRef > RealPath )

Returns the real path associated with the filename if there is some.

Otherwise, constructs new one with the given one, associates it with the filename and returns the result.

Definition at line 206 of file DependencyScanningFilesystem.cpp.

References CacheByFilename, CacheLock, and RealPathStorage.

Member Data Documentation

◆ CacheByFilename

llvm::StringMap<FilenameCacheState, llvm::BumpPtrAllocator> clang::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::CacheByFilename

◆ CacheLock

std::mutex clang::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::CacheLock
mutable

The mutex that needs to be locked before mutation of any member.

Definition at line 184 of file DependencyScanningFilesystem.h.

Referenced by findRealPathByFilename(), getOrEmplaceRealPathForFilename(), and clang::dependencies::DependencyScanningFilesystemSharedCache::getOutOfDateEntries().

◆ ContentsStorage

llvm::SpecificBumpPtrAllocator<CachedFileContents> clang::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::ContentsStorage

The backing storage for cached contents.

Definition at line 211 of file DependencyScanningFilesystem.h.

◆ EntriesByUID

llvm::DenseMap<llvm::sys::fs::UniqueID, UIDCacheState> clang::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::EntriesByUID

Map from unique IDs to their cached state.

Definition at line 205 of file DependencyScanningFilesystem.h.

◆ EntryStorage

llvm::SpecificBumpPtrAllocator<CachedFileSystemEntry> clang::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::EntryStorage

The backing storage for cached entries.

Definition at line 208 of file DependencyScanningFilesystem.h.

◆ RealPathStorage

llvm::SpecificBumpPtrAllocator<CachedRealPath> clang::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::RealPathStorage

The backing storage for cached real paths.

Definition at line 214 of file DependencyScanningFilesystem.h.

Referenced by getOrEmplaceRealPathForFilename().


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