LLVM  7.0.0svn
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::pdb::HashTable Class Reference

#include "llvm/DebugInfo/PDB/Native/HashTable.h"

Collaboration diagram for llvm::pdb::HashTable:
Collaboration graph
[legend]

Public Member Functions

 HashTable ()
 
 HashTable (uint32_t Capacity)
 
Error load (BinaryStreamReader &Stream)
 
uint32_t calculateSerializedLength () const
 
Error commit (BinaryStreamWriter &Writer) const
 
void clear ()
 
uint32_t capacity () const
 
uint32_t size () const
 
HashTableIterator begin () const
 
HashTableIterator end () const
 
HashTableIterator find (uint32_t K) const
 Find the entry with the specified key value. More...
 
template<typename Traits , typename Key , typename Context >
HashTableIterator find_as (const Key &K, const Context &Ctx) const
 Find the entry whose key has the specified hash value, using the specified traits defining hash function and equality. More...
 
void set (uint32_t K, uint32_t V)
 Set the entry with the specified key to the specified value. More...
 
template<typename Traits , typename Key , typename Context >
bool set_as (const Key &K, uint32_t V, Context &Ctx)
 Set the entry using a key type that the specified Traits can convert from a real key to an internal key. More...
 
void remove (uint32_t K)
 
template<typename Traits , typename Key , typename Context >
void remove_as (const Key &K, Context &Ctx)
 
uint32_t get (uint32_t K)
 

Protected Member Functions

bool isPresent (uint32_t K) const
 
bool isDeleted (uint32_t K) const
 

Protected Attributes

BucketList Buckets
 
SparseBitVector Present
 
SparseBitVector Deleted
 

Friends

class HashTableIterator
 

Detailed Description

Definition at line 55 of file HashTable.h.

Constructor & Destructor Documentation

◆ HashTable() [1/2]

HashTable::HashTable ( )

Definition at line 33 of file HashTable.cpp.

◆ HashTable() [2/2]

HashTable::HashTable ( uint32_t  Capacity)
explicit

Definition at line 35 of file HashTable.cpp.

References Buckets.

Member Function Documentation

◆ begin()

HashTableIterator HashTable::begin ( ) const

Definition at line 124 of file HashTable.cpp.

References HashTableIterator.

◆ calculateSerializedLength()

uint32_t HashTable::calculateSerializedLength ( ) const

◆ capacity()

uint32_t HashTable::capacity ( ) const

Definition at line 120 of file HashTable.cpp.

References Buckets.

Referenced by commit().

◆ clear()

void HashTable::clear ( )

◆ commit()

Error HashTable::commit ( BinaryStreamWriter Writer) const

◆ end()

HashTableIterator HashTable::end ( ) const

Definition at line 126 of file HashTable.cpp.

References HashTableIterator.

Referenced by get().

◆ find()

HashTableIterator HashTable::find ( uint32_t  K) const

Find the entry with the specified key value.

Definition at line 130 of file HashTable.cpp.

Referenced by get().

◆ find_as()

template<typename Traits , typename Key , typename Context >
HashTableIterator llvm::pdb::HashTable::find_as ( const Key &  K,
const Context Ctx 
) const
inline

Find the entry whose key has the specified hash value, using the specified traits defining hash function and equality.

Definition at line 88 of file HashTable.h.

References assert(), first, H, and I.

◆ get()

uint32_t HashTable::get ( uint32_t  K)

Definition at line 140 of file HashTable.cpp.

References assert(), end(), find(), and I.

◆ isDeleted()

bool llvm::pdb::HashTable::isDeleted ( uint32_t  K) const
inlineprotected

Definition at line 146 of file HashTable.h.

References Deleted.

◆ isPresent()

bool llvm::pdb::HashTable::isPresent ( uint32_t  K) const
inlineprotected

Definition at line 145 of file HashTable.h.

◆ load()

Error HashTable::load ( BinaryStreamReader Stream)

◆ remove()

void HashTable::remove ( uint32_t  K)

Definition at line 138 of file HashTable.cpp.

◆ remove_as()

template<typename Traits , typename Key , typename Context >
void llvm::pdb::HashTable::remove_as ( const Key &  K,
Context Ctx 
)
inline

Definition at line 130 of file HashTable.h.

References assert(), Deleted, and llvm::sys::path::end().

◆ set()

void HashTable::set ( uint32_t  K,
uint32_t  V 
)

Set the entry with the specified key to the specified value.

Definition at line 134 of file HashTable.cpp.

◆ set_as()

template<typename Traits , typename Key , typename Context >
bool llvm::pdb::HashTable::set_as ( const Key &  K,
uint32_t  V,
Context Ctx 
)
inline

Set the entry using a key type that the specified Traits can convert from a real key to an internal key.

Definition at line 123 of file HashTable.h.

References llvm::pdb::None.

◆ size()

uint32_t HashTable::size ( ) const

Definition at line 122 of file HashTable.cpp.

References llvm::SparseBitVector< ElementSize >::count(), and Present.

Referenced by calculateSerializedLength(), and commit().

Friends And Related Function Documentation

◆ HashTableIterator

friend class HashTableIterator
friend

Definition at line 56 of file HashTable.h.

Referenced by begin(), and end().

Member Data Documentation

◆ Buckets

BucketList llvm::pdb::HashTable::Buckets
protected

◆ Deleted

SparseBitVector llvm::pdb::HashTable::Deleted
mutableprotected

Definition at line 150 of file HashTable.h.

Referenced by calculateSerializedLength(), clear(), commit(), and load().

◆ Present

SparseBitVector llvm::pdb::HashTable::Present
mutableprotected

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