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 (StringMapImpl &&RHS) | |
StringMapImpl (unsigned InitSize, unsigned ItemSize) | |
unsigned | RehashTable (unsigned BucketNo=0) |
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 41 of file StringMap.h.
llvm::StringMapImpl::StringMapImpl | ( | unsigned | itemSize | ) | [inline, explicit, protected] |
Definition at line 52 of file StringMap.h.
llvm::StringMapImpl::StringMapImpl | ( | StringMapImpl && | RHS | ) | [inline, protected] |
Definition at line 56 of file StringMap.h.
StringMapImpl::StringMapImpl | ( | unsigned | InitSize, |
unsigned | ItemSize | ||
) | [protected] |
Definition at line 20 of file StringMap.cpp.
References llvm::cl::init(), ItemSize, NumBuckets, NumItems, NumTombstones, and TheTable.
bool llvm::StringMapImpl::empty | ( | ) | const [inline] |
Definition at line 98 of file StringMap.h.
References NumItems.
Referenced by llvm::StringMap< const DIE * >::clear(), llvm::DwarfStringPool::emit(), llvm::DwarfStringPool::empty(), llvm::StringPool::empty(), llvm::cl::ParseCommandLineOptions(), llvm::ValueSymbolTable::size(), llvm::StringMap< const DIE * >::~StringMap(), llvm::StringPool::~StringPool(), and llvm::ValueSymbolTable::~ValueSymbolTable().
int StringMapImpl::FindKey | ( | StringRef | Key | ) | const [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< const DIE * >::find(), and RemoveKey().
unsigned llvm::StringMapImpl::getNumBuckets | ( | ) | const [inline] |
Definition at line 95 of file StringMap.h.
References NumBuckets.
unsigned llvm::StringMapImpl::getNumItems | ( | ) | const [inline] |
Definition at line 96 of file StringMap.h.
References NumItems.
static StringMapEntryBase* llvm::StringMapImpl::getTombstoneVal | ( | ) | [inline, static] |
Definition at line 91 of file StringMap.h.
Referenced by llvm::StringMap< const DIE * >::clear(), FindKey(), llvm::StringMap< const DIE * >::insert(), LookupBucketFor(), RehashTable(), RemoveKey(), and llvm::StringMap< const DIE * >::~StringMap().
unsigned StringMapImpl::LookupBucketFor | ( | StringRef | Name | ) | [protected] |
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< const DIE * >::insert().
unsigned StringMapImpl::RehashTable | ( | unsigned | BucketNo = 0 | ) | [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< const DIE * >::insert().
void StringMapImpl::RemoveKey | ( | StringMapEntryBase * | V | ) | [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< const DIE * >::remove().
StringMapEntryBase * StringMapImpl::RemoveKey | ( | StringRef | Key | ) | [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.
unsigned llvm::StringMapImpl::size | ( | ) | const [inline] |
Definition at line 99 of file StringMap.h.
References NumItems.
Referenced by llvm::DwarfStringPool::emit(), llvm::StringTableBuilder::finalize(), llvm::MCDwarfLineTableHeader::getFile(), llvm::LLVMContext::getMDKindID(), llvm::LLVMContext::getMDKindNames(), and llvm::cl::getRegisteredOptions().
void llvm::StringMapImpl::swap | ( | StringMapImpl & | Other | ) | [inline] |
Definition at line 101 of file StringMap.h.
References NumBuckets, NumItems, NumTombstones, and TheTable.
Referenced by llvm::StringMap< const DIE * >::operator=().
unsigned llvm::StringMapImpl::ItemSize [protected] |
Definition at line 50 of file StringMap.h.
Referenced by FindKey(), LookupBucketFor(), RemoveKey(), and StringMapImpl().
unsigned llvm::StringMapImpl::NumBuckets [protected] |
Definition at line 47 of file StringMap.h.
Referenced by llvm::StringMap< const DIE * >::begin(), llvm::StringMap< const DIE * >::clear(), llvm::StringMap< const DIE * >::end(), FindKey(), getNumBuckets(), llvm::StringMap< const DIE * >::insert(), LookupBucketFor(), RehashTable(), RemoveKey(), StringMapImpl(), swap(), and llvm::StringMap< const DIE * >::~StringMap().
unsigned llvm::StringMapImpl::NumItems [protected] |
Definition at line 48 of file StringMap.h.
Referenced by llvm::StringMap< const DIE * >::clear(), empty(), getNumItems(), llvm::StringMap< const DIE * >::insert(), RehashTable(), RemoveKey(), size(), StringMapImpl(), and swap().
unsigned llvm::StringMapImpl::NumTombstones [protected] |
Definition at line 49 of file StringMap.h.
Referenced by llvm::StringMap< const DIE * >::clear(), llvm::StringMap< const DIE * >::insert(), RehashTable(), RemoveKey(), StringMapImpl(), and swap().
StringMapEntryBase** llvm::StringMapImpl::TheTable [protected] |
Definition at line 46 of file StringMap.h.
Referenced by llvm::StringMap< const DIE * >::begin(), llvm::StringMap< const DIE * >::clear(), llvm::StringMap< const DIE * >::end(), llvm::StringMap< const DIE * >::find(), FindKey(), llvm::StringMap< const DIE * >::insert(), LookupBucketFor(), RehashTable(), RemoveKey(), StringMapImpl(), swap(), and llvm::StringMap< const DIE * >::~StringMap().