LLVM 20.0.0git
Classes | Public Member Functions | Friends | List of all members
llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT > Class Template Reference

#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)
 
 SmallDenseMap (std::initializer_list< typename BaseT::value_type > Vals)
 
 ~SmallDenseMap ()
 
void swap (SmallDenseMap &RHS)
 
SmallDenseMapoperator= (const SmallDenseMap &other)
 
SmallDenseMapoperator= (SmallDenseMap &&other)
 
void copyFrom (const SmallDenseMap &other)
 
void init (unsigned InitBuckets)
 
void grow (unsigned AtLeast)
 
void shrink_and_clear ()
 
- Public Member Functions inherited from llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () 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.
 
const ValueTat (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, boolinsert (const std::pair< KeyT, ValueT > &KV)
 
std::pair< iterator, boolinsert (std::pair< KeyT, ValueT > &&KV)
 
template<typename... Ts>
std::pair< iterator, booltry_emplace (KeyT &&Key, Ts &&... Args)
 
template<typename... Ts>
std::pair< iterator, booltry_emplace (const KeyT &Key, Ts &&... Args)
 
template<typename LookupKeyT >
std::pair< iterator, boolinsert_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 V >
std::pair< iterator, boolinsert_or_assign (const KeyT &Key, V &&Val)
 
template<typename V >
std::pair< iterator, boolinsert_or_assign (KeyT &&Key, V &&Val)
 
ValueTgetOrInsertDefault (KeyT &&Key)
 Returns the value associated to the key in the map if it exists.
 
ValueTgetOrInsertDefault (const KeyT &Key)
 Returns the value associated to the key in the map if it exists.
 
bool erase (const KeyT &Val)
 
void erase (iterator I)
 
value_typeFindAndConstruct (const KeyT &Key)
 
ValueToperator[] (const KeyT &Key)
 
value_typeFindAndConstruct (KeyT &&Key)
 
ValueToperator[] (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.
 
- Public Member Functions inherited from llvm::DebugEpochBase
void incrementEpoch ()
 

Friends

class DenseMapBase< SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT >
 

Additional Inherited Members

- Public Types inherited from llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >
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 >
 
- Protected Member Functions inherited from llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >
 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 (BucketT *OldBucketsBegin, BucketT *OldBucketsEnd)
 
template<typename OtherBaseT >
void copyFrom (const DenseMapBase< OtherBaseT, KeyT, ValueT, KeyInfoT, BucketT > &other)
 
- Static Protected Member Functions inherited from llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >
static unsigned getHashValue (const KeyT &Val)
 
template<typename LookupKeyT >
static unsigned getHashValue (const LookupKeyT &Val)
 
static const KeyT getEmptyKey ()
 
static const KeyT getTombstoneKey ()
 

Detailed Description

template<typename KeyT, typename ValueT, unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
class llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >

Definition at line 942 of file DenseMap.h.

Constructor & Destructor Documentation

◆ SmallDenseMap() [1/5]

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::SmallDenseMap ( unsigned  NumInitBuckets = 0)
inlineexplicit

Definition at line 969 of file DenseMap.h.

References llvm::bit_ceil().

◆ SmallDenseMap() [2/5]

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::SmallDenseMap ( const SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT > &  other)
inline

Definition at line 975 of file DenseMap.h.

◆ SmallDenseMap() [3/5]

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::SmallDenseMap ( SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT > &&  other)
inline

Definition at line 980 of file DenseMap.h.

◆ SmallDenseMap() [4/5]

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
template<typename InputIt >
llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::SmallDenseMap ( const InputIt &  I,
const InputIt &  E 
)
inline

Definition at line 986 of file DenseMap.h.

References E, I, and llvm::NextPowerOf2().

◆ SmallDenseMap() [5/5]

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::SmallDenseMap ( std::initializer_list< typename BaseT::value_type Vals)
inline

Definition at line 991 of file DenseMap.h.

◆ ~SmallDenseMap()

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::~SmallDenseMap ( )
inline

Definition at line 994 of file DenseMap.h.

Member Function Documentation

◆ copyFrom()

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
void llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::copyFrom ( const SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT > &  other)
inline

Definition at line 1085 of file DenseMap.h.

◆ grow()

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
void llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::grow ( unsigned  AtLeast)
inline

Definition at line 1105 of file DenseMap.h.

References assert(), llvm::deallocate_buffer(), E, llvm::NextPowerOf2(), and P.

◆ init()

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
void llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::init ( unsigned  InitBuckets)
inline

Definition at line 1096 of file DenseMap.h.

◆ operator=() [1/2]

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
SmallDenseMap & llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::operator= ( const SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT > &  other)
inline

Definition at line 1071 of file DenseMap.h.

◆ operator=() [2/2]

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
SmallDenseMap & llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::operator= ( SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT > &&  other)
inline

Definition at line 1077 of file DenseMap.h.

◆ shrink_and_clear()

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
void llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::shrink_and_clear ( )
inline

Definition at line 1158 of file DenseMap.h.

References llvm::Log2_32_Ceil(), and llvm::size().

◆ swap()

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
void llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::swap ( SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT > &  RHS)
inline

Definition at line 999 of file DenseMap.h.

References RHS, and std::swap().

Friends And Related Function Documentation

◆ DenseMapBase< SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT >

template<typename KeyT , typename ValueT , unsigned InlineBuckets = 4, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
friend class DenseMapBase< SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT >
friend

Definition at line 926 of file DenseMap.h.


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