LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
llvm::StringMap< ValueTy, AllocatorTy > Class Template Reference

#include <StringMap.h>

Inheritance diagram for llvm::StringMap< ValueTy, AllocatorTy >:
Inheritance graph
[legend]
Collaboration diagram for llvm::StringMap< ValueTy, AllocatorTy >:
Collaboration graph
[legend]

Public Types

typedef StringMapEntry< ValueTy > MapEntryTy
 
typedef ReferenceAdder
< AllocatorTy >::result 
AllocatorRefTy
 
typedef ReferenceAdder< const
AllocatorTy >::result 
AllocatorCRefTy
 
typedef const char * key_type
 
typedef ValueTy mapped_type
 
typedef StringMapEntry< ValueTy > value_type
 
typedef size_t size_type
 
typedef StringMapConstIterator
< ValueTy > 
const_iterator
 
typedef StringMapIterator
< ValueTy > 
iterator
 

Public Member Functions

 StringMap ()
 
 StringMap (unsigned InitialSize)
 
 StringMap (AllocatorTy A)
 
 StringMap (unsigned InitialSize, AllocatorTy A)
 
 StringMap (const StringMap &RHS)
 
void operator= (const StringMap &RHS)
 
AllocatorRefTy getAllocator ()
 
AllocatorCRefTy getAllocator () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
iterator find (StringRef Key)
 
const_iterator find (StringRef Key) const
 
ValueTy lookup (StringRef Key) const
 
ValueTy & operator[] (StringRef Key)
 
size_type count (StringRef Key) const
 
bool insert (MapEntryTy *KeyValue)
 
void clear ()
 
template<typename InitTy >
MapEntryTyGetOrCreateValue (StringRef Key, InitTy Val)
 
MapEntryTyGetOrCreateValue (StringRef Key)
 
void remove (MapEntryTy *KeyValue)
 
void erase (iterator I)
 
bool erase (StringRef Key)
 
 ~StringMap ()
 
- Public Member Functions inherited from llvm::StringMapImpl
unsigned getNumBuckets () const
 
unsigned getNumItems () const
 
bool empty () const
 
unsigned size () const
 
void swap (StringMapImpl &Other)
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::StringMapImpl
static StringMapEntryBasegetTombstoneVal ()
 
- Protected Member Functions inherited from llvm::StringMapImpl
 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 inherited from llvm::StringMapImpl
StringMapEntryBase ** TheTable
 
unsigned NumBuckets
 
unsigned NumItems
 
unsigned NumTombstones
 
unsigned ItemSize
 

Detailed Description

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
class llvm::StringMap< ValueTy, AllocatorTy >

StringMap - This is an unconventional map that is specialized for handling keys that are "strings", which are basically ranges of bytes. This does some funky memory allocation and hashing things to make it extremely efficient, storing the string data after the value in the map.

Definition at line 236 of file StringMap.h.

Member Typedef Documentation

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef ReferenceAdder<const AllocatorTy>::result llvm::StringMap< ValueTy, AllocatorTy >::AllocatorCRefTy

Definition at line 266 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef ReferenceAdder<AllocatorTy>::result llvm::StringMap< ValueTy, AllocatorTy >::AllocatorRefTy

Definition at line 265 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef StringMapConstIterator<ValueTy> llvm::StringMap< ValueTy, AllocatorTy >::const_iterator

Definition at line 275 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef StringMapIterator<ValueTy> llvm::StringMap< ValueTy, AllocatorTy >::iterator

Definition at line 276 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef const char* llvm::StringMap< ValueTy, AllocatorTy >::key_type

Definition at line 270 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef StringMapEntry<ValueTy> llvm::StringMap< ValueTy, AllocatorTy >::MapEntryTy

Definition at line 239 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef ValueTy llvm::StringMap< ValueTy, AllocatorTy >::mapped_type

Definition at line 271 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef size_t llvm::StringMap< ValueTy, AllocatorTy >::size_type

Definition at line 273 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef StringMapEntry<ValueTy> llvm::StringMap< ValueTy, AllocatorTy >::value_type

Definition at line 272 of file StringMap.h.

Constructor & Destructor Documentation

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
llvm::StringMap< ValueTy, AllocatorTy >::StringMap ( )
inline

Definition at line 241 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
llvm::StringMap< ValueTy, AllocatorTy >::StringMap ( unsigned  InitialSize)
inlineexplicit

Definition at line 242 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
llvm::StringMap< ValueTy, AllocatorTy >::StringMap ( AllocatorTy  A)
inlineexplicit

Definition at line 245 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
llvm::StringMap< ValueTy, AllocatorTy >::StringMap ( unsigned  InitialSize,
AllocatorTy  A 
)
inline

Definition at line 248 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
llvm::StringMap< ValueTy, AllocatorTy >::StringMap ( const StringMap< ValueTy, AllocatorTy > &  RHS)
inline

Definition at line 252 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
llvm::StringMap< ValueTy, AllocatorTy >::~StringMap ( )
inline

Definition at line 406 of file StringMap.h.

Member Function Documentation

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
iterator llvm::StringMap< ValueTy, AllocatorTy >::begin ( )
inline
template<typename ValueTy, typename AllocatorTy = MallocAllocator>
const_iterator llvm::StringMap< ValueTy, AllocatorTy >::begin ( ) const
inline

Definition at line 284 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
void llvm::StringMap< ValueTy, AllocatorTy >::clear ( )
inline
template<typename ValueTy, typename AllocatorTy = MallocAllocator>
size_type llvm::StringMap< ValueTy, AllocatorTy >::count ( StringRef  Key) const
inline
template<typename ValueTy, typename AllocatorTy = MallocAllocator>
iterator llvm::StringMap< ValueTy, AllocatorTy >::end ( )
inline
template<typename ValueTy, typename AllocatorTy = MallocAllocator>
const_iterator llvm::StringMap< ValueTy, AllocatorTy >::end ( ) const
inline

Definition at line 287 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
void llvm::StringMap< ValueTy, AllocatorTy >::erase ( iterator  I)
inline
template<typename ValueTy, typename AllocatorTy = MallocAllocator>
bool llvm::StringMap< ValueTy, AllocatorTy >::erase ( StringRef  Key)
inline

Definition at line 399 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
iterator llvm::StringMap< ValueTy, AllocatorTy >::find ( StringRef  Key)
inline
template<typename ValueTy, typename AllocatorTy = MallocAllocator>
const_iterator llvm::StringMap< ValueTy, AllocatorTy >::find ( StringRef  Key) const
inline

Definition at line 297 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
AllocatorRefTy llvm::StringMap< ValueTy, AllocatorTy >::getAllocator ( )
inline

Definition at line 267 of file StringMap.h.

Referenced by llvm::StructType::setName().

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
AllocatorCRefTy llvm::StringMap< ValueTy, AllocatorTy >::getAllocator ( ) const
inline

Definition at line 268 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
template<typename InitTy >
MapEntryTy& llvm::StringMap< ValueTy, AllocatorTy >::GetOrCreateValue ( StringRef  Key,
InitTy  Val 
)
inline
template<typename ValueTy, typename AllocatorTy = MallocAllocator>
MapEntryTy& llvm::StringMap< ValueTy, AllocatorTy >::GetOrCreateValue ( StringRef  Key)
inline

Definition at line 383 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
bool llvm::StringMap< ValueTy, AllocatorTy >::insert ( MapEntryTy KeyValue)
inline

insert - Insert the specified key/value pair into the map. If the key already exists in the map, return false and ignore the request, otherwise insert it and return true.

Definition at line 323 of file StringMap.h.

Referenced by llvm::StringPool::intern().

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
ValueTy llvm::StringMap< ValueTy, AllocatorTy >::lookup ( StringRef  Key) const
inline

lookup - Return the entry for the specified key, or a default constructed value if no such entry exists.

Definition at line 305 of file StringMap.h.

Referenced by llvm::MCContext::getCOFFSection(), llvm::LibCallInfo::getFunctionInfo(), llvm::ValueSymbolTable::lookup(), and llvm::MCContext::LookupSymbol().

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
void llvm::StringMap< ValueTy, AllocatorTy >::operator= ( const StringMap< ValueTy, AllocatorTy > &  RHS)
inline

Definition at line 258 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
ValueTy& llvm::StringMap< ValueTy, AllocatorTy >::operator[] ( StringRef  Key)
inline

Definition at line 312 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
void llvm::StringMap< ValueTy, AllocatorTy >::remove ( MapEntryTy KeyValue)
inline

remove - Remove the specified key/value pair from the map, but do not erase it. This aborts if the key is not in the map.

Definition at line 389 of file StringMap.h.

Referenced by llvm::StructType::setName().


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