Synopsis

Declared in <llvm/ADT/DenseMap.h>

template<
    typename KeyT,
    typename ValueT,
    unsigned int InlineBuckets = 4,
    typename KeyInfoT = DenseMapInfo<KeyT>,
    typename BucketT = /* implementation-defined */>
class SmallDenseMap
    : public DenseMapBase<SmallDenseMap<KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT>, KeyT, ValueT, KeyInfoT, BucketT>

Base Classes

Types

Name

Description

HandleBase

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

Type Aliases

Name

Description

const_iterator

Const iterator over map entries.

iterator

Iterator over map entries.

key_type

The map's key type.

mapped_type

The map's mapped value type.

size_type

Unsigned type used for map sizes and capacities.

value_type

The map's value type (key/value bucket pair).

Member Functions

Name

Description

SmallDenseMap [constructor]

Constructors

~SmallDenseMap [destructor]

Destroy all entries and deallocate bucket storage.

operator=

Assignment operators

at

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

begin

begin overloads

clear

Remove all entries from the map, possibly shrinking storage if capacity is large relative to size.

contains

Return true if the specified key is in the map, false otherwise.

count

Return 1 if the specified key is in the map, 0 otherwise.

emplace_or_assign

Emplace Key with value constructed from Args, or assign a new value if the key exists.

empty

Return true if the map contains no entries.

end

end overloads

erase

erase overloads

eraseFromFilledBucket

Erase the entry at TheBucket without invoking a move callback.

find

find overloads

find_as

find_as overloads

getMemorySize

Return the approximate size (in bytes) of the actual map. This is just the raw memory used by DenseMap. If entries are pointers to objects, the size of the referenced objects are not included.

getPointerIntoBucketsArray

getPointerIntoBucketsArray() ‐ Return an opaque pointer into the buckets array. In conjunction with the previous method, this can be used to determine whether an insertion caused the DenseMap to reallocate.

incrementEpoch

No‐op when ABI‐breaking checks are disabled.

insert

insert overloads

insert_as

Alternate version of insert() which allows a different, and possibly less expensive, key type. The DenseMapInfo is responsible for supplying methods getHashValue(LookupKeyT) and isEqual(LookupKeyT, KeyT) for each key type used.

insert_or_assign

Insert Key with value Val, or assign Val if the key exists.

insert_range

Inserts range of 'std::pair<KeyT, ValueT>' values into the map.

isPointerIntoBucketsArray

Return true if the specified pointer points somewhere into the DenseMap's array of buckets (i.e. either to a key or value in the DenseMap).

keys

keys overloads

lookup

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

lookup_or

Return the entry with the specified key, or Default. This variant is useful when lookup cannot be used with non‐default‐constructible values.

operator[]

Subscript operators

remove_if

Remove entries that match the given predicate. Pred is invoked with a reference to each live bucket and must not access the map being modified. This is the safe replacement for erase‐while‐iterating.

reserve

Grow the densemap so that it can contain at least NumEntries items before resizing again.

shrink_and_clear

Remove all entries and shrink bucket storage to fit the empty map.

size

Return the number of entries in the map.

swap

Swap the contents of this map with RHS.

try_emplace

Insert a key and construct its value in‐place if the key is absent. If the key is already present, the stored value is left unchanged.

values

values overloads

Protected Types

Name

Description

ExactBucketCount

Tag type selecting constructors that take an exact bucket count rather than a reserve‐for‐N‐entries hint.

Rep

Hot‐path snapshot of bucket storage fields.

Protected Member Functions

Name

Description

copyFrom

Replace this map's contents with a copy of other.

destroyAll

Destroy all live key/value pairs in the bucket array.

getMinBucketToReserveForEntries

Returns the number of buckets to allocate to ensure that the DenseMap can accommodate NumEntries without need to grow().

initEmpty

Reset entry count to zero and clear the used‐bit array for all buckets.

initWithExactBucketCount

Initialize bucket storage with exactly NewNumBuckets buckets.

moveFrom

Move key/value pairs from Other into this empty map. Other is left in a valid but empty state.

Friends

Name

Description

llvm::DenseMapBase

Non-Member Functions

Name

Description

operator!=

Inequality operator

operator!=

Inequality comparison for DenseMap.

operator==

Equality operator

operator==

Equality comparison for DenseMap.

Created with MrDocs