LLVM 22.0.0git
Public Member Functions | Friends | List of all members
llvm::DenseMap< KeyT, ValueT, KeyInfoT, BucketT > Class Template Reference

#include "llvm/ADT/DenseMap.h"

Inherits llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >.

Public Member Functions

 DenseMap (unsigned InitialReserve=0)
 Create a DenseMap with an optional InitialReserve that guarantee that this number of elements can be inserted in the map without grow()
 
 DenseMap (const DenseMap &other)
 
 DenseMap (DenseMap &&other)
 
template<typename InputIt >
 DenseMap (const InputIt &I, const InputIt &E)
 
template<typename RangeT >
 DenseMap (llvm::from_range_t, const RangeT &Range)
 
 DenseMap (std::initializer_list< typename BaseT::value_type > Vals)
 
 ~DenseMap ()
 
void swap (DenseMap &RHS)
 
DenseMapoperator= (const DenseMap &other)
 
DenseMapoperator= (DenseMap &&other)
 
void copyFrom (const DenseMap &other)
 
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
 
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 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 Range >
void insert_range (Range &&R)
 Inserts range of 'std::pair<KeyT, ValueT>' values into the map.
 
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)
 
template<typename... Ts>
std::pair< iterator, boolemplace_or_assign (const KeyT &Key, Ts &&...Args)
 
template<typename... Ts>
std::pair< iterator, boolemplace_or_assign (KeyT &&Key, Ts &&...Args)
 
bool erase (const KeyT &Val)
 
void erase (iterator I)
 
ValueToperator[] (const 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< DenseMap, 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 (iterator_range< BucketT * > OldBuckets)
 
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, typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
class llvm::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >

Definition at line 729 of file DenseMap.h.

Constructor & Destructor Documentation

◆ DenseMap() [1/6]

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
llvm::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::DenseMap ( unsigned  InitialReserve = 0)
inlineexplicit

Create a DenseMap with an optional InitialReserve that guarantee that this number of elements can be inserted in the map without grow()

Definition at line 745 of file DenseMap.h.

◆ DenseMap() [2/6]

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

◆ DenseMap() [3/6]

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

◆ DenseMap() [4/6]

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

◆ DenseMap() [5/6]

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
template<typename RangeT >
llvm::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::DenseMap ( llvm::from_range_t  ,
const RangeT &  Range 
)
inline

Definition at line 763 of file DenseMap.h.

◆ DenseMap() [6/6]

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

Definition at line 766 of file DenseMap.h.

◆ ~DenseMap()

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
llvm::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::~DenseMap ( )
inline

Member Function Documentation

◆ copyFrom()

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

◆ grow()

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ shrink_and_clear()

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

◆ swap()

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

Friends And Related Function Documentation

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

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
friend class DenseMapBase< DenseMap, KeyT, ValueT, KeyInfoT, BucketT >
friend

Definition at line 689 of file DenseMap.h.


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