LLVM 20.0.0git
|
Provides lookup on an on disk hash table. More...
#include "llvm/Support/OnDiskHashTable.h"
Classes | |
class | iterator |
Public Types | |
typedef Info | InfoType |
typedef Info::internal_key_type | internal_key_type |
typedef Info::external_key_type | external_key_type |
typedef Info::data_type | data_type |
typedef Info::hash_value_type | hash_value_type |
typedef Info::offset_type | offset_type |
Public Member Functions | |
OnDiskChainedHashTable (offset_type NumBuckets, offset_type NumEntries, const unsigned char *Buckets, const unsigned char *Base, const Info &InfoObj=Info()) | |
offset_type | getNumBuckets () const |
offset_type | getNumEntries () const |
const unsigned char * | getBase () const |
const unsigned char * | getBuckets () const |
bool | isEmpty () const |
iterator | find (const external_key_type &EKey, Info *InfoPtr=nullptr) |
Look up the stored data for a particular key. | |
iterator | find_hashed (const internal_key_type &IKey, hash_value_type KeyHash, Info *InfoPtr=nullptr) |
Look up the stored data for a particular key with a known hash. | |
iterator | end () const |
Info & | getInfoObj () |
Static Public Member Functions | |
static std::pair< offset_type, offset_type > | readNumBucketsAndEntries (const unsigned char *&Buckets) |
Read the number of buckets and the number of entries from a hash table produced by OnDiskHashTableGenerator::Emit, and advance the Buckets pointer past them. | |
static OnDiskChainedHashTable * | Create (const unsigned char *Buckets, const unsigned char *const Base, const Info &InfoObj=Info()) |
Create the hash table. | |
Provides lookup on an on disk hash table.
This needs an Info
that handles reading values from the hash table's payload and computes the hash for a given key. This should provide the following interface:
Definition at line 273 of file OnDiskHashTable.h.
typedef Info::data_type llvm::OnDiskChainedHashTable< Info >::data_type |
Definition at line 284 of file OnDiskHashTable.h.
typedef Info::external_key_type llvm::OnDiskChainedHashTable< Info >::external_key_type |
Definition at line 283 of file OnDiskHashTable.h.
typedef Info::hash_value_type llvm::OnDiskChainedHashTable< Info >::hash_value_type |
Definition at line 285 of file OnDiskHashTable.h.
typedef Info llvm::OnDiskChainedHashTable< Info >::InfoType |
Definition at line 281 of file OnDiskHashTable.h.
typedef Info::internal_key_type llvm::OnDiskChainedHashTable< Info >::internal_key_type |
Definition at line 282 of file OnDiskHashTable.h.
typedef Info::offset_type llvm::OnDiskChainedHashTable< Info >::offset_type |
Definition at line 286 of file OnDiskHashTable.h.
|
inline |
Definition at line 288 of file OnDiskHashTable.h.
References assert(), and llvm::sampleprof::Base.
|
inlinestatic |
Create the hash table.
Buckets | is the beginning of the hash table itself, which follows the payload of entire structure. This is the value returned by OnDiskHashTableGenerator::Emit. |
Base | is the point from which all offsets into the structure are based. This is offset 0 in the stream that was used when Emitting the table. |
Definition at line 419 of file OnDiskHashTable.h.
References assert(), llvm::sampleprof::Base, and llvm::OnDiskChainedHashTable< Info >::readNumBucketsAndEntries().
|
inline |
Definition at line 406 of file OnDiskHashTable.h.
|
inline |
Look up the stored data for a particular key.
Definition at line 344 of file OnDiskHashTable.h.
References llvm::OnDiskChainedHashTable< Info >::find_hashed().
|
inline |
Look up the stored data for a particular key with a known hash.
Definition at line 351 of file OnDiskHashTable.h.
References llvm::sampleprof::Base, Idx, llvm::Offset, and X.
Referenced by llvm::OnDiskChainedHashTable< Info >::find().
|
inline |
Definition at line 317 of file OnDiskHashTable.h.
References llvm::sampleprof::Base.
|
inline |
Definition at line 318 of file OnDiskHashTable.h.
|
inline |
Definition at line 408 of file OnDiskHashTable.h.
Referenced by llvm::OnDiskIterableChainedHashTable< Info >::data_begin(), and llvm::OnDiskIterableChainedHashTable< Info >::key_begin().
|
inline |
Definition at line 315 of file OnDiskHashTable.h.
|
inline |
Definition at line 316 of file OnDiskHashTable.h.
Referenced by llvm::OnDiskIterableChainedHashTable< Info >::data_begin(), and llvm::OnDiskIterableChainedHashTable< Info >::key_begin().
|
inline |
Definition at line 320 of file OnDiskHashTable.h.
|
inlinestatic |
Read the number of buckets and the number of entries from a hash table produced by OnDiskHashTableGenerator::Emit, and advance the Buckets pointer past them.
Definition at line 302 of file OnDiskHashTable.h.
References assert().
Referenced by llvm::OnDiskChainedHashTable< Info >::Create(), and llvm::OnDiskIterableChainedHashTable< Info >::Create().