LLVM  3.7.0
Public Types | Public Member Functions | List of all members
llvm::MapVector< KeyT, ValueT, MapType, VectorType > Class Template Reference

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

#include <MapVector.h>

Inheritance diagram for llvm::MapVector< KeyT, ValueT, MapType, VectorType >:
[legend]

Public Types

typedef VectorType::iterator iterator
 
typedef VectorType::const_iterator const_iterator
 
typedef
VectorType::reverse_iterator 
reverse_iterator
 
typedef
VectorType::const_reverse_iterator 
const_reverse_iterator
 

Public Member Functions

size_type size () const
 
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)
 
ValueT lookup (const KeyT &Key) const
 
std::pair< iterator, boolinsert (const std::pair< KeyT, ValueT > &KV)
 
size_type count (const KeyT &Key) const
 
iterator find (const KeyT &Key)
 
const_iterator find (const KeyT &Key) const
 
void pop_back ()
 Remove the last element from the vector. More...
 
VectorType::iterator erase (typename VectorType::iterator Iterator)
 Remove the element given by Iterator. More...
 
size_type erase (const KeyT &Key)
 Remove all elements with the key value Key. More...
 
template<class Predicate >
void remove_if (Predicate Pred)
 Remove the elements that match the predicate. More...
 
template<class Function >
void remove_if (Function Pred)
 

Detailed Description

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
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 std::vector and the mapping is done with DenseMap from Keys to indexes in that vector.

Definition at line 32 of file MapVector.h.

Member Typedef Documentation

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
typedef VectorType::const_iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::const_iterator

Definition at line 40 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
typedef VectorType::const_reverse_iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::const_reverse_iterator

Definition at line 42 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
typedef VectorType::iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::iterator

Definition at line 39 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
typedef VectorType::reverse_iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::reverse_iterator

Definition at line 41 of file MapVector.h.

Member Function Documentation

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
std::pair<KeyT, ValueT>& llvm::MapVector< KeyT, ValueT, MapType, VectorType >::back ( )
inline

Definition at line 62 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
const std::pair<KeyT, ValueT>& llvm::MapVector< KeyT, ValueT, MapType, VectorType >::back ( ) const
inline

Definition at line 63 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::begin ( )
inline
template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
const_iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::begin ( ) const
inline

Definition at line 47 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
void llvm::MapVector< KeyT, ValueT, MapType, VectorType >::clear ( )
inline
template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
size_type llvm::MapVector< KeyT, ValueT, MapType, VectorType >::count ( const KeyT &  Key) const
inline

Definition at line 103 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
bool llvm::MapVector< KeyT, ValueT, MapType, VectorType >::empty ( ) const
inline

Definition at line 56 of file MapVector.h.

Referenced by llvm::DbgValueHistoryMap::empty().

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::end ( )
inline
template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
const_iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::end ( ) const
inline

Definition at line 49 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
VectorType::iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::erase ( typename VectorType::iterator  Iterator)
inline

Remove the element given by Iterator.

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

Note
This is a deceivingly expensive operation (linear time). It's usually better to use remove_if() if possible.

Definition at line 134 of file MapVector.h.

Referenced by llvm::MapVector< InlinedVariable, InstrRanges >::erase().

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
size_type llvm::MapVector< KeyT, ValueT, MapType, VectorType >::erase ( const KeyT &  Key)
inline

Remove all elements with the key value Key.

Returns the number of elements removed.

Definition at line 153 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::find ( const KeyT &  Key)
inline
template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
const_iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::find ( const KeyT &  Key) const
inline

Definition at line 114 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
std::pair<KeyT, ValueT>& llvm::MapVector< KeyT, ValueT, MapType, VectorType >::front ( )
inline

Definition at line 60 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
const std::pair<KeyT, ValueT>& llvm::MapVector< KeyT, ValueT, MapType, VectorType >::front ( ) const
inline

Definition at line 61 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
std::pair<iterator, bool> llvm::MapVector< KeyT, ValueT, MapType, VectorType >::insert ( const std::pair< KeyT, ValueT > &  KV)
inline

Definition at line 91 of file MapVector.h.

Referenced by llvm::FileInfo::print().

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
ValueT llvm::MapVector< KeyT, ValueT, MapType, VectorType >::lookup ( const KeyT &  Key) const
inline

Definition at line 86 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
ValueT& llvm::MapVector< KeyT, ValueT, MapType, VectorType >::operator[] ( const KeyT &  Key)
inline

Definition at line 75 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
void llvm::MapVector< KeyT, ValueT, MapType, VectorType >::pop_back ( )
inline

Remove the last element from the vector.

Definition at line 121 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
reverse_iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::rbegin ( )
inline

Definition at line 51 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
const_reverse_iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::rbegin ( ) const
inline

Definition at line 52 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
template<class Predicate >
void llvm::MapVector< KeyT, ValueT, MapType, VectorType >::remove_if ( Predicate  Pred)

Remove the elements that match the predicate.

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

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
template<class Function >
void llvm::MapVector< KeyT, ValueT, MapType, VectorType >::remove_if ( Function  Pred)

Definition at line 170 of file MapVector.h.

References I.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
reverse_iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::rend ( )
inline

Definition at line 53 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
const_reverse_iterator llvm::MapVector< KeyT, ValueT, MapType, VectorType >::rend ( ) const
inline

Definition at line 54 of file MapVector.h.

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
size_type llvm::MapVector< KeyT, ValueT, MapType, VectorType >::size ( ) const
inline

Definition at line 44 of file MapVector.h.

Referenced by llvm::ScheduleDAGInstrs::buildSchedGraph().

template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> >>
void llvm::MapVector< KeyT, ValueT, MapType, VectorType >::swap ( MapVector< KeyT, ValueT, MapType, VectorType > &  RHS)
inline

Definition at line 70 of file MapVector.h.


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