LLVM: llvm::MapVector< KeyT, ValueT, MapType, VectorType (original) (raw)

This class implements a map that also provides access to all stored values in a deterministic order. More...

#include "[llvm/ADT/MapVector.h](MapVector%5F8h%5Fsource.html)"

Inherited by llvm::SmallMapVector< Value *, SmallVector< Instruction *, 2 >, 8 >, and llvm::SmallMapVector< Instruction *, std::unique_ptr< RematNode >, 8 >.

Public Types
using key_type = KeyT
using value_type = typename VectorType::value_type
using size_type = typename VectorType::size_type
using iterator = typename VectorType::iterator
using const_iterator = typename VectorType::const_iterator
using reverse_iterator = typename VectorType::reverse_iterator
using const_reverse_iterator = typename VectorType::const_reverse_iterator
Public Member Functions
VectorType takeVector ()
Clear the MapVector and return the underlying vector.
ArrayRef< value_type > getArrayRef () const
Returns an array reference of the underlying vector.
size_type size () const
void reserve (size_type NumEntries)
Grow the MapVector so that it can contain at least NumEntries items before resizing again.
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const
bool empty () const
std::pair< KeyT, ValueT > & front ()
const std::pair< KeyT, ValueT > & front () const
std::pair< KeyT, ValueT > & back ()
const std::pair< KeyT, ValueT > & back () const
void clear ()
void swap (MapVector &RHS)
ValueT & operator[] (const KeyT &Key)
auto keys ()
auto keys () const
auto values ()
auto values () const
ValueT lookup (const KeyT &Key) const
template<typename... Ts>
std::pair< iterator, bool > try_emplace (const KeyT &Key, Ts &&...Args)
template<typename... Ts>
std::pair< iterator, bool > try_emplace (KeyT &&Key, Ts &&...Args)
std::pair< iterator, bool > insert (const std::pair< KeyT, ValueT > &KV)
std::pair< iterator, bool > insert (std::pair< KeyT, ValueT > &&KV)
template
std::pair< iterator, bool > insert_or_assign (const KeyT &Key, V &&Val)
template
std::pair< iterator, bool > insert_or_assign (KeyT &&Key, V &&Val)
bool contains (const KeyT &Key) const
size_type count (const KeyT &Key) const
iterator find (const KeyT &Key)
const_iterator find (const KeyT &Key) const
ValueT & at (const KeyT &Key)
at - Return the entry for the specified key, or abort if no such entry exists.
const ValueT & at (const KeyT &Key) const
at - Return the entry for the specified key, or abort if no such entry exists.
void pop_back ()
Remove the last element from the vector.
VectorType::iterator erase (typename VectorType::iterator Iterator)
Remove the element given by Iterator.
size_type erase (const KeyT &Key)
Remove all elements with the key value Key.
template<class Predicate>
void remove_if (Predicate Pred)
Remove the elements that match the predicate.
template<class Function>
void remove_if (Function Pred)

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>
class llvm::MapVector< KeyT, ValueT, MapType, VectorType >

This class implements a map that also provides access to all stored values in a deterministic order.

The values are kept in a SmallVector<*, 0> and the mapping is done with DenseMap from Keys to indexes in that vector.

Definition at line 36 of file MapVector.h.

const_iterator

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

const_reverse_iterator

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

iterator

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

key_type

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

reverse_iterator

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

size_type

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

value_type

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

at() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

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

Definition at line 166 of file MapVector.h.

at() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

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

Definition at line 174 of file MapVector.h.

back() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

back() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

begin() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

begin() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

clear()

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

contains()

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

count()

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

empty()

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

end() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

Definition at line 67 of file MapVector.h.

Referenced by llvm::ScheduleDAGInstrs::addChainDependencies(), checkFunctions(), checkInstructions(), checkVars(), computeBaseDerivedRelocateMap(), llvm::MapVector< StringRef, HashData >::erase(), findBasePointer(), llvm::ScheduleDAGInstrs::insertBarrierChain(), llvm::insertDebugValuesForPHIs(), llvm::sampleprof::SampleRecord::serialize(), llvm::sampleprof::serializeTypeMap(), and llvm::lto::thinBackend().

end() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

erase() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

Remove all elements with the key value Key.

Returns the number of elements removed.

Definition at line 213 of file MapVector.h.

erase() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

find() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

Definition at line 154 of file MapVector.h.

Referenced by llvm::ScheduleDAGInstrs::addChainDependencies(), llvm::InterleavedAccessInfo::analyzeInterleaving(), checkFunctions(), checkInstructions(), checkVars(), computeBaseDerivedRelocateMap(), llvm::MapVector< StringRef, HashData >::erase(), findBasePointer(), llvm::LoopVectorizationLegality::getIntOrFpInductionDescriptor(), llvm::LoopVectorizationLegality::getPointerInductionDescriptor(), llvm::insertDebugValuesForPHIs(), llvm::sampleprof::SampleRecord::serialize(), llvm::sampleprof::serializeTypeMap(), and llvm::lto::thinBackend().

find() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

front() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

front() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

getArrayRef()

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

Returns an array reference of the underlying vector.

Definition at line 54 of file MapVector.h.

insert() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

Definition at line 124 of file MapVector.h.

Referenced by addAllTypesFromDWP(), addAllTypesFromTypesSection(), llvm::checkDebugInfoMetadata(), collectCallSiteParameters(), llvm::collectDebugInfoMetadata(), llvm::LoopVectorizationCostModel::collectInstsToScalarize(), llvm::GEPOperator::collectOffset(), computeBaseDerivedRelocateMap(), findBasePointer(), foldCondBranchOnValueKnownInPredecessorImpl(), llvm::insertDebugValuesForPHIs(), and llvm::write().

insert() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

insert_or_assign() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

template

insert_or_assign() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

template

keys() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

keys() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

lookup()

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

operator[]()

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

pop_back()

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

Remove the last element from the vector.

Definition at line 181 of file MapVector.h.

rbegin() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

rbegin() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

remove_if() [1/2]

remove_if() [2/2]

Remove the elements that match the predicate.

Erase all elements that match Pred in a single pass. Takes linear time.

rend() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

rend() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

reserve()

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

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

Definition at line 60 of file MapVector.h.

size()

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

Definition at line 56 of file MapVector.h.

Referenced by checkConstLocationCompatible(), llvm::collectDebugInfoMetadata(), collectOffsets(), findBasePointer(), GEPToVectorIndex(), parseJumpTable(), llvm::AArch64TTIImpl::preferPredicateOverEpilogue(), shouldConvertToRelLookupTable(), tryToRecognizeTableBasedCttz(), llvm::writeIndex(), and llvm::writeMemProfFrameArray().

swap()

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

takeVector()

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

try_emplace() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

template<typename... Ts>

try_emplace() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

template<typename... Ts>

values() [1/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>

values() [2/2]

template<typename KeyT, typename ValueT, typename MapType = DenseMap<KeyT, unsigned>, typename VectorType = SmallVector<std::pair<KeyT, ValueT>, 0>>


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