LLVM 20.0.0git
|
StringSet - A wrapper for StringMap that provides set-like functionality. More...
#include "llvm/ADT/StringSet.h"
Public Member Functions | |
StringSet ()=default | |
StringSet (std::initializer_list< StringRef > initializer) | |
template<typename Container > | |
StringSet (Container &&C) | |
StringSet (AllocatorTy a) | |
std::pair< typename Base::iterator, bool > | insert (StringRef key) |
template<typename InputIt > | |
void | insert (InputIt begin, InputIt end) |
template<typename ValueTy > | |
std::pair< typename Base::iterator, bool > | insert (const StringMapEntry< ValueTy > &mapEntry) |
bool | contains (StringRef key) const |
Check if the set contains the given key . | |
Public Member Functions inherited from llvm::StringMap< ValueTy, AllocatorTy > | |
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<typename InputTy > | |
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<typename InputIt > | |
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<typename V > | |
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) |
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 | |
Public Types inherited from llvm::StringMap< ValueTy, AllocatorTy > | |
using | MapEntryTy = StringMapEntry< ValueTy > |
using | key_type = const char * |
using | mapped_type = ValueTy |
using | value_type = StringMapEntry< ValueTy > |
using | size_type = size_t |
using | const_iterator = StringMapConstIterator< ValueTy > |
using | iterator = StringMapIterator< ValueTy > |
Static Public Member Functions inherited from llvm::StringMapImpl | |
static StringMapEntryBase * | getTombstoneVal () |
static 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) | |
StringMapImpl (unsigned InitSize, unsigned ItemSize) | |
~StringMapImpl () | |
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. | |
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. | |
int | FindKey (StringRef Key, uint32_t FullHashValue) const |
Overload that explicitly takes precomputed hash(Key). | |
void | RemoveKey (StringMapEntryBase *V) |
RemoveKey - Remove the specified StringMapEntry from the table, but do not delete it. | |
StringMapEntryBase * | RemoveKey (StringRef Key) |
RemoveKey - Remove the StringMapEntry for the specified key from the table, returning it. | |
void | init (unsigned Size) |
Allocate the table with the specified number of buckets and otherwise setup the map as empty. | |
Protected Attributes inherited from llvm::StringMapImpl | |
StringMapEntryBase ** | TheTable = nullptr |
unsigned | NumBuckets = 0 |
unsigned | NumItems = 0 |
unsigned | NumTombstones = 0 |
unsigned | ItemSize |
StringSet - A wrapper for StringMap that provides set-like functionality.
Definition at line 23 of file StringSet.h.
|
default |
|
inline |
Definition at line 28 of file StringSet.h.
References llvm::StringSet< AllocatorTy >::insert().
|
inlineexplicit |
Definition at line 32 of file StringSet.h.
References llvm::CallingConv::C, and llvm::StringSet< AllocatorTy >::insert().
|
inlineexplicit |
Definition at line 36 of file StringSet.h.
|
inline |
Check if the set contains the given key
.
Definition at line 55 of file StringSet.h.
References llvm::StringMapImpl::FindKey().
Referenced by llvm::MachineRegisterInfo::insertVRegByName(), and llvm::libDriverMain().
|
inline |
Definition at line 50 of file StringSet.h.
References llvm::StringMapEntry< ValueTy >::getKey(), and llvm::StringSet< AllocatorTy >::insert().
|
inline |
Definition at line 43 of file StringSet.h.
References llvm::StringMap< ValueTy, AllocatorTy >::begin(), llvm::StringMap< ValueTy, AllocatorTy >::end(), and llvm::StringSet< AllocatorTy >::insert().
|
inline |
Definition at line 38 of file StringSet.h.
References llvm::StringMap< ValueTy, AllocatorTy >::try_emplace().
Referenced by llvm::AArch64Subtarget::AArch64Subtarget(), llvm::LTOCodeGenerator::addMustPreserveSymbol(), llvm::InstrProfSymtab::addSymbolName(), llvm::InstrProfSymtab::addVTableName(), llvm::InstrProfWriter::addVTableName(), llvm::TarWriter::append(), llvm::coverage::CoverageFilenamesSectionWriter::CoverageFilenamesSectionWriter(), llvm::ThinLTOCodeGenerator::crossReferenceSymbol(), llvm::StringSet< AllocatorTy >::insert(), llvm::gsym::GsymCreator::insertString(), llvm::MachineRegisterInfo::insertVRegByName(), llvm::InternalizePass::internalizeModule(), llvm::KnownAssumptionString::KnownAssumptionString(), llvm::libDriverMain(), llvm::FileCollectorBase::markAsSeen(), parseCHRFilterFiles(), llvm::ThinLTOCodeGenerator::preserveSymbol(), llvm::ReplayInlineAdvisor::ReplayInlineAdvisor(), llvm::LTOCodeGenerator::setAsmUndefinedRefs(), llvm::StringSet< AllocatorTy >::StringSet(), llvm::TGLexer::TGLexer(), llvm::FileCheck::ValidateCheckPrefixes(), and ValidatePrefixes().