LLVM: llvm::StringMapImpl Class Reference (original) (raw)

StringMapImpl - This is the base class of [StringMap](classllvm%5F1%5F1StringMap.html "StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...") that is shared among all of its instantiations. More...

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

Inherited by llvm::StringMap< EmptyStringSetTag, AllocatorTy >, llvm::StringMap< std::unique_ptr< InlineGraphNode > >, llvm::StringMap< const TargetRegisterClass * >, llvm::StringMap< const RegisterBank * >, llvm::StringMap< DwarfStringPoolEntry, BumpPtrAllocator >, llvm::StringMap< size_t, BumpPtrAllocator >, llvm::StringMap< uint64_t >, llvm::StringMap< Symbol * >, llvm::StringMap< std::pair< ExecutorAddr, JITSymbolFlags > >, llvm::StringMap< RefCountType >, llvm::StringMap< std::shared_ptr< LibraryInfo > >, llvm::StringMap< State >, llvm::StringMap< Comdat >, llvm::StringMap< NamedMDNode * >, llvm::StringMap< ModuleHash >, llvm::StringMap< Value * >, llvm::StringMap< MCSymbolTableValue, BumpPtrAllocator & >, llvm::StringMap< const PassInfo * >, llvm::StringMap< llvm::unique_function< HandlerT > >, llvm::StringMap< std::pair< HNode *, SMRange > >, llvm::StringMap< RecordLoc >, llvm::StringMap< ProbeFactorMap >, llvm::StringMap< SymbolTableEntry >, llvm::const_iterator< State >, llvm::StringMap< StringMap< Matcher > >, llvm::StringMap< T >, llvm::StringMap< EmptyStringSetTag, MallocAllocator >, llvm::StringMap< llvm::DenseSet< llvm::ValueInfo > >, llvm::StringMap< const StringInit *, BumpPtrAllocator & >, llvm::StringMap< std::unique_ptr< llvm::AArch64Subtarget > >, llvm::StringMap< std::unique_ptr< llvm::ARMSubtarget > >, llvm::StringMap< llvm::SmallVector< size_t, 1 > >, llvm::StringMap< std::vector< std::string > >, llvm::StringMap< WeightInfo >, llvm::StringMap< llvm::SmallString< 128 > >, llvm::StringMap< llvm::FunctionPathAndClusterInfo >, llvm::StringMap< llvm::StringRef >, llvm::StringMap< std::unique_ptr< llvm::CSKYSubtarget > >, llvm::StringMap< unsigned >, llvm::StringMap< uint32_t >, llvm::StringMap< std::string >, llvm::StringMap< const llvm::DIE * >, llvm::StringMap< llvm::DwarfStringPoolEntry, llvm::BumpPtrAllocatorImpl & >, llvm::StringMap< bool >, llvm::StringMap< llvm::NumericVariable * >, llvm::StringMap< llvm::GCStrategy * >, llvm::StringMap< std::unique_ptr< llvm::GCNSubtarget > >, llvm::StringMap< std::unique_ptr< llvm::HexagonSubtarget > >, llvm::StringMap< llvm::SmallDenseMap< uint64_t, InstrProfRecord > >, llvm::StringMap< std::pair< llvm::Type *, llvm::SMLoc > >, llvm::StringMap< llvm::MDString, llvm::BumpPtrAllocatorImpl >, llvm::StringMap< std::unique_ptr< llvm::ConstantDataSequential > >, llvm::StringMap< llvm::StructType * >, llvm::StringMap< uint8_t >, llvm::StringMap< GlobalValue::LinkageTypes >, llvm::StringMap< NameAndAttributes >, llvm::StringMap< size_t >, llvm::StringMap< std::unique_ptr< llvm::LoongArchSubtarget > >, llvm::StringMap< std::unique_ptr< llvm::M68kSubtarget > >, llvm::StringMap< llvm::MCSymbol *, llvm::BumpPtrAllocatorImpl & >, llvm::StringMap< llvm::MCSectionMachO * >, llvm::StringMap< llvm::MCSectionELF * >, llvm::StringMap< llvm::MCSectionDXContainer * >, llvm::StringMap< llvm::MCAsmMacro >, llvm::StringMap< std::unique_ptr< llvm::MipsSubtarget > >, llvm::StringMap< std::unique_ptr< llvm::PPCSubtarget > >, llvm::StringMap< NumericVariableMatch >, llvm::StringMap< llvm::VRegInfo * >, llvm::StringMap< llvm::Register >, llvm::StringMap< const uint32_t * >, llvm::StringMap< int >, llvm::StringMap< MachineMemOperand::Flags >, llvm::StringMap< std::unique_ptr< const llvm::ExternalSymbolPseudoSourceValue > >, llvm::StringMap< std::unique_ptr< llvm::R600Subtarget > >, llvm::StringMap< llvm::MCSymbol * >, llvm::StringMap< std::unique_ptr< llvm::RISCVSubtarget > >, llvm::StringMap< llvm::SmallVector< RelocationEntry, 64 > >, llvm::StringMap< LocToLocMap >, llvm::StringMap< std::unordered_map< llvm::sampleprof::LineLocation, MatchState, llvm::sampleprof::LineLocationHash > >, llvm::StringMap< llvm::SDNode * >, llvm::StringMap< std::unique_ptr< llvm::SetTheory::Operator > >, llvm::StringMap< std::unique_ptr< llvm::SetTheory::Expander > >, llvm::StringMap< llvm::Type * >, llvm::StringMap< std::unique_ptr< llvm::SparcSubtarget > >, llvm::StringMap< std::unique_ptr< llvm::SystemZSubtarget > >, llvm::StringMap< llvm::SmallVector< std::unique_ptr< Timer >, 4 > >, llvm::StringMap< CountAndDurationType >, llvm::StringMap< std::unique_ptr< llvm::WebAssemblySubtarget > >, llvm::StringMap< std::unique_ptr< llvm::X86Subtarget > >, llvm::StringMap< std::unique_ptr< llvm::XtensaSubtarget > >, llvm::StringMap< llvm:🆑:Option * >, llvm::StringMap< std::vector< llvm::support::detail::packed_endian_specific_integral< uint32_t, llvm::endianness::little, unaligned > > >, llvm::StringMap< llvm::StringMapEntry< EmptyStringSetTag > * >, llvm::StringMap< SectionParserFunction >, llvm::StringMap< ResponseHandlerTy >, llvm::StringMap< llvm::mustache::ASTNode >, llvm::StringMap< Lambda >, llvm::StringMap< SectionLambda >, llvm::StringMap< llvm::objcopy::SectionRename >, llvm::StringMap< llvm::objcopy::SectionFlagsUpdate >, llvm::StringMap< std::unique_ptr< llvm::orc::DebugObjectSection > >, llvm::StringMap< std::vector< char > >, llvm::StringMap< llvm::orc::ExecutorAddr >, llvm::StringMap< std::shared_ptr< llvm::orc::LibraryManager::LibraryInfo > >, llvm::StringMap< PathInfo >, llvm::StringMap< mode_t >, llvm::StringMap< llvm::orc::LibraryResolver::SymbolQuery::Result >, llvm::StringMap< std::shared_ptr< llvm::orc::LibrarySearchPath > >, llvm::StringMap< std::pair< StubKey, llvm::JITSymbolFlags > >, llvm::StringMap< llvm::codeview::FileChecksumEntry >, llvm::StringMap< unsigned, llvm::BumpPtrAllocatorImpl >, and llvm::StringMap< ValueTy, AllocatorTy >.

Public Member Functions
unsigned getNumBuckets () const
unsigned getNumItems () const
bool empty () const
unsigned size () const
void swap (StringMapImpl &Other)
Static Public Attributes
static constexpr uintptr_t TombstoneIntVal
Protected Member Functions
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
StringMapEntryBase ** TheTable = nullptr
unsigned NumBuckets = 0
unsigned NumItems = 0
unsigned NumTombstones = 0
unsigned ItemSize

StringMapImpl - This is the base class of [StringMap](classllvm%5F1%5F1StringMap.html "StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...") that is shared among all of its instantiations.

Definition at line 33 of file StringMap.h.

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

Definition at line 45 of file StringMap.h.

References ItemSize.

Referenced by llvm::StringMap< EmptyStringSetTag, AllocatorTy >::StringMap(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::StringMap(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::StringMap(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::StringMap(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::StringMap(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::StringMap(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::StringMap(), StringMapImpl(), and swap().

â—† StringMapImpl() [2/3]

llvm::StringMapImpl::StringMapImpl ( StringMapImpl && RHS) inlineprotected

â—† StringMapImpl() [3/3]

â—† ~StringMapImpl()

llvm::StringMapImpl::~StringMapImpl ( ) inlineprotected

â—† buckets()

â—† empty()

bool llvm::StringMapImpl::empty ( ) const inlinenodiscard

â—† FindKey() [1/2]

int llvm::StringMapImpl::FindKey ( StringRef Key) const inlineprotected

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

References FindKey(), hash(), and llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key.

Referenced by llvm::StringMap< EmptyStringSetTag, AllocatorTy >::find(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::find(), FindKey(), and RemoveKey().

â—† FindKey() [2/2]

Overload that explicitly takes precomputed hash(Key).

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 139 of file StringMap.cpp.

References assert(), getHashTable(), llvm::StringMapEntryBase::getKeyLength(), getTombstoneVal(), hash(), llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, ItemSize, LLVM_LIKELY, NumBuckets, llvm::shouldReverseIterate(), and TheTable.

â—† getNumBuckets()

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

â—† getNumItems()

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

â—† getTombstoneVal()

Definition at line 101 of file StringMap.h.

References TombstoneIntVal.

Referenced by llvm::StringMap< EmptyStringSetTag, AllocatorTy >::clear(), FindKey(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::insert(), LookupBucketFor(), RehashTable(), RemoveKey(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::StringMap(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::try_emplace_with_hash(), and llvm::StringMap< EmptyStringSetTag, AllocatorTy >::~StringMap().

â—† hash()

Returns the hash value that will be used for the given string.

This allows precomputing the value and passing it explicitly to some of the functions. The implementation of this function is not guaranteed to be stable and may change.

Definition at line 46 of file StringMap.cpp.

References llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, and llvm::xxh3_64bits().

Referenced by llvm::StringMap< EmptyStringSetTag, AllocatorTy >::find(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::find(), FindKey(), FindKey(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::insert(), LookupBucketFor(), LookupBucketFor(), and llvm::StringMap< EmptyStringSetTag, AllocatorTy >::try_emplace().

â—† init()

void StringMapImpl::init ( unsigned Size) protected

â—† LookupBucketFor() [1/2]

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

References hash(), llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, and LookupBucketFor().

Referenced by llvm::StringMap< EmptyStringSetTag, AllocatorTy >::insert(), LookupBucketFor(), and llvm::StringMap< EmptyStringSetTag, AllocatorTy >::try_emplace_with_hash().

â—† LookupBucketFor() [2/2]

Overload that explicitly takes precomputed hash(Key).

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 78 of file StringMap.cpp.

References assert(), getHashTable(), llvm::StringMapEntryBase::getKeyLength(), getTombstoneVal(), hash(), init(), ItemSize, LLVM_LIKELY, NumBuckets, llvm::shouldReverseIterate(), and TheTable.

â—† RehashTable()

RehashTable - Grow the table, redistributing values into the buckets with the appropriate mod-of-hashtable-size.

Definition at line 210 of file StringMap.cpp.

References createTable(), getHashTable(), getTombstoneVal(), I, LLVM_UNLIKELY, NumBuckets, NumItems, NumTombstones, and TheTable.

Referenced by llvm::StringMap< EmptyStringSetTag, AllocatorTy >::insert(), and llvm::StringMap< EmptyStringSetTag, AllocatorTy >::try_emplace_with_hash().

â—† RemoveKey() [1/2]

â—† RemoveKey() [2/2]

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 194 of file StringMap.cpp.

References assert(), FindKey(), getTombstoneVal(), llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, NumBuckets, NumItems, NumTombstones, and TheTable.

â—† size()

unsigned llvm::StringMapImpl::size ( ) const inlinenodiscard

â—† swap()

â—† ItemSize

â—† NumBuckets

unsigned llvm::StringMapImpl::NumBuckets = 0 protected

Definition at line 39 of file StringMap.h.

Referenced by llvm::StringMap< EmptyStringSetTag, AllocatorTy >::begin(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::begin(), buckets(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::end(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::end(), FindKey(), getNumBuckets(), init(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::insert(), LookupBucketFor(), RehashTable(), RemoveKey(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::StringMap(), StringMapImpl(), swap(), and llvm::StringMap< EmptyStringSetTag, AllocatorTy >::try_emplace_with_hash().

â—† NumItems

unsigned llvm::StringMapImpl::NumItems = 0 protected

Definition at line 40 of file StringMap.h.

Referenced by llvm::StringMap< EmptyStringSetTag, AllocatorTy >::clear(), empty(), getNumItems(), init(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::insert(), RehashTable(), RemoveKey(), size(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::StringMap(), StringMapImpl(), swap(), and llvm::StringMap< EmptyStringSetTag, AllocatorTy >::try_emplace_with_hash().

â—† NumTombstones

unsigned llvm::StringMapImpl::NumTombstones = 0 protected

Definition at line 41 of file StringMap.h.

Referenced by llvm::StringMap< EmptyStringSetTag, AllocatorTy >::clear(), init(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::insert(), RehashTable(), RemoveKey(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::StringMap(), StringMapImpl(), swap(), and llvm::StringMap< EmptyStringSetTag, AllocatorTy >::try_emplace_with_hash().

â—† TheTable

Definition at line 38 of file StringMap.h.

Referenced by llvm::StringMap< EmptyStringSetTag, AllocatorTy >::begin(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::begin(), buckets(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::end(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::end(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::find(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::find(), FindKey(), init(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::insert(), LookupBucketFor(), RehashTable(), RemoveKey(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::StringMap(), StringMapImpl(), swap(), llvm::StringMap< EmptyStringSetTag, AllocatorTy >::try_emplace_with_hash(), and ~StringMapImpl().

â—† TombstoneIntVal

uintptr_t llvm::StringMapImpl::TombstoneIntVal staticconstexpr

Initial value:

=

static_cast<uintptr_t>(-1)

A traits type that is used to handle pointer types and things that are just wrappers for pointers as ...

Definition at line 97 of file StringMap.h.

Referenced by getTombstoneVal().


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