class MapVector

Declaration

template <typename KeyT,
          typename ValueT,
          typename MapType = DenseMap<KeyT, unsigned int>,
          typename VectorType = std::vector<std::pair<KeyT, ValueT>>>
class MapVector { /* full declaration omitted */ };

Description

This class implements a map that also provides access to all stored values in a deterministic order. The values are kept in a std::vector and the mapping is done with DenseMap from Keys to indexes in that vector.

Declared at: llvm/include/llvm/ADT/MapVector.h:37

Templates

KeyT
ValueT
MapType = DenseMap<KeyT, unsigned int>
VectorType = std::vector<std::pair<KeyT, ValueT>>

Method Overview

  • public const std::pair<KeyT, ValueT> & back() const
  • public std::pair<KeyT, ValueT> & back()
  • public llvm::MapVector::iterator begin()
  • public llvm::MapVector::const_iterator begin() const
  • public void clear()
  • public llvm::MapVector::size_type count(const KeyT & Key) const
  • public bool empty() const
  • public llvm::MapVector::const_iterator end() const
  • public llvm::MapVector::iterator end()
  • public typename VectorType::iterator erase(typename VectorType::iterator Iterator)
  • public llvm::MapVector::size_type erase(const KeyT & Key)
  • public llvm::MapVector::const_iterator find(const KeyT & Key) const
  • public llvm::MapVector::iterator find(const KeyT & Key)
  • public std::pair<KeyT, ValueT> & front()
  • public const std::pair<KeyT, ValueT> & front() const
  • public std::pair<iterator, bool> insert(const std::pair<KeyT, ValueT> & KV)
  • public std::pair<iterator, bool> insert(std::pair<KeyT, ValueT> && KV)
  • public ValueT lookup(const KeyT & Key) const
  • public void pop_back()
  • public llvm::MapVector::reverse_iterator rbegin()
  • public llvm::MapVector::const_reverse_iterator rbegin() const
  • public template <class Predicate>void remove_if(Predicate Pred)
  • public llvm::MapVector::const_reverse_iterator rend() const
  • public llvm::MapVector::reverse_iterator rend()
  • public void reserve(llvm::MapVector::size_type NumEntries)
  • public llvm::MapVector::size_type size() const
  • public void swap(MapVector<KeyT, ValueT, MapType, VectorType> & RHS)
  • public VectorType takeVector()

Methods

const std::pair<KeyT, ValueT>& back() const

Declared at: llvm/include/llvm/ADT/MapVector.h:86

std::pair<KeyT, ValueT>& back()

Declared at: llvm/include/llvm/ADT/MapVector.h:85

llvm::MapVector::iterator begin()

Declared at: llvm/include/llvm/ADT/MapVector.h:69

llvm::MapVector::const_iterator begin() const

Declared at: llvm/include/llvm/ADT/MapVector.h:70

void clear()

Declared at: llvm/include/llvm/ADT/MapVector.h:88

llvm::MapVector::size_type count(
    const KeyT& Key) const

Declared at: llvm/include/llvm/ADT/MapVector.h:142

Parameters

const KeyT& Key

bool empty() const

Declared at: llvm/include/llvm/ADT/MapVector.h:79

llvm::MapVector::const_iterator end() const

Declared at: llvm/include/llvm/ADT/MapVector.h:72

llvm::MapVector::iterator end()

Declared at: llvm/include/llvm/ADT/MapVector.h:71

typename VectorType::iterator erase(
    typename VectorType::iterator Iterator)

Description

Remove the element given by Iterator. Returns an iterator to the element following the one which was removed, which may be end().

Declared at: llvm/include/llvm/ADT/MapVector.h:173

Parameters

typename VectorType::iterator Iterator

llvm::MapVector::size_type erase(const KeyT& Key)

Description

Remove all elements with the key value Key. Returns the number of elements removed.

Declared at: llvm/include/llvm/ADT/MapVector.h:192

Parameters

const KeyT& Key

llvm::MapVector::const_iterator find(
    const KeyT& Key) const

Declared at: llvm/include/llvm/ADT/MapVector.h:153

Parameters

const KeyT& Key

llvm::MapVector::iterator find(const KeyT& Key)

Declared at: llvm/include/llvm/ADT/MapVector.h:147

Parameters

const KeyT& Key

std::pair<KeyT, ValueT>& front()

Declared at: llvm/include/llvm/ADT/MapVector.h:83

const std::pair<KeyT, ValueT>& front() const

Declared at: llvm/include/llvm/ADT/MapVector.h:84

std::pair<iterator, bool> insert(
    const std::pair<KeyT, ValueT>& KV)

Declared at: llvm/include/llvm/ADT/MapVector.h:117

Parameters

const std::pair<KeyT, ValueT>& KV

std::pair<iterator, bool> insert(
    std::pair<KeyT, ValueT>&& KV)

Declared at: llvm/include/llvm/ADT/MapVector.h:129

Parameters

std::pair<KeyT, ValueT>&& KV

ValueT lookup(const KeyT& Key) const

Declared at: llvm/include/llvm/ADT/MapVector.h:110

Parameters

const KeyT& Key

void pop_back()

Description

Remove the last element from the vector.

Declared at: llvm/include/llvm/ADT/MapVector.h:160

llvm::MapVector::reverse_iterator rbegin()

Declared at: llvm/include/llvm/ADT/MapVector.h:74

llvm::MapVector::const_reverse_iterator rbegin()
    const

Declared at: llvm/include/llvm/ADT/MapVector.h:75

template <class Predicate>
void remove_if(Predicate Pred)

Description

Remove the elements that match the predicate. Erase all elements that match \c Pred in a single pass. Takes linear time.

Declared at: llvm/include/llvm/ADT/MapVector.h:204

Templates

Predicate

Parameters

Predicate Pred

llvm::MapVector::const_reverse_iterator rend()
    const

Declared at: llvm/include/llvm/ADT/MapVector.h:77

llvm::MapVector::reverse_iterator rend()

Declared at: llvm/include/llvm/ADT/MapVector.h:76

void reserve(
    llvm::MapVector::size_type NumEntries)

Description

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

Declared at: llvm/include/llvm/ADT/MapVector.h:64

Parameters

llvm::MapVector::size_type NumEntries

llvm::MapVector::size_type size() const

Declared at: llvm/include/llvm/ADT/MapVector.h:60

void swap(
    MapVector<KeyT, ValueT, MapType, VectorType>&
        RHS)

Declared at: llvm/include/llvm/ADT/MapVector.h:93

Parameters

MapVector<KeyT, ValueT, MapType, VectorType>& RHS

VectorType takeVector()

Description

Clear the MapVector and return the underlying vector.

Declared at: llvm/include/llvm/ADT/MapVector.h:55