LLVM API Documentation
#include <StringMap.h>
Public Member Functions | |
unsigned | getNumBuckets () const |
unsigned | getNumItems () const |
bool | empty () const |
unsigned | size () const |
void | swap (StringMapImpl &Other) |
Static Public Member Functions | |
static StringMapEntryBase * | getTombstoneVal () |
Protected Member Functions | |
StringMapImpl (unsigned itemSize) | |
StringMapImpl (unsigned InitSize, unsigned ItemSize) | |
void | RehashTable () |
unsigned | LookupBucketFor (StringRef Key) |
int | FindKey (StringRef Key) const |
void | RemoveKey (StringMapEntryBase *V) |
StringMapEntryBase * | RemoveKey (StringRef Key) |
Protected Attributes | |
StringMapEntryBase ** | TheTable |
unsigned | NumBuckets |
unsigned | NumItems |
unsigned | NumTombstones |
unsigned | ItemSize |
StringMapImpl - This is the base class of StringMap that is shared among all of its instantiations.
Definition at line 53 of file StringMap.h.
|
inlineexplicitprotected |
Definition at line 64 of file StringMap.h.
References NumBuckets, NumItems, NumTombstones, and TheTable.
Definition at line 20 of file StringMap.cpp.
References llvm::cl::init(), ItemSize, NumBuckets, NumItems, NumTombstones, and TheTable.
|
inline |
Definition at line 103 of file StringMap.h.
References NumItems.
Referenced by llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::clear(), llvm::StringPool::empty(), llvm::ValueSymbolTable::empty(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::operator=(), llvm::cl::ParseCommandLineOptions(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::StringMap(), llvm::StringPool::~StringPool(), and llvm::ValueSymbolTable::~ValueSymbolTable().
|
protected |
FindKey - Look up the bucket that contains the specified key. If it exists in the map, return the bucket number of the key. Otherwise return -1. This does not modify the map.
Definition at line 116 of file StringMap.cpp.
References llvm::StringMapEntryBase::getKeyLength(), getTombstoneVal(), llvm::HashString(), ItemSize, LLVM_LIKELY, NumBuckets, and TheTable.
Referenced by llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::find(), and RemoveKey().
|
inline |
Definition at line 100 of file StringMap.h.
References NumBuckets.
|
inline |
Definition at line 101 of file StringMap.h.
References NumItems.
|
inlinestatic |
Definition at line 96 of file StringMap.h.
Referenced by llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::clear(), FindKey(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::GetOrCreateValue(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::insert(), LookupBucketFor(), RehashTable(), and RemoveKey().
LookupBucketFor - Look up the bucket that the specified string should end up in. If it already exists as a key in the map, the Item pointer for the specified bucket will be non-null. Otherwise, it will be null. In either case, the FullHashValue field of the bucket will be set to the hash value of the string.
Definition at line 58 of file StringMap.cpp.
References llvm::StringMapEntryBase::getKeyLength(), getTombstoneVal(), llvm::HashString(), llvm::cl::init(), ItemSize, LLVM_LIKELY, NumBuckets, and TheTable.
Referenced by llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::GetOrCreateValue(), and llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::insert().
|
protected |
RehashTable - Grow the table, redistributing values into the buckets with the appropriate mod-of-hashtable-size.
Definition at line 184 of file StringMap.cpp.
References llvm::LibFunc::calloc, llvm::LibFunc::free, getTombstoneVal(), I, NumBuckets, NumItems, NumTombstones, and TheTable.
Referenced by llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::GetOrCreateValue(), and llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::insert().
|
protected |
RemoveKey - Remove the specified StringMapEntry from the table, but do not delete it. This aborts if the value isn't in the table.
Definition at line 158 of file StringMap.cpp.
References llvm::StringMapEntryBase::getKeyLength(), ItemSize, and llvm::NVPTX::PTXLdStInstCode::V2.
Referenced by llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::remove().
|
protected |
RemoveKey - Remove the StringMapEntry for the specified key from the table, returning it. If the key is not in the table, this returns null.
Definition at line 167 of file StringMap.cpp.
References FindKey(), getTombstoneVal(), NumBuckets, NumItems, NumTombstones, and TheTable.
|
inline |
Definition at line 104 of file StringMap.h.
References NumItems.
Referenced by llvm::LLVMContext::getMDKindID(), llvm::LLVMContext::getMDKindNames(), llvm::cl::getRegisteredOptions(), and llvm::ValueSymbolTable::size().
|
inline |
Definition at line 106 of file StringMap.h.
References NumBuckets, NumItems, NumTombstones, std::swap(), and TheTable.
|
protected |
Definition at line 62 of file StringMap.h.
Referenced by FindKey(), LookupBucketFor(), RemoveKey(), and StringMapImpl().
|
protected |
Definition at line 59 of file StringMap.h.
Referenced by llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::begin(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::clear(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::end(), FindKey(), getNumBuckets(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::GetOrCreateValue(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::insert(), LookupBucketFor(), RehashTable(), RemoveKey(), StringMapImpl(), and swap().
|
protected |
Definition at line 60 of file StringMap.h.
Referenced by llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::clear(), empty(), getNumItems(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::GetOrCreateValue(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::insert(), RehashTable(), RemoveKey(), size(), StringMapImpl(), and swap().
|
protected |
Definition at line 61 of file StringMap.h.
Referenced by llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::clear(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::GetOrCreateValue(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::insert(), RehashTable(), RemoveKey(), StringMapImpl(), and swap().
|
protected |
Definition at line 58 of file StringMap.h.
Referenced by llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::begin(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::clear(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::end(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::find(), FindKey(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::GetOrCreateValue(), llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::insert(), LookupBucketFor(), RehashTable(), RemoveKey(), StringMapImpl(), swap(), and llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::~StringMap().