LLVM API Documentation

llvm::StringMapImpl Class Reference

#include <StringMap.h>

Inheritance diagram for llvm::StringMapImpl:

Inheritance graph
[legend]
Collaboration diagram for llvm::StringMapImpl:

Collaboration graph
[legend]

List of all members.

Public Member Functions

unsigned getNumBuckets () const
unsigned getNumItems () const
bool empty () const
unsigned size () const

Static Public Member Functions

static StringMapEntryBasegetTombstoneVal ()

Protected Member Functions

 StringMapImpl (unsigned itemSize)
 StringMapImpl (unsigned InitSize, unsigned ItemSize)
void RehashTable ()
bool ShouldRehash () const
unsigned LookupBucketFor (const char *KeyStart, const char *KeyEnd)
int FindKey (const char *KeyStart, const char *KeyEnd) const
void RemoveKey (StringMapEntryBase *V)
StringMapEntryBaseRemoveKey (const char *KeyStart, const char *KeyEnd)

Protected Attributes

ItemBucketTheTable
unsigned NumBuckets
unsigned NumItems
unsigned NumTombstones
unsigned ItemSize

Classes

struct  ItemBucket


Detailed Description

StringMapImpl - This is the base class of StringMap that is shared among all of its instantiations.

Definition at line 52 of file StringMap.h.


Constructor & Destructor Documentation

llvm::StringMapImpl::StringMapImpl ( unsigned  itemSize  )  [inline, explicit, protected]

Definition at line 72 of file StringMap.h.

References NumBuckets, NumItems, NumTombstones, and TheTable.

StringMapImpl::StringMapImpl ( unsigned  InitSize,
unsigned  ItemSize 
) [protected]

Definition at line 18 of file StringMap.cpp.

References ItemSize, NumBuckets, NumItems, NumTombstones, and TheTable.


Member Function Documentation

void StringMapImpl::RehashTable (  )  [protected]

RehashTable - Grow the table, redistributing values into the buckets with the appropriate mod-of-hashtable-size.

Definition at line 198 of file StringMap.cpp.

References E, llvm::StringMapImpl::ItemBucket::FullHashValue, getTombstoneVal(), llvm::StringMapImpl::ItemBucket::Item, NumBuckets, and TheTable.

Referenced by llvm::StringMap< llvm::StringPool::PooledString >::GetOrCreateValue(), and llvm::StringMap< llvm::StringPool::PooledString >::insert().

bool llvm::StringMapImpl::ShouldRehash (  )  const [inline, protected]

ShouldRehash - Return true if the table should be rehashed after a new element was recently inserted.

Definition at line 84 of file StringMap.h.

References NumBuckets, NumItems, and NumTombstones.

Referenced by llvm::StringMap< llvm::StringPool::PooledString >::GetOrCreateValue(), and llvm::StringMap< llvm::StringPool::PooledString >::insert().

unsigned StringMapImpl::LookupBucketFor ( const char *  NameStart,
const char *  NameEnd 
) [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.

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 68 of file StringMap.cpp.

References llvm::StringMapImpl::ItemBucket::FullHashValue, llvm::StringMapEntryBase::getKeyLength(), getTombstoneVal(), HashString(), llvm::StringMapImpl::ItemBucket::Item, ItemSize, NumBuckets, and TheTable.

Referenced by llvm::StringMap< llvm::StringPool::PooledString >::GetOrCreateValue(), and llvm::StringMap< llvm::StringPool::PooledString >::insert().

int StringMapImpl::FindKey ( const char *  KeyStart,
const char *  KeyEnd 
) 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.

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 129 of file StringMap.cpp.

References llvm::StringMapImpl::ItemBucket::FullHashValue, llvm::StringMapEntryBase::getKeyLength(), getTombstoneVal(), HashString(), llvm::StringMapImpl::ItemBucket::Item, ItemSize, NumBuckets, and TheTable.

Referenced by llvm::StringMap< llvm::StringPool::PooledString >::find(), and RemoveKey().

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.

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 173 of file StringMap.cpp.

References llvm::StringMapEntryBase::getKeyLength(), and ItemSize.

Referenced by llvm::StringMap< llvm::StringPool::PooledString >::remove().

StringMapEntryBase * StringMapImpl::RemoveKey ( const char *  KeyStart,
const char *  KeyEnd 
) [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.

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 182 of file StringMap.cpp.

References FindKey(), getTombstoneVal(), llvm::StringMapImpl::ItemBucket::Item, NumItems, NumTombstones, and TheTable.

static StringMapEntryBase* llvm::StringMapImpl::getTombstoneVal (  )  [inline, static]

unsigned llvm::StringMapImpl::getNumBuckets (  )  const [inline]

Definition at line 118 of file StringMap.h.

References NumBuckets.

unsigned llvm::StringMapImpl::getNumItems (  )  const [inline]

Definition at line 119 of file StringMap.h.

References NumItems.

bool llvm::StringMapImpl::empty (  )  const [inline]

unsigned llvm::StringMapImpl::size (  )  const [inline]

Definition at line 122 of file StringMap.h.

References NumItems.


Member Data Documentation

Definition at line 70 of file StringMap.h.

Referenced by FindKey(), LookupBucketFor(), RemoveKey(), and StringMapImpl().


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



This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.