LLVM 22.0.0git
|
#include "llvm/ADT/DenseMap.h"
Inherits llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >.
Public Member Functions | |
SmallDenseMap (unsigned NumInitBuckets=0) | |
SmallDenseMap (const SmallDenseMap &other) | |
SmallDenseMap (SmallDenseMap &&other) | |
template<typename InputIt > | |
SmallDenseMap (const InputIt &I, const InputIt &E) | |
template<typename RangeT > | |
SmallDenseMap (llvm::from_range_t, const RangeT &Range) | |
SmallDenseMap (std::initializer_list< typename BaseT::value_type > Vals) | |
~SmallDenseMap () | |
void | swap (SmallDenseMap &RHS) |
SmallDenseMap & | operator= (const SmallDenseMap &other) |
SmallDenseMap & | operator= (SmallDenseMap &&other) |
void | copyFrom (const SmallDenseMap &other) |
void | init (unsigned InitBuckets) |
void | grow (unsigned AtLeast) |
void | shrink_and_clear () |
![]() | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
auto | keys () |
auto | values () |
auto | keys () const |
auto | values () const |
bool | empty () const |
unsigned | size () const |
void | reserve (size_type NumEntries) |
Grow the densemap so that it can contain at least NumEntries items before resizing again. | |
void | clear () |
bool | contains (const_arg_type_t< KeyT > Val) const |
Return true if the specified key is in the map, false otherwise. | |
size_type | count (const_arg_type_t< KeyT > Val) const |
Return 1 if the specified key is in the map, 0 otherwise. | |
iterator | find (const_arg_type_t< KeyT > Val) |
const_iterator | find (const_arg_type_t< KeyT > Val) const |
template<class LookupKeyT > | |
iterator | find_as (const LookupKeyT &Val) |
Alternate version of find() which allows a different, and possibly less expensive, key type. | |
template<class LookupKeyT > | |
const_iterator | find_as (const LookupKeyT &Val) const |
ValueT | lookup (const_arg_type_t< KeyT > Val) const |
lookup - Return the entry for the specified key, or a default constructed value if no such entry exists. | |
template<typename U = std::remove_cv_t<ValueT>> | |
ValueT | lookup_or (const_arg_type_t< KeyT > Val, U &&Default) const |
const ValueT & | at (const_arg_type_t< KeyT > Val) const |
at - Return the entry for the specified key, or abort if no such entry exists. | |
std::pair< iterator, bool > | insert (const std::pair< KeyT, ValueT > &KV) |
std::pair< iterator, bool > | insert (std::pair< KeyT, ValueT > &&KV) |
template<typename... Ts> | |
std::pair< iterator, bool > | try_emplace (KeyT &&Key, Ts &&...Args) |
template<typename... Ts> | |
std::pair< iterator, bool > | try_emplace (const KeyT &Key, Ts &&...Args) |
template<typename LookupKeyT > | |
std::pair< iterator, bool > | insert_as (std::pair< KeyT, ValueT > &&KV, const LookupKeyT &Val) |
Alternate version of insert() which allows a different, and possibly less expensive, key type. | |
template<typename InputIt > | |
void | insert (InputIt I, InputIt E) |
insert - Range insertion of pairs. | |
template<typename Range > | |
void | insert_range (Range &&R) |
Inserts range of 'std::pair<KeyT, ValueT>' values into the map. | |
template<typename V > | |
std::pair< iterator, bool > | insert_or_assign (const KeyT &Key, V &&Val) |
template<typename V > | |
std::pair< iterator, bool > | insert_or_assign (KeyT &&Key, V &&Val) |
template<typename... Ts> | |
std::pair< iterator, bool > | emplace_or_assign (const KeyT &Key, Ts &&...Args) |
template<typename... Ts> | |
std::pair< iterator, bool > | emplace_or_assign (KeyT &&Key, Ts &&...Args) |
bool | erase (const KeyT &Val) |
void | erase (iterator I) |
ValueT & | operator[] (const KeyT &Key) |
ValueT & | operator[] (KeyT &&Key) |
bool | isPointerIntoBucketsArray (const void *Ptr) const |
isPointerIntoBucketsArray - Return true if the specified pointer points somewhere into the DenseMap's array of buckets (i.e. | |
const void * | getPointerIntoBucketsArray () const |
getPointerIntoBucketsArray() - Return an opaque pointer into the buckets array. | |
size_t | getMemorySize () const |
Return the approximate size (in bytes) of the actual map. | |
![]() | |
void | incrementEpoch () |
Friends | |
class | DenseMapBase< SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT > |
Additional Inherited Members | |
![]() | |
using | size_type = unsigned |
using | key_type = KeyT |
using | mapped_type = ValueT |
using | value_type = BucketT |
using | iterator = DenseMapIterator< KeyT, ValueT, KeyInfoT, BucketT > |
using | const_iterator = DenseMapIterator< KeyT, ValueT, KeyInfoT, BucketT, true > |
![]() | |
DenseMapBase ()=default | |
void | destroyAll () |
void | initEmpty () |
unsigned | getMinBucketToReserveForEntries (unsigned NumEntries) |
Returns the number of buckets to allocate to ensure that the DenseMap can accommodate NumEntries without need to grow(). | |
void | moveFromOldBuckets (iterator_range< BucketT * > OldBuckets) |
template<typename OtherBaseT > | |
void | copyFrom (const DenseMapBase< OtherBaseT, KeyT, ValueT, KeyInfoT, BucketT > &other) |
![]() | |
static unsigned | getHashValue (const KeyT &Val) |
template<typename LookupKeyT > | |
static unsigned | getHashValue (const LookupKeyT &Val) |
static const KeyT | getEmptyKey () |
static const KeyT | getTombstoneKey () |
Definition at line 856 of file DenseMap.h.
|
inlineexplicit |
Definition at line 886 of file DenseMap.h.
References llvm::bit_ceil(), and llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::init().
|
inline |
Definition at line 892 of file DenseMap.h.
References llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::copyFrom(), and llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::init().
|
inline |
Definition at line 897 of file DenseMap.h.
References llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::init(), and llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::swap().
|
inline |
Definition at line 903 of file DenseMap.h.
References E, I, llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::init(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), and llvm::NextPowerOf2().
|
inline |
Definition at line 909 of file DenseMap.h.
|
inline |
Definition at line 912 of file DenseMap.h.
|
inline |
Definition at line 915 of file DenseMap.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::destroyAll().
|
inline |
Definition at line 1005 of file DenseMap.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::copyFrom(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::destroyAll().
Referenced by llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::operator=(), and llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::SmallDenseMap().
|
inline |
Definition at line 1025 of file DenseMap.h.
References assert(), B, llvm::deallocate_buffer(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::getEmptyKey(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::getTombstoneKey(), llvm::make_range(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::moveFromOldBuckets(), and llvm::NextPowerOf2().
|
inline |
Definition at line 1016 of file DenseMap.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::initEmpty().
Referenced by llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::operator=(), llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::shrink_and_clear(), and llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::SmallDenseMap().
|
inline |
Definition at line 991 of file DenseMap.h.
References llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::copyFrom().
|
inline |
|
inline |
Definition at line 1078 of file DenseMap.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::destroyAll(), llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::init(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::initEmpty(), llvm::Log2_32_Ceil(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::size().
|
inline |
Definition at line 920 of file DenseMap.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::getEmptyKey(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::getTombstoneKey(), RHS, and std::swap().
Referenced by llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::operator=(), and llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::SmallDenseMap().
|
friend |
Definition at line 842 of file DenseMap.h.