LLVM  3.7.0
Classes | Public Member Functions | List of all members
llvm::OnDiskChainedHashTableGenerator< Info > Class Template Reference

Generates an on disk hash table. More...

#include <OnDiskHashTable.h>

Public Member Functions

void insert (typename Info::key_type_ref Key, typename Info::data_type_ref Data)
 Insert an entry into the table. More...
 
void insert (typename Info::key_type_ref Key, typename Info::data_type_ref Data, Info &InfoObj)
 Insert an entry into the table. More...
 
offset_type Emit (raw_ostream &Out)
 Emit the table to Out, which must not be at offset 0. More...
 
offset_type Emit (raw_ostream &Out, Info &InfoObj)
 Emit the table to Out, which must not be at offset 0. More...
 
 OnDiskChainedHashTableGenerator ()
 
 ~OnDiskChainedHashTableGenerator ()
 

Detailed Description

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

Generates an on disk hash table.

This needs an Info that handles storing values into the hash table's payload and computes the hash for a given key. This should provide the following interface:

class ExampleInfo {
public:
typedef ExampleKey key_type; // Must be copy constructible
typedef ExampleKey &key_type_ref;
typedef ExampleData data_type; // Must be copy constructible
typedef ExampleData &data_type_ref;
typedef uint32_t hash_value_type; // The type the hash function returns.
typedef uint32_t offset_type; // The type for offsets into the table.
/// Calculate the hash for Key
static hash_value_type ComputeHash(key_type_ref Key);
/// Return the lengths, in bytes, of the given Key/Data pair.
static std::pair<offset_type, offset_type>
EmitKeyDataLength(raw_ostream &Out, key_type_ref Key, data_type_ref Data);
/// Write Key to Out. KeyLen is the length from EmitKeyDataLength.
static void EmitKey(raw_ostream &Out, key_type_ref Key,
offset_type KeyLen);
/// Write Data to Out. DataLen is the length from EmitKeyDataLength.
static void EmitData(raw_ostream &Out, key_type_ref Key,
data_type_ref Data, offset_type DataLen);
};

Definition at line 58 of file OnDiskHashTable.h.

Constructor & Destructor Documentation

template<typename Info>
llvm::OnDiskChainedHashTableGenerator< Info >::OnDiskChainedHashTableGenerator ( )
inline

Definition at line 185 of file OnDiskHashTable.h.

template<typename Info>
llvm::OnDiskChainedHashTableGenerator< Info >::~OnDiskChainedHashTableGenerator ( )
inline

Definition at line 193 of file OnDiskHashTable.h.

Member Function Documentation

template<typename Info>
offset_type llvm::OnDiskChainedHashTableGenerator< Info >::Emit ( raw_ostream Out)
inline

Emit the table to Out, which must not be at offset 0.

Definition at line 133 of file OnDiskHashTable.h.

template<typename Info>
offset_type llvm::OnDiskChainedHashTableGenerator< Info >::Emit ( raw_ostream Out,
Info &  InfoObj 
)
inline

Emit the table to Out, which must not be at offset 0.

Uses the provided Info instead of a stack allocated one.

Definition at line 141 of file OnDiskHashTable.h.

References I, llvm::AArch64CC::LE, N, llvm::OffsetToAlignment(), llvm::raw_ostream::tell(), and llvm::support::endian::Writer< endian >::write().

template<typename Info>
void llvm::OnDiskChainedHashTableGenerator< Info >::insert ( typename Info::key_type_ref  Key,
typename Info::data_type_ref  Data 
)
inline

Insert an entry into the table.

Definition at line 114 of file OnDiskHashTable.h.

template<typename Info>
void llvm::OnDiskChainedHashTableGenerator< Info >::insert ( typename Info::key_type_ref  Key,
typename Info::data_type_ref  Data,
Info &  InfoObj 
)
inline

Insert an entry into the table.

Uses the provided Info instead of a stack allocated one.

Definition at line 123 of file OnDiskHashTable.h.

References llvm::SpecificBumpPtrAllocator< T >::Allocate().


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