LLVM  3.7.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::StringMapImpl Class Reference

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

#include <StringMap.h>

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

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)
 RehashTable - Grow the table, redistributing values into the buckets with the appropriate mod-of-hashtable-size. More...
 
unsigned LookupBucketFor (StringRef Key)
 LookupBucketFor - Look up the bucket that the specified string should end up in. More...
 
int FindKey (StringRef Key) const
 FindKey - Look up the bucket that contains the specified key. More...
 
void RemoveKey (StringMapEntryBase *V)
 RemoveKey - Remove the specified StringMapEntry from the table, but do not delete it. More...
 
StringMapEntryBaseRemoveKey (StringRef Key)
 RemoveKey - Remove the StringMapEntry for the specified key from the table, returning it. More...
 

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)
inlineexplicitprotected

Definition at line 52 of file StringMap.h.

llvm::StringMapImpl::StringMapImpl ( StringMapImpl &&  RHS)
inlineprotected

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< uint64_t >::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 ( )
inlinestatic
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< uint64_t >::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 getTombstoneVal(), I, LLVM_UNLIKELY, NumBuckets, NumItems, NumTombstones, and TheTable.

Referenced by llvm::StringMap< uint64_t >::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< uint64_t >::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
void llvm::StringMapImpl::swap ( StringMapImpl Other)
inline

Definition at line 101 of file StringMap.h.

References NumBuckets, NumItems, NumTombstones, std::swap(), and TheTable.

Referenced by llvm::StringMap< uint64_t >::operator=().

Member Data Documentation

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
unsigned llvm::StringMapImpl::NumItems
protected
unsigned llvm::StringMapImpl::NumTombstones
protected
StringMapEntryBase** llvm::StringMapImpl::TheTable
protected

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