class StringMap
Declaration
template <typename ValueTy,
typename AllocatorTy = llvm::MallocAllocator>
class StringMap : public StringMapImpl { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/ADT/StringMap.h:242
Inherits from: StringMapImpl
Templates
- ValueTy
- AllocatorTy = llvm::MallocAllocator
Member Variables
Inherited from StringMapImpl:
- protected TheTable = nullptr
- protected NumBuckets = 0
- protected NumItems = 0
- protected NumTombstones = 0
- protected ItemSize
Method Overview
- public StringMap<ValueTy, AllocatorTy>(unsigned int InitialSize)
- public StringMap<ValueTy, AllocatorTy>(AllocatorTy A)
- public StringMap<ValueTy, AllocatorTy>(unsigned int InitialSize, AllocatorTy A)
- public StringMap<ValueTy, AllocatorTy>(std::initializer_list<std::pair<StringRef, ValueTy>> List)
- public StringMap<ValueTy, AllocatorTy>(StringMap<ValueTy, AllocatorTy> && RHS)
- public StringMap<ValueTy, AllocatorTy>(const StringMap<ValueTy, AllocatorTy> & RHS)
- public StringMap<ValueTy, AllocatorTy>()
- public llvm::StringMap::const_iterator begin() const
- public llvm::StringMap::iterator begin()
- public void clear()
- public template <typename InputTy>llvm::StringMap::size_type count(const StringMapEntry<InputTy> & MapEntry) const
- public llvm::StringMap::size_type count(llvm::StringRef Key) const
- public llvm::StringMap::iterator end()
- public llvm::StringMap::const_iterator end() const
- public bool erase(llvm::StringRef Key)
- public void erase(llvm::StringMap::iterator I)
- public llvm::StringMap::iterator find(llvm::StringRef Key)
- public llvm::StringMap::const_iterator find(llvm::StringRef Key) const
- public const AllocatorTy & getAllocator() const
- public AllocatorTy & getAllocator()
- public bool insert(llvm::StringMap::MapEntryTy * KeyValue)
- public std::pair<iterator, bool> insert(std::pair<StringRef, ValueTy> KV)
- public template <typename V>std::pair<iterator, bool> insert_or_assign(llvm::StringRef Key, V && Val)
- public iterator_range<StringMapKeyIterator<ValueTy>> keys() const
- public ValueTy lookup(llvm::StringRef Key) const
- public void remove(llvm::StringMap::MapEntryTy * KeyValue)
- public template <typename... ArgsTy>std::pair<iterator, bool> try_emplace(llvm::StringRef Key, ArgsTy &&... Args)
- public ~StringMap<ValueTy, AllocatorTy>()
Inherited from StringMapImpl:
- protected FindKey
- protected LookupBucketFor
- protected RehashTable
- protected RemoveKey
- protected RemoveKey
- public empty
- public getNumBuckets
- public getNumItems
- public getTombstoneVal
- protected init
- public size
- public swap
Methods
¶StringMap<ValueTy, AllocatorTy>(
unsigned int InitialSize)
StringMap<ValueTy, AllocatorTy>(
unsigned int InitialSize)
Declared at: llvm/include/llvm/ADT/StringMap.h:250
Parameters
- unsigned int InitialSize
¶StringMap<ValueTy, AllocatorTy>(AllocatorTy A)
StringMap<ValueTy, AllocatorTy>(AllocatorTy A)
Declared at: llvm/include/llvm/ADT/StringMap.h:253
Parameters
- AllocatorTy A
¶StringMap<ValueTy, AllocatorTy>(
unsigned int InitialSize,
AllocatorTy A)
StringMap<ValueTy, AllocatorTy>(
unsigned int InitialSize,
AllocatorTy A)
Declared at: llvm/include/llvm/ADT/StringMap.h:256
Parameters
- unsigned int InitialSize
- AllocatorTy A
¶StringMap<ValueTy, AllocatorTy>(
std::initializer_list<
std::pair<StringRef, ValueTy>> List)
StringMap<ValueTy, AllocatorTy>(
std::initializer_list<
std::pair<StringRef, ValueTy>> List)
Declared at: llvm/include/llvm/ADT/StringMap.h:260
Parameters
- std::initializer_list< std::pair<StringRef, ValueTy>> List
¶StringMap<ValueTy, AllocatorTy>(
StringMap<ValueTy, AllocatorTy>&& RHS)
StringMap<ValueTy, AllocatorTy>(
StringMap<ValueTy, AllocatorTy>&& RHS)
Declared at: llvm/include/llvm/ADT/StringMap.h:267
Parameters
- StringMap<ValueTy, AllocatorTy>&& RHS
¶StringMap<ValueTy, AllocatorTy>(
const StringMap<ValueTy, AllocatorTy>& RHS)
StringMap<ValueTy, AllocatorTy>(
const StringMap<ValueTy, AllocatorTy>& RHS)
Declared at: llvm/include/llvm/ADT/StringMap.h:270
Parameters
- const StringMap<ValueTy, AllocatorTy>& RHS
¶StringMap<ValueTy, AllocatorTy>()
StringMap<ValueTy, AllocatorTy>()
Declared at: llvm/include/llvm/ADT/StringMap.h:248
¶llvm::StringMap::const_iterator begin() const
llvm::StringMap::const_iterator begin() const
Declared at: llvm/include/llvm/ADT/StringMap.h:343
¶llvm::StringMap::iterator begin()
llvm::StringMap::iterator begin()
Declared at: llvm/include/llvm/ADT/StringMap.h:337
¶void clear()
void clear()
Declared at: llvm/include/llvm/ADT/StringMap.h:450
¶template <typename InputTy>
llvm::StringMap::size_type count(
const StringMapEntry<InputTy>& MapEntry) const
template <typename InputTy>
llvm::StringMap::size_type count(
const StringMapEntry<InputTy>& MapEntry) const
Declared at: llvm/include/llvm/ADT/StringMap.h:386
Templates
- InputTy
Parameters
- const StringMapEntry<InputTy>& MapEntry
¶llvm::StringMap::size_type count(
llvm::StringRef Key) const
llvm::StringMap::size_type count(
llvm::StringRef Key) const
Description
count - Return 1 if the element is in the map, 0 otherwise.
Declared at: llvm/include/llvm/ADT/StringMap.h:381
Parameters
- llvm::StringRef Key
¶llvm::StringMap::iterator end()
llvm::StringMap::iterator end()
Declared at: llvm/include/llvm/ADT/StringMap.h:340
¶llvm::StringMap::const_iterator end() const
llvm::StringMap::const_iterator end() const
Declared at: llvm/include/llvm/ADT/StringMap.h:346
¶bool erase(llvm::StringRef Key)
bool erase(llvm::StringRef Key)
Declared at: llvm/include/llvm/ADT/StringMap.h:479
Parameters
- llvm::StringRef Key
¶void erase(llvm::StringMap::iterator I)
void erase(llvm::StringMap::iterator I)
Declared at: llvm/include/llvm/ADT/StringMap.h:473
Parameters
- llvm::StringMap::iterator I
¶llvm::StringMap::iterator find(
llvm::StringRef Key)
llvm::StringMap::iterator find(
llvm::StringRef Key)
Declared at: llvm/include/llvm/ADT/StringMap.h:355
Parameters
- llvm::StringRef Key
¶llvm::StringMap::const_iterator find(
llvm::StringRef Key) const
llvm::StringMap::const_iterator find(
llvm::StringRef Key) const
Declared at: llvm/include/llvm/ADT/StringMap.h:361
Parameters
- llvm::StringRef Key
¶const AllocatorTy& getAllocator() const
const AllocatorTy& getAllocator() const
Declared at: llvm/include/llvm/ADT/StringMap.h:327
¶AllocatorTy& getAllocator()
AllocatorTy& getAllocator()
Declared at: llvm/include/llvm/ADT/StringMap.h:326
¶bool insert(llvm::StringMap::MapEntryTy* KeyValue)
bool insert(llvm::StringMap::MapEntryTy* KeyValue)
Description
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.
Declared at: llvm/include/llvm/ADT/StringMap.h:393
Parameters
- llvm::StringMap::MapEntryTy* KeyValue
¶std::pair<iterator, bool> insert(
std::pair<StringRef, ValueTy> KV)
std::pair<iterator, bool> insert(
std::pair<StringRef, ValueTy> KV)
Description
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.
Declared at: llvm/include/llvm/ADT/StringMap.h:413
Parameters
- std::pair<StringRef, ValueTy> KV
¶template <typename V>
std::pair<iterator, bool> insert_or_assign(
llvm::StringRef Key,
V&& Val)
template <typename V>
std::pair<iterator, bool> insert_or_assign(
llvm::StringRef Key,
V&& Val)
Description
Inserts an element or assigns to the current element if the key already exists. The return type is the same as try_emplace.
Declared at: llvm/include/llvm/ADT/StringMap.h:420
Templates
- V
Parameters
- llvm::StringRef Key
- V&& Val
¶iterator_range<StringMapKeyIterator<ValueTy>>
keys() const
iterator_range<StringMapKeyIterator<ValueTy>>
keys() const
Declared at: llvm/include/llvm/ADT/StringMap.h:350
¶ValueTy lookup(llvm::StringRef Key) const
ValueTy lookup(llvm::StringRef Key) const
Description
lookup - Return the entry for the specified key, or a default constructed value if no such entry exists.
Declared at: llvm/include/llvm/ADT/StringMap.h:369
Parameters
- llvm::StringRef Key
¶void remove(llvm::StringMap::MapEntryTy* KeyValue)
void remove(llvm::StringMap::MapEntryTy* KeyValue)
Description
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.
Declared at: llvm/include/llvm/ADT/StringMap.h:469
Parameters
- llvm::StringMap::MapEntryTy* KeyValue
¶template <typename... ArgsTy>
std::pair<iterator, bool> try_emplace(
llvm::StringRef Key,
ArgsTy&&... Args)
template <typename... ArgsTy>
std::pair<iterator, bool> try_emplace(
llvm::StringRef Key,
ArgsTy&&... Args)
Description
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.
Declared at: llvm/include/llvm/ADT/StringMap.h:432
Templates
- ArgsTy
Parameters
- llvm::StringRef Key
- ArgsTy&&... Args
¶~StringMap<ValueTy, AllocatorTy>()
~StringMap<ValueTy, AllocatorTy>()
Declared at: llvm/include/llvm/ADT/StringMap.h:311