LLVM API Documentation

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
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
void swap (StringMapImpl &Other)

Static Public Member Functions

static StringMapEntryBasegetTombstoneVal ()

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)
StringMapEntryBaseRemoveKey (StringRef Key)

Protected Attributes

StringMapEntryBase ** TheTable
unsigned NumBuckets
unsigned NumItems
unsigned NumTombstones
unsigned ItemSize

Detailed Description

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

Definition at line 41 of file StringMap.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

bool llvm::StringMapImpl::empty ( ) const [inline]
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().

Definition at line 95 of file StringMap.h.

References NumBuckets.

Definition at line 96 of file StringMap.h.

References NumItems.

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().

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]
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=().


Member Data Documentation

Definition at line 50 of file StringMap.h.

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


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