LLVM: llvm::StringMap< ValueTy, AllocatorTy > Class Template Reference (original) (raw)

[StringMap](classllvm%5F1%5F1StringMap.html "StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...") - This is an unconventional map that is specialized for handling keys that are "strings", which are basically ranges of bytes. More...

#include "[llvm/ADT/StringMap.h](ADT%5F2StringMap%5F8h%5Fsource.html)"

Inherits llvm::StringMapImpl, and llvm::detail::AllocatorHolder< MallocAllocator >.

Public Types
using MapEntryTy = StringMapEntry
using key_type = const char *
using mapped_type = ValueTy
using value_type = StringMapEntry
using size_type = size_t
using const_iterator = StringMapIterBase<ValueTy, true>
using iterator = StringMapIterBase<ValueTy, false>
Public Member Functions
StringMap ()
StringMap (unsigned InitialSize)
StringMap (AllocatorTy A)
StringMap (unsigned InitialSize, AllocatorTy A)
StringMap (std::initializer_list< std::pair< StringRef, ValueTy > > List)
StringMap (StringMap &&RHS)
StringMap (const StringMap &RHS)
StringMap & operator= (StringMap RHS)
~StringMap ()
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
iterator_range< StringMapKeyIterator< ValueTy > > keys () const
iterator find (StringRef Key)
iterator find (StringRef Key, uint32_t FullHashValue)
const_iterator find (StringRef Key) const
const_iterator find (StringRef Key, uint32_t FullHashValue) const
ValueTy lookup (StringRef Key) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exists.
const ValueTy & at (StringRef Val) const
at - Return the entry for the specified key, or abort if no such entry exists.
ValueTy & operator[] (StringRef Key)
Lookup the ValueTy for the Key, or create a default constructed value if the key is not in the map.
bool contains (StringRef Key) const
contains - Return true if the element is in the map, false otherwise.
size_type count (StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
template
size_type count (const StringMapEntry< InputTy > &MapEntry) const
bool operator== (const StringMap &RHS) const
equal - check whether both of the containers are equal.
bool operator!= (const StringMap &RHS) const
bool insert (MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
std::pair< iterator, bool > insert (std::pair< StringRef, ValueTy > KV)
insert - Inserts the specified key/value pair into the map if the key isn't already in the map.
std::pair< iterator, bool > insert (std::pair< StringRef, ValueTy > KV, uint32_t FullHashValue)
template
void insert (InputIt First, InputIt Last)
Inserts elements from range [first, last).
void insert (std::initializer_list< std::pair< StringRef, ValueTy > > List)
Inserts elements from initializer list ilist.
template
std::pair< iterator, bool > insert_or_assign (StringRef Key, V &&Val)
Inserts an element or assigns to the current element if the key already exists.
template<typename... ArgsTy>
std::pair< iterator, bool > try_emplace (StringRef Key, ArgsTy &&...Args)
Emplace a new element for the specified key into the map if the key isn't already in the map.
template<typename... ArgsTy>
std::pair< iterator, bool > try_emplace_with_hash (StringRef Key, uint32_t FullHashValue, ArgsTy &&...Args)
void clear ()
void remove (MapEntryTy *KeyValue)
remove - Remove the specified key/value pair from the map, but do not erase it.
void erase (iterator I)
bool erase (StringRef Key)
AllocatorTy & getAllocator ()
const AllocatorTy & getAllocator () const
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 StringMapEntryBase * getTombstoneVal ()
static LLVM_ABI uint32_t hash (StringRef Key)
Returns the hash value that will be used for the given string.
Static Public Attributes inherited from llvm::StringMapImpl
static constexpr uintptr_t TombstoneIntVal
Protected Member Functions inherited from llvm::StringMapImpl
StringMapImpl (unsigned itemSize)
StringMapImpl (StringMapImpl &&RHS)
LLVM_ABI StringMapImpl (unsigned InitSize, unsigned ItemSize)
~StringMapImpl ()
LLVM_ABI unsigned RehashTable (unsigned BucketNo=0)
RehashTable - Grow the table, redistributing values into the buckets with the appropriate mod-of-hashtable-size.
unsigned LookupBucketFor (StringRef Key)
LookupBucketFor - Look up the bucket that the specified string should end up in.
LLVM_ABI unsigned LookupBucketFor (StringRef Key, uint32_t FullHashValue)
Overload that explicitly takes precomputed hash(Key).
int FindKey (StringRef Key) const
FindKey - Look up the bucket that contains the specified key.
LLVM_ABI int FindKey (StringRef Key, uint32_t FullHashValue) const
Overload that explicitly takes precomputed hash(Key).
LLVM_ABI void RemoveKey (StringMapEntryBase *V)
RemoveKey - Remove the specified StringMapEntry from the table, but do not delete it.
LLVM_ABI StringMapEntryBase * RemoveKey (StringRef Key)
RemoveKey - Remove the StringMapEntry for the specified key from the table, returning it.
LLVM_ABI void init (unsigned Size)
Allocate the table with the specified number of buckets and otherwise setup the map as empty.
iterator_range< StringMapEntryBase ** > buckets ()
Protected Attributes inherited from llvm::StringMapImpl
StringMapEntryBase ** TheTable = nullptr
unsigned NumBuckets = 0
unsigned NumItems = 0
unsigned NumTombstones = 0
unsigned ItemSize

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

[StringMap](classllvm%5F1%5F1StringMap.html "StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...") - 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 131 of file StringMap.h.

const_iterator

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

iterator

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

key_type

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

MapEntryTy

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

mapped_type

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

size_type

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

value_type

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

StringMap() [2/7]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

StringMap() [3/7]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

llvm::StringMap< ValueTy, AllocatorTy >::StringMap ( AllocatorTy A) inlineexplicit

StringMap() [4/7]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

StringMap() [5/7]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

llvm::StringMap< ValueTy, AllocatorTy >::StringMap ( std::initializer_list< std::pair< StringRef, ValueTy > > List) inline

StringMap() [6/7]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

StringMap() [7/7]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

~StringMap()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

at()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

at - Return the entry for the specified key, or abort if no such entry exists.

Definition at line 269 of file StringMap.h.

begin() [1/2]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

begin() [2/2]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

clear()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

contains()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

count() [1/2]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

template

count() [2/2]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

end() [1/2]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

end() [2/2]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

erase() [1/2]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

erase() [2/2]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

find() [1/4]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

find() [2/4]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

find() [3/4]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

find() [4/4]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

getAllocator() [1/2]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

getAllocator() [2/2]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

insert() [1/5]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

template

void llvm::StringMap< ValueTy, AllocatorTy >::insert ( InputIt First, InputIt Last ) inline

Inserts elements from range [first, last).

If multiple elements in the range have keys that compare equivalent, it is unspecified which element is inserted .

Definition at line 354 of file StringMap.h.

insert() [2/5]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

insert() [3/5]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

void llvm::StringMap< ValueTy, AllocatorTy >::insert ( std::initializer_list< std::pair< StringRef, ValueTy > > List) inline

Inserts elements from initializer list ilist.

If multiple elements in the range have keys that compare equivalent, it is unspecified which element is inserted

Definition at line 362 of file StringMap.h.

insert() [4/5]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

insert - Inserts the specified key/value pair into the map if the key isn't already in the map.

The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of the pair.

Definition at line 341 of file StringMap.h.

insert() [5/5]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

insert_or_assign()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

template

Inserts an element or assigns to the current element if the key already exists.

The return type is the same as try_emplace.

Definition at line 369 of file StringMap.h.

keys()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

lookup()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

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

Definition at line 260 of file StringMap.h.

operator!=()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

operator=()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

operator==()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

equal - check whether both of the containers are equal.

Definition at line 295 of file StringMap.h.

operator[]()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

Lookup the ValueTy for the Key, or create a default constructed value if the key is not in the map.

Definition at line 277 of file StringMap.h.

remove()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

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 425 of file StringMap.h.

try_emplace()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

template<typename... ArgsTy>

Emplace a new element for the specified key into the map if the key isn't already in the map.

The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of the pair.

Definition at line 381 of file StringMap.h.

Referenced by llvm::StringInit::get(), handleArgs(), and populateDependencyMatrix().

try_emplace_with_hash()

template<typename ValueTy, typename AllocatorTy = MallocAllocator>

template<typename... ArgsTy>


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