clang 22.0.0git
clang::tooling::dependencies::DependencyScanningFilesystemSharedCache::CacheShard Struct Reference

#include "clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h"

Public Member Functions

const CachedFileSystemEntryfindEntryByFilename (StringRef Filename) const
 Returns entry associated with the filename or nullptr if none is found.
const CachedFileSystemEntryfindEntryByUID (llvm::sys::fs::UniqueID UID) const
 Returns entry associated with the unique ID or nullptr if none is found.
const CachedFileSystemEntrygetOrEmplaceEntryForFilename (StringRef Filename, llvm::ErrorOr< llvm::vfs::Status > Stat)
 Returns entry associated with the filename if there is some.
const CachedFileSystemEntrygetOrEmplaceEntryForUID (llvm::sys::fs::UniqueID UID, llvm::vfs::Status Stat, std::unique_ptr< llvm::MemoryBuffer > Contents)
 Returns entry associated with the unique ID if there is some.
const CachedFileSystemEntrygetOrInsertEntryForFilename (StringRef Filename, const CachedFileSystemEntry &Entry)
 Returns entry associated with the filename if there is some.
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< std::pair< const CachedFileSystemEntry *, const CachedRealPath * >, llvm::BumpPtrAllocator > CacheByFilename
 Map from filenames to cached entries and real paths.
llvm::DenseMap< llvm::sys::fs::UniqueID, const CachedFileSystemEntry * > EntriesByUID
 Map from unique IDs to cached entries.
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 156 of file DependencyScanningFilesystem.h.

Member Function Documentation

◆ findEntryByFilename()

const CachedFileSystemEntry * DependencyScanningFilesystemSharedCache::CacheShard::findEntryByFilename ( StringRef Filename) const

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

Definition at line 155 of file DependencyScanningFilesystem.cpp.

References CacheByFilename, CacheLock, and clang::nullptr.

◆ findEntryByUID()

const CachedFileSystemEntry * DependencyScanningFilesystemSharedCache::CacheShard::findEntryByUID ( llvm::sys::fs::UniqueID UID) const

Returns entry associated with the unique ID or nullptr if none is found.

Definition at line 164 of file DependencyScanningFilesystem.cpp.

References CacheLock, EntriesByUID, and clang::nullptr.

◆ 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 219 of file DependencyScanningFilesystem.cpp.

References CacheByFilename, CacheLock, and clang::nullptr.

◆ getOrEmplaceEntryForFilename()

const CachedFileSystemEntry & DependencyScanningFilesystemSharedCache::CacheShard::getOrEmplaceEntryForFilename ( StringRef Filename,
llvm::ErrorOr< llvm::vfs::Status > Stat )

Returns entry associated with the filename if there is some.

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

Definition at line 172 of file DependencyScanningFilesystem.cpp.

References CacheByFilename, CacheLock, and EntryStorage.

◆ getOrEmplaceEntryForUID()

const CachedFileSystemEntry & DependencyScanningFilesystemSharedCache::CacheShard::getOrEmplaceEntryForUID ( llvm::sys::fs::UniqueID UID,
llvm::vfs::Status Stat,
std::unique_ptr< llvm::MemoryBuffer > Contents )

Returns entry associated with the unique ID if there is some.

Otherwise, constructs new one with the given status and contents, associates it with the unique ID and returns the result.

Definition at line 189 of file DependencyScanningFilesystem.cpp.

References CacheLock, ContentsStorage, EntriesByUID, and EntryStorage.

◆ 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 227 of file DependencyScanningFilesystem.cpp.

References CacheByFilename, CacheLock, and RealPathStorage.

◆ getOrInsertEntryForFilename()

const CachedFileSystemEntry & DependencyScanningFilesystemSharedCache::CacheShard::getOrInsertEntryForFilename ( StringRef Filename,
const CachedFileSystemEntry & Entry )

Returns entry associated with the filename if there is some.

Otherwise, associates the given entry with the filename and returns it.

Definition at line 207 of file DependencyScanningFilesystem.cpp.

References CacheByFilename, and CacheLock.

Member Data Documentation

◆ CacheByFilename

llvm::StringMap< std::pair<const CachedFileSystemEntry *, const CachedRealPath *>, llvm::BumpPtrAllocator> clang::tooling::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::CacheByFilename

◆ CacheLock

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

◆ ContentsStorage

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

The backing storage for cached contents.

Definition at line 174 of file DependencyScanningFilesystem.h.

Referenced by getOrEmplaceEntryForUID().

◆ EntriesByUID

llvm::DenseMap<llvm::sys::fs::UniqueID, const CachedFileSystemEntry *> clang::tooling::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::EntriesByUID

Map from unique IDs to cached entries.

Definition at line 168 of file DependencyScanningFilesystem.h.

Referenced by findEntryByUID(), and getOrEmplaceEntryForUID().

◆ EntryStorage

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

The backing storage for cached entries.

Definition at line 171 of file DependencyScanningFilesystem.h.

Referenced by getOrEmplaceEntryForFilename(), and getOrEmplaceEntryForUID().

◆ RealPathStorage

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

The backing storage for cached real paths.

Definition at line 177 of file DependencyScanningFilesystem.h.

Referenced by getOrEmplaceRealPathForFilename().


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