LLVM 19.0.0git
Public Types | Public Member Functions | Friends | List of all members
llvm::ValueMap< KeyT, ValueT, Config > Class Template Reference

See the file comment. More...

#include "llvm/IR/ValueMap.h"

Inheritance diagram for llvm::ValueMap< KeyT, ValueT, Config >:
Inheritance graph
[legend]

Public Types

using key_type = KeyT
 
using mapped_type = ValueT
 
using value_type = std::pair< KeyT, ValueT >
 
using size_type = unsigned
 
using iterator = ValueMapIterator< MapT, KeyT >
 
using const_iterator = ValueMapConstIterator< MapT, KeyT >
 

Public Member Functions

 ValueMap (unsigned NumInitBuckets=64)
 
 ValueMap (const ExtraData &Data, unsigned NumInitBuckets=64)
 
 ValueMap (const ValueMap &)=delete
 
 ValueMap (ValueMap &&)=delete
 
ValueMapoperator= (const ValueMap &)=delete
 
ValueMapoperator= (ValueMap &&)=delete
 
bool hasMD () const
 
MDMapTMD ()
 
std::optional< MDMapT > & getMDMap ()
 
std::optional< Metadata * > getMappedMD (const Metadata *MD) const
 Get the mapped metadata, if it's in the map.
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
bool empty () const
 
size_type size () const
 
void reserve (size_t Size)
 Grow the map so that it has at least Size buckets. Does not shrink.
 
void clear ()
 
size_type count (const KeyT &Val) const
 Return 1 if the specified key is in the map, 0 otherwise.
 
iterator find (const KeyT &Val)
 
const_iterator find (const KeyT &Val) const
 
ValueT lookup (const KeyT &Val) const
 lookup - Return the entry for the specified key, or a default constructed value 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 InputIt >
void insert (InputIt I, InputIt E)
 insert - Range insertion of pairs.
 
bool erase (const KeyT &Val)
 
void erase (iterator I)
 
value_typeFindAndConstruct (const KeyT &Key)
 
ValueToperator[] (const KeyT &Key)
 
bool isPointerIntoBucketsArray (const void *Ptr) const
 isPointerIntoBucketsArray - Return true if the specified pointer points somewhere into the ValueMap's array of buckets (i.e.
 
const void * getPointerIntoBucketsArray () const
 getPointerIntoBucketsArray() - Return an opaque pointer into the buckets array.
 

Friends

class ValueMapCallbackVH< KeyT, ValueT, Config >
 

Detailed Description

template<typename KeyT, typename ValueT, typename Config = ValueMapConfig<KeyT>>
class llvm::ValueMap< KeyT, ValueT, Config >

See the file comment.

Definition at line 84 of file ValueMap.h.

Member Typedef Documentation

◆ const_iterator

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
using llvm::ValueMap< KeyT, ValueT, Config >::const_iterator = ValueMapConstIterator<MapT, KeyT>

Definition at line 132 of file ValueMap.h.

◆ iterator

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
using llvm::ValueMap< KeyT, ValueT, Config >::iterator = ValueMapIterator<MapT, KeyT>

Definition at line 131 of file ValueMap.h.

◆ key_type

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
using llvm::ValueMap< KeyT, ValueT, Config >::key_type = KeyT

Definition at line 97 of file ValueMap.h.

◆ mapped_type

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
using llvm::ValueMap< KeyT, ValueT, Config >::mapped_type = ValueT

Definition at line 98 of file ValueMap.h.

◆ size_type

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
using llvm::ValueMap< KeyT, ValueT, Config >::size_type = unsigned

Definition at line 100 of file ValueMap.h.

◆ value_type

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
using llvm::ValueMap< KeyT, ValueT, Config >::value_type = std::pair<KeyT, ValueT>

Definition at line 99 of file ValueMap.h.

Constructor & Destructor Documentation

◆ ValueMap() [1/4]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
llvm::ValueMap< KeyT, ValueT, Config >::ValueMap ( unsigned  NumInitBuckets = 64)
inlineexplicit

Definition at line 102 of file ValueMap.h.

◆ ValueMap() [2/4]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
llvm::ValueMap< KeyT, ValueT, Config >::ValueMap ( const ExtraData &  Data,
unsigned  NumInitBuckets = 64 
)
inlineexplicit

Definition at line 104 of file ValueMap.h.

◆ ValueMap() [3/4]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
llvm::ValueMap< KeyT, ValueT, Config >::ValueMap ( const ValueMap< KeyT, ValueT, Config > &  )
delete

◆ ValueMap() [4/4]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
llvm::ValueMap< KeyT, ValueT, Config >::ValueMap ( ValueMap< KeyT, ValueT, Config > &&  )
delete

Member Function Documentation

◆ begin() [1/2]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
iterator llvm::ValueMap< KeyT, ValueT, Config >::begin ( )
inline

Definition at line 134 of file ValueMap.h.

Referenced by AddAliasScopeMetadata(), llvm::UnrollAndJamLoop(), and llvm::UnrollLoop().

◆ begin() [2/2]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
const_iterator llvm::ValueMap< KeyT, ValueT, Config >::begin ( ) const
inline

Definition at line 136 of file ValueMap.h.

◆ clear()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
void llvm::ValueMap< KeyT, ValueT, Config >::clear ( )
inline

◆ count()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
size_type llvm::ValueMap< KeyT, ValueT, Config >::count ( const KeyT Val) const
inline

◆ empty()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
bool llvm::ValueMap< KeyT, ValueT, Config >::empty ( ) const
inline

Definition at line 139 of file ValueMap.h.

◆ end() [1/2]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
iterator llvm::ValueMap< KeyT, ValueT, Config >::end ( )
inline

◆ end() [2/2]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
const_iterator llvm::ValueMap< KeyT, ValueT, Config >::end ( ) const
inline

Definition at line 137 of file ValueMap.h.

◆ erase() [1/2]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
bool llvm::ValueMap< KeyT, ValueT, Config >::erase ( const KeyT Val)
inline

Definition at line 190 of file ValueMap.h.

References I.

Referenced by CloneLoopBlocks(), llvm::GlobalNumberState::erase(), and llvm::ValueEnumerator::purgeFunction().

◆ erase() [2/2]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
void llvm::ValueMap< KeyT, ValueT, Config >::erase ( iterator  I)
inline

Definition at line 198 of file ValueMap.h.

References I.

◆ find() [1/2]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
iterator llvm::ValueMap< KeyT, ValueT, Config >::find ( const KeyT Val)
inline

◆ find() [2/2]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
const_iterator llvm::ValueMap< KeyT, ValueT, Config >::find ( const KeyT Val) const
inline

Definition at line 158 of file ValueMap.h.

◆ FindAndConstruct()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
value_type & llvm::ValueMap< KeyT, ValueT, Config >::FindAndConstruct ( const KeyT Key)
inline

Definition at line 202 of file ValueMap.h.

◆ getMappedMD()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
std::optional< Metadata * > llvm::ValueMap< KeyT, ValueT, Config >::getMappedMD ( const Metadata MD) const
inline

Get the mapped metadata, if it's in the map.

Definition at line 122 of file ValueMap.h.

References llvm::ValueMap< KeyT, ValueT, Config >::MD().

◆ getMDMap()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
std::optional< MDMapT > & llvm::ValueMap< KeyT, ValueT, Config >::getMDMap ( )
inline

Definition at line 119 of file ValueMap.h.

◆ getPointerIntoBucketsArray()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
const void * llvm::ValueMap< KeyT, ValueT, Config >::getPointerIntoBucketsArray ( ) const
inline

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 ValueMap to reallocate.

Definition at line 220 of file ValueMap.h.

◆ hasMD()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
bool llvm::ValueMap< KeyT, ValueT, Config >::hasMD ( ) const
inline

Definition at line 113 of file ValueMap.h.

◆ insert() [1/3]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
std::pair< iterator, bool > llvm::ValueMap< KeyT, ValueT, Config >::insert ( const std::pair< KeyT, ValueT > &  KV)
inline

◆ insert() [2/3]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
template<typename InputIt >
void llvm::ValueMap< KeyT, ValueT, Config >::insert ( InputIt  I,
InputIt  E 
)
inline

insert - Range insertion of pairs.

Definition at line 185 of file ValueMap.h.

References E, I, and llvm::ValueMap< KeyT, ValueT, Config >::insert().

◆ insert() [3/3]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
std::pair< iterator, bool > llvm::ValueMap< KeyT, ValueT, Config >::insert ( std::pair< KeyT, ValueT > &&  KV)
inline

Definition at line 177 of file ValueMap.h.

◆ isPointerIntoBucketsArray()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
bool llvm::ValueMap< KeyT, ValueT, Config >::isPointerIntoBucketsArray ( const void *  Ptr) const
inline

isPointerIntoBucketsArray - Return true if the specified pointer points somewhere into the ValueMap's array of buckets (i.e.

either to a key or value in the ValueMap).

Definition at line 213 of file ValueMap.h.

References Ptr.

◆ lookup()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
ValueT llvm::ValueMap< KeyT, ValueT, Config >::lookup ( const KeyT Val) const
inline

◆ MD()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
MDMapT & llvm::ValueMap< KeyT, ValueT, Config >::MD ( )
inline

◆ operator=() [1/2]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
ValueMap & llvm::ValueMap< KeyT, ValueT, Config >::operator= ( const ValueMap< KeyT, ValueT, Config > &  )
delete

◆ operator=() [2/2]

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
ValueMap & llvm::ValueMap< KeyT, ValueT, Config >::operator= ( ValueMap< KeyT, ValueT, Config > &&  )
delete

◆ operator[]()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
ValueT & llvm::ValueMap< KeyT, ValueT, Config >::operator[] ( const KeyT Key)
inline

Definition at line 206 of file ValueMap.h.

◆ reserve()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
void llvm::ValueMap< KeyT, ValueT, Config >::reserve ( size_t  Size)
inline

Grow the map so that it has at least Size buckets. Does not shrink.

Definition at line 143 of file ValueMap.h.

References Size.

◆ size()

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
size_type llvm::ValueMap< KeyT, ValueT, Config >::size ( ) const
inline

Definition at line 140 of file ValueMap.h.

Referenced by llvm::insertDebugValuesForPHIs().

Friends And Related Function Documentation

◆ ValueMapCallbackVH< KeyT, ValueT, Config >

template<typename KeyT , typename ValueT , typename Config = ValueMapConfig<KeyT>>
friend class ValueMapCallbackVH< KeyT, ValueT, Config >
friend

Definition at line 79 of file ValueMap.h.


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