LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::StringMapImpl Class Reference

#include <StringMap.h>

Inheritance diagram for llvm::StringMapImpl:
Inheritance graph
[legend]
Collaboration diagram for llvm::StringMapImpl:
Collaboration graph
[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 (unsigned InitSize, unsigned ItemSize)
 
void RehashTable ()
 
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 53 of file StringMap.h.

Constructor & Destructor Documentation

llvm::StringMapImpl::StringMapImpl ( unsigned  itemSize)
inlineexplicitprotected

Definition at line 64 of file StringMap.h.

References NumBuckets, NumItems, NumTombstones, and TheTable.

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< std::pair< llvm::Type *, llvm::SMLoc > >::find(), and RemoveKey().

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

Definition at line 100 of file StringMap.h.

References NumBuckets.

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

Definition at line 101 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< std::pair< llvm::Type *, llvm::SMLoc > >::GetOrCreateValue(), and llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >::insert().

void StringMapImpl::RehashTable ( )
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().

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< std::pair< llvm::Type *, llvm::SMLoc > >::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 106 of file StringMap.h.

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

Member Data Documentation

unsigned llvm::StringMapImpl::ItemSize
protected

Definition at line 62 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: