StringSet ‐ A wrapper for StringMap that provides set‐like functionality.

Synopsis

Declared in <llvm/ADT/StringSet.h>

template<class AllocatorTy = MallocAllocator>
class StringSet
    : public StringMap<EmptyStringSetTag, AllocatorTy>

Base Classes

Name

Description

StringMap<EmptyStringSetTag, AllocatorTy>

Map specialized for string keys with efficient allocation and hashing.

Types

Name

Description

HandleBase

Empty stub of HandleBase used when ABI‐breaking checks are disabled.

Type Aliases

Name

Description

MapEntryTy

Entry type storing a key and mapped value together.

const_iterator

Const iterator over map entries.

iterator

Mutable iterator over map entries.

key_type

Key type exposed for STL compatibility (internally a C string pointer).

mapped_type

Mapped value type.

size_type

Unsigned type used for sizes.

value_type

Entry type combining key and value.

Member Functions

Name

Description

StringSet [constructor]

Constructors

operator=

Copy‐assign by swapping with a copy of RHS.

at

Return a const reference to the value for Val, aborting if absent.

begin

begin overloads

clear

Remove all entries from the map.

contains

contains overloads

count

count overloads

empty

Return true if the map contains no entries.

end

end overloads

erase

erase overloads

find

find overloads

getNumBuckets

Return the number of allocated hash buckets.

getNumItems

Return the number of live entries.

incrementEpoch

No‐op when ABI‐breaking checks are disabled.

insert

insert overloads

insert_or_assign

Insert or assign a mapped value for Key.

insert_range

Insert each string from range R.

keys

Return a range that yields each key as a StringRef.

lookup

Return the value for Key, or a default‐constructed value if absent.

operator[]

Return a reference to the value for Key, inserting a default if absent.

remove

Remove KeyValue from the map without destroying it.

remove_if

Remove every entry for which Pred returns true.

size

Return the number of live entries.

swap

Exchange the contents of this map with Other.

try_emplace

Emplace a value for Key if the key is not already present.

try_emplace_with_hash

Emplace a value for Key using a precomputed hash if absent.

operator==

Return true if this map and RHS have the same keys and values.

operator!=

Return true if the maps differ in keys or values.

Static Member Functions

Name

Description

hash

Return the hash value used for Key.

Using Declarations

Name

Description

getAllocator

Return the allocator used by this map.

Protected Member Functions

Name

Description

FindKey

FindKey overloads

LookupBucketFor

LookupBucketFor overloads

RehashTable

Grow and rehash the table; return the new bucket for BucketNo.

RemoveKey

RemoveKey overloads

buckets

Return a range over the raw bucket pointer array.

init

Allocate the table with the specified number of buckets and otherwise setup the map as empty.

removeBucket

Remove the entry pointer at the given (live) bucket without destroying the entry, and close the hole via Algorithm R backward shifting.

Protected Data Members

Name

Description

ItemSize

Size in bytes of each StringMapEntry specialization.

NumBuckets

Number of hash buckets currently allocated.

NumItems

Number of live key/value entries in the map.

TheTable

Hash table of entry pointers; null slots are empty probe holes.

Non-Member Functions

Name

Description

getKnownAssumptionStrings

A set of known assumption strings that are accepted without warning and which can be recommended as typo correction.

orc::addDefaultBootstrapValuesForHostProcess

Add default bootstrap values for JIT execution in the host process.

Created with MrDocs