LLVM API Documentation

Classes | Public Member Functions
llvm::OnDiskChainedHashTableGenerator< Info > Class Template Reference

Generates an on disk hash table. More...

#include <OnDiskHashTable.h>

List of all members.

Classes

class  Bucket
 A linked list of values in a particular hash bucket.
class  Item
 A single item in the hash table.

Public Member Functions

void insert (typename Info::key_type_ref Key, typename Info::data_type_ref Data)
 Insert an entry into the table.
void insert (typename Info::key_type_ref Key, typename Info::data_type_ref Data, Info &InfoObj)
 Insert an entry into the table.
offset_type Emit (raw_ostream &Out)
 Emit the table to Out, which must not be at offset 0.
offset_type Emit (raw_ostream &Out, Info &InfoObj)
 Emit the table to Out, which must not be at offset 0.
 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 188 of file OnDiskHashTable.h.

References llvm::LibFunc::calloc.

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

Definition at line 196 of file OnDiskHashTable.h.

References llvm::LibFunc::free.


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 136 of file OnDiskHashTable.h.

Referenced by llvm::InstrProfWriter::write().

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 144 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 117 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 126 of file OnDiskHashTable.h.

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


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