clang  15.0.0git
Public Member Functions | Public Attributes | List of all members
clang::tooling::dependencies::DependencyScanningFilesystemSharedCache::CacheShard Struct Reference

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

Collaboration diagram for clang::tooling::dependencies::DependencyScanningFilesystemSharedCache::CacheShard:
Collaboration graph
[legend]

Public Member Functions

const CachedFileSystemEntryfindEntryByFilename (StringRef Filename) const
 Returns entry associated with the filename or nullptr if none is found. More...
 
const CachedFileSystemEntryfindEntryByUID (llvm::sys::fs::UniqueID UID) const
 Returns entry associated with the unique ID or nullptr if none is found. More...
 
const CachedFileSystemEntrygetOrEmplaceEntryForFilename (StringRef Filename, llvm::ErrorOr< llvm::vfs::Status > Stat)
 Returns entry associated with the filename if there is some. More...
 
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. More...
 
const CachedFileSystemEntrygetOrInsertEntryForFilename (StringRef Filename, const CachedFileSystemEntry &Entry)
 Returns entry associated with the filename if there is some. More...
 

Public Attributes

std::mutex CacheLock
 The mutex that needs to be locked before mutation of any member. More...
 
llvm::StringMap< const CachedFileSystemEntry *, llvm::BumpPtrAllocator > EntriesByFilename
 Map from filenames to cached entries. More...
 
llvm::DenseMap< llvm::sys::fs::UniqueID, const CachedFileSystemEntry * > EntriesByUID
 Map from unique IDs to cached entries. More...
 
llvm::SpecificBumpPtrAllocator< CachedFileSystemEntryEntryStorage
 The backing storage for cached entries. More...
 
llvm::SpecificBumpPtrAllocator< CachedFileContentsContentsStorage
 The backing storage for cached contents. More...
 

Detailed Description

Definition at line 153 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 109 of file DependencyScanningFilesystem.cpp.

References CacheLock, EntriesByFilename, and Filename.

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

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

References Filename.

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

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

References Filename.

Member Data Documentation

◆ CacheLock

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

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

Definition at line 155 of file DependencyScanningFilesystem.h.

Referenced by findEntryByFilename().

◆ ContentsStorage

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

The backing storage for cached contents.

Definition at line 169 of file DependencyScanningFilesystem.h.

◆ EntriesByFilename

llvm::StringMap<const CachedFileSystemEntry *, llvm::BumpPtrAllocator> clang::tooling::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::EntriesByFilename

Map from filenames to cached entries.

Definition at line 159 of file DependencyScanningFilesystem.h.

Referenced by findEntryByFilename().

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

◆ EntryStorage

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

The backing storage for cached entries.

Definition at line 166 of file DependencyScanningFilesystem.h.


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