LLVM: llvm::OnDiskChainedHashTable< Info > Class Template Reference (original) (raw)

Provides lookup on an on disk hash table. More...

#include "[llvm/Support/OnDiskHashTable.h](OnDiskHashTable%5F8h%5Fsource.html)"

Public Types
using InfoType = Info
using internal_key_type = typename Info::internal_key_type
using external_key_type = typename Info::external_key_type
using data_type = typename Info::data_type
using hash_value_type = typename Info::hash_value_type
using offset_type = typename Info::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 ()

template<typename Info>
class llvm::OnDiskChainedHashTable< Info >

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:

class ExampleLookupInfo {

public:

typedef ExampleData data_type;

typedef ExampleInternalKey internal_key_type;

typedef ExampleKey external_key_type;

typedef uint32_t hash_value_type;

typedef uint32_t offset_type;

static bool EqualKey(internal_key_type &Key1, internal_key_type &Key2);

static const internal_key_type &GetInternalKey(external_key_type &EKey);

static std::pair<offset_type, offset_type>

ReadKeyDataLength(const unsigned char *&Buffer);

const internal_key_type &ReadKey(const unsigned char *Buffer,

offset_type KeyLen);

data_type ReadData(StringRef Key, const unsigned char *Buffer,

offset_type DataLen);

};

uint64_t ComputeHash(const FunctionSummary *FS, unsigned I)

typename Info::hash_value_type hash_value_type

typename Info::external_key_type external_key_type

typename Info::offset_type offset_type

typename Info::internal_key_type internal_key_type

typename Info::data_type data_type

StringRef - Represent a constant reference to a string, i.e.

LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key

Definition at line 273 of file OnDiskHashTable.h.

data_type

external_key_type

hash_value_type

InfoType

internal_key_type

offset_type

Create()

Create the hash table.

Parameters

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(), Info, OnDiskChainedHashTable(), and readNumBucketsAndEntries().

end()

find()

find_hashed()

getBase()

getBuckets()

getInfoObj()

getNumBuckets()

getNumEntries()

isEmpty()

readNumBucketsAndEntries()


The documentation for this class was generated from the following file: