LLVM 19.0.0git
Public Types | Public Member Functions | List of all members
llvm::TinyPtrVector< EltTy > Class Template Reference

TinyPtrVector - This class is specialized for cases where there are normally 0 or 1 element in a vector, but is general enough to go beyond that when required. More...

#include "llvm/ADT/TinyPtrVector.h"

Inheritance diagram for llvm::TinyPtrVector< EltTy >:
Inheritance graph
[legend]

Public Types

using VecTy = SmallVector< EltTy, 4 >
 
using value_type = typename VecTy::value_type
 
using PtrUnion = PointerUnion< EltTy, VecTy * >
 
using iterator = EltTy *
 
using const_iterator = const EltTy *
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 

Public Member Functions

 TinyPtrVector ()=default
 
 ~TinyPtrVector ()
 
 TinyPtrVector (const TinyPtrVector &RHS)
 
TinyPtrVectoroperator= (const TinyPtrVector &RHS)
 
 TinyPtrVector (TinyPtrVector &&RHS)
 
TinyPtrVectoroperator= (TinyPtrVector &&RHS)
 
 TinyPtrVector (std::initializer_list< EltTy > IL)
 
 TinyPtrVector (ArrayRef< EltTy > Elts)
 Constructor from an ArrayRef.
 
 TinyPtrVector (size_t Count, EltTy Value)
 
 operator ArrayRef< EltTy > () const
 
 operator MutableArrayRef< EltTy > ()
 
template<typename U , std::enable_if_t< std::is_convertible< ArrayRef< EltTy >, ArrayRef< U > >::value, bool > = false>
 operator ArrayRef< U > () const
 
bool empty () const
 
unsigned size () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
EltTy operator[] (unsigned i) const
 
EltTy front () const
 
EltTy back () const
 
void push_back (EltTy NewVal)
 
void pop_back ()
 
void clear ()
 
iterator erase (iterator I)
 
iterator erase (iterator S, iterator E)
 
iterator insert (iterator I, const EltTy &Elt)
 
template<typename ItTy >
iterator insert (iterator I, ItTy From, ItTy To)
 

Detailed Description

template<typename EltTy>
class llvm::TinyPtrVector< EltTy >

TinyPtrVector - This class is specialized for cases where there are normally 0 or 1 element in a vector, but is general enough to go beyond that when required.

NOTE: This container doesn't allow you to store a null pointer into it.

Definition at line 29 of file TinyPtrVector.h.

Member Typedef Documentation

◆ const_iterator

template<typename EltTy >
using llvm::TinyPtrVector< EltTy >::const_iterator = const EltTy *

Definition at line 180 of file TinyPtrVector.h.

◆ const_reverse_iterator

template<typename EltTy >
using llvm::TinyPtrVector< EltTy >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 182 of file TinyPtrVector.h.

◆ iterator

template<typename EltTy >
using llvm::TinyPtrVector< EltTy >::iterator = EltTy *

Definition at line 179 of file TinyPtrVector.h.

◆ PtrUnion

template<typename EltTy >
using llvm::TinyPtrVector< EltTy >::PtrUnion = PointerUnion<EltTy, VecTy *>

Definition at line 37 of file TinyPtrVector.h.

◆ reverse_iterator

template<typename EltTy >
using llvm::TinyPtrVector< EltTy >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 181 of file TinyPtrVector.h.

◆ value_type

template<typename EltTy >
using llvm::TinyPtrVector< EltTy >::value_type = typename VecTy::value_type

Definition at line 32 of file TinyPtrVector.h.

◆ VecTy

template<typename EltTy >
using llvm::TinyPtrVector< EltTy >::VecTy = SmallVector<EltTy, 4>

Definition at line 31 of file TinyPtrVector.h.

Constructor & Destructor Documentation

◆ TinyPtrVector() [1/6]

template<typename EltTy >
llvm::TinyPtrVector< EltTy >::TinyPtrVector ( )
default

◆ ~TinyPtrVector()

template<typename EltTy >
llvm::TinyPtrVector< EltTy >::~TinyPtrVector ( )
inline

Definition at line 45 of file TinyPtrVector.h.

◆ TinyPtrVector() [2/6]

template<typename EltTy >
llvm::TinyPtrVector< EltTy >::TinyPtrVector ( const TinyPtrVector< EltTy > &  RHS)
inline

Definition at line 50 of file TinyPtrVector.h.

◆ TinyPtrVector() [3/6]

template<typename EltTy >
llvm::TinyPtrVector< EltTy >::TinyPtrVector ( TinyPtrVector< EltTy > &&  RHS)
inline

Definition at line 83 of file TinyPtrVector.h.

References RHS.

◆ TinyPtrVector() [4/6]

template<typename EltTy >
llvm::TinyPtrVector< EltTy >::TinyPtrVector ( std::initializer_list< EltTy >  IL)
inline

Definition at line 113 of file TinyPtrVector.h.

◆ TinyPtrVector() [5/6]

template<typename EltTy >
llvm::TinyPtrVector< EltTy >::TinyPtrVector ( ArrayRef< EltTy >  Elts)
inlineexplicit

Constructor from an ArrayRef.

This also is a constructor for individual array elements due to the single element constructor for ArrayRef.

Definition at line 123 of file TinyPtrVector.h.

◆ TinyPtrVector() [6/6]

template<typename EltTy >
llvm::TinyPtrVector< EltTy >::TinyPtrVector ( size_t  Count,
EltTy  Value 
)
inline

Definition at line 130 of file TinyPtrVector.h.

Member Function Documentation

◆ back()

template<typename EltTy >
EltTy llvm::TinyPtrVector< EltTy >::back ( ) const
inline

Definition at line 235 of file TinyPtrVector.h.

References assert(), and llvm::TinyPtrVector< EltTy >::empty().

◆ begin() [1/2]

template<typename EltTy >
iterator llvm::TinyPtrVector< EltTy >::begin ( )
inline

◆ begin() [2/2]

template<typename EltTy >
const_iterator llvm::TinyPtrVector< EltTy >::begin ( ) const
inline

Definition at line 198 of file TinyPtrVector.h.

References llvm::TinyPtrVector< EltTy >::begin().

◆ clear()

template<typename EltTy >
void llvm::TinyPtrVector< EltTy >::clear ( )
inline

◆ empty()

template<typename EltTy >
bool llvm::TinyPtrVector< EltTy >::empty ( ) const
inline

◆ end() [1/2]

template<typename EltTy >
iterator llvm::TinyPtrVector< EltTy >::end ( )
inline

◆ end() [2/2]

template<typename EltTy >
const_iterator llvm::TinyPtrVector< EltTy >::end ( ) const
inline

Definition at line 202 of file TinyPtrVector.h.

References llvm::TinyPtrVector< EltTy >::end().

◆ erase() [1/2]

template<typename EltTy >
iterator llvm::TinyPtrVector< EltTy >::erase ( iterator  I)
inline

◆ erase() [2/2]

template<typename EltTy >
iterator llvm::TinyPtrVector< EltTy >::erase ( iterator  S,
iterator  E 
)
inline

◆ front()

template<typename EltTy >
EltTy llvm::TinyPtrVector< EltTy >::front ( ) const
inline

◆ insert() [1/2]

template<typename EltTy >
iterator llvm::TinyPtrVector< EltTy >::insert ( iterator  I,
const EltTy &  Elt 
)
inline

◆ insert() [2/2]

template<typename EltTy >
template<typename ItTy >
iterator llvm::TinyPtrVector< EltTy >::insert ( iterator  I,
ItTy  From,
ItTy  To 
)
inline

◆ operator ArrayRef< EltTy >()

template<typename EltTy >
llvm::TinyPtrVector< EltTy >::operator ArrayRef< EltTy > ( ) const
inline

◆ operator ArrayRef< U >()

template<typename EltTy >
template<typename U , std::enable_if_t< std::is_convertible< ArrayRef< EltTy >, ArrayRef< U > >::value, bool > = false>
llvm::TinyPtrVector< EltTy >::operator ArrayRef< U > ( ) const
inline

Definition at line 158 of file TinyPtrVector.h.

◆ operator MutableArrayRef< EltTy >()

template<typename EltTy >
llvm::TinyPtrVector< EltTy >::operator MutableArrayRef< EltTy > ( )
inline

◆ operator=() [1/2]

template<typename EltTy >
TinyPtrVector & llvm::TinyPtrVector< EltTy >::operator= ( const TinyPtrVector< EltTy > &  RHS)
inline

Definition at line 55 of file TinyPtrVector.h.

References llvm::TinyPtrVector< EltTy >::clear(), and RHS.

◆ operator=() [2/2]

template<typename EltTy >
TinyPtrVector & llvm::TinyPtrVector< EltTy >::operator= ( TinyPtrVector< EltTy > &&  RHS)
inline

Definition at line 87 of file TinyPtrVector.h.

References llvm::TinyPtrVector< EltTy >::clear(), and RHS.

◆ operator[]()

template<typename EltTy >
EltTy llvm::TinyPtrVector< EltTy >::operator[] ( unsigned  i) const
inline

◆ pop_back()

template<typename EltTy >
void llvm::TinyPtrVector< EltTy >::pop_back ( )
inline

Definition at line 261 of file TinyPtrVector.h.

◆ push_back()

template<typename EltTy >
void llvm::TinyPtrVector< EltTy >::push_back ( EltTy  NewVal)
inline

◆ rbegin() [1/2]

template<typename EltTy >
reverse_iterator llvm::TinyPtrVector< EltTy >::rbegin ( )
inline

Definition at line 206 of file TinyPtrVector.h.

References llvm::TinyPtrVector< EltTy >::end().

◆ rbegin() [2/2]

template<typename EltTy >
const_reverse_iterator llvm::TinyPtrVector< EltTy >::rbegin ( ) const
inline

Definition at line 209 of file TinyPtrVector.h.

References llvm::TinyPtrVector< EltTy >::end().

◆ rend() [1/2]

template<typename EltTy >
reverse_iterator llvm::TinyPtrVector< EltTy >::rend ( )
inline

Definition at line 207 of file TinyPtrVector.h.

References llvm::TinyPtrVector< EltTy >::begin().

◆ rend() [2/2]

template<typename EltTy >
const_reverse_iterator llvm::TinyPtrVector< EltTy >::rend ( ) const
inline

Definition at line 213 of file TinyPtrVector.h.

References llvm::TinyPtrVector< EltTy >::begin().

◆ size()

template<typename EltTy >
unsigned llvm::TinyPtrVector< EltTy >::size ( ) const
inline

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