|
LLVM 23.0.0git
|
A unified wrapper representing the function offset table. More...
#include "llvm/ProfileData/SampleProfReader.h"
Public Types | |
| using | OnDiskTableType |
Public Member Functions | |
| SampleProfileFuncOffsetTable (InMemoryModeT, size_t InitialCapacity=0) | |
| void | insert (uint64_t GUID, uint64_t Offset) |
| Insert a function GUID and its profile offset into the in-memory map. | |
| SampleProfileFuncOffsetTable (OnDiskModeT, const uint8_t *Buckets, const uint8_t *Payload, const uint8_t *Base) | |
| Instantiate the on-disk chained hash table using raw stream pointers. | |
| std::optional< uint64_t > | lookup (uint64_t GUID) const |
| Query the offset table for the profile offset associated with the given GUID. | |
| void | clear () |
| Clear the in-memory map and release the on-disk table. | |
A unified wrapper representing the function offset table.
This class abstracts away the physical representation of the offset table, which can either be:
It exposes a single, type-agnostic lookup interface, shielding the reader from the underlying container types. To prevent hybrid-state corruption, the table's mode is locked at construction time, and assertions prevent modification in on-disk mode.
Definition at line 933 of file SampleProfReader.h.
Definition at line 935 of file SampleProfReader.h.
|
inlineexplicit |
Definition at line 938 of file SampleProfReader.h.
|
inline |
Instantiate the on-disk chained hash table using raw stream pointers.
Definition at line 952 of file SampleProfReader.h.
References llvm::sampleprof::Base, and llvm::OnDiskIterableChainedHashTable< FuncOffsetHashTableInfo >::Create().
|
inline |
Clear the in-memory map and release the on-disk table.
Definition at line 973 of file SampleProfReader.h.
|
inline |
Insert a function GUID and its profile offset into the in-memory map.
Enforces that the on-disk table must not have been set first.
Definition at line 945 of file SampleProfReader.h.
References assert(), and llvm::Offset.
|
inline |
Query the offset table for the profile offset associated with the given GUID.
Returns the offset if found, or std::nullopt if the key is missing.
Definition at line 959 of file SampleProfReader.h.