LLVM  14.0.0git
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
llvm::SmallVectorTemplateCommon< T, typename > Class Template Reference

This is the part of SmallVectorTemplateBase which does not depend on whether the type T is a POD. More...

#include "llvm/ADT/SmallVector.h"

Inheritance diagram for llvm::SmallVectorTemplateCommon< T, typename >:
Inheritance graph
[legend]
Collaboration diagram for llvm::SmallVectorTemplateCommon< T, typename >:
Collaboration graph
[legend]

Public Types

using size_type = size_t
 
using difference_type = ptrdiff_t
 
using value_type = T
 
using iterator = T *
 
using const_iterator = const T *
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using reference = T &
 
using const_reference = const T &
 
using pointer = T *
 
using const_pointer = const T *
 

Public Member Functions

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
 
size_type size_in_bytes () const
 
size_type max_size () const
 
size_t capacity_in_bytes () const
 
pointer data ()
 Return a pointer to the vector's buffer, even if empty(). More...
 
const_pointer data () const
 Return a pointer to the vector's buffer, even if empty(). More...
 
reference operator[] (size_type idx)
 
const_reference operator[] (size_type idx) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
- Public Member Functions inherited from llvm::SmallVectorBase< SmallVectorSizeType< T > >
size_t size () const
 
size_t capacity () const
 
LLVM_NODISCARD bool empty () const
 
void set_size (size_t N)
 Set the array size to N, which the current array must have enough capacity for. More...
 

Protected Member Functions

 SmallVectorTemplateCommon (size_t Size)
 
void grow_pod (size_t MinSize, size_t TSize)
 
bool isSmall () const
 Return true if this is a smallvector which has not had dynamic memory allocated for it. More...
 
void resetToSmall ()
 Put this vector in a state of being small. More...
 
bool isReferenceToRange (const void *V, const void *First, const void *Last) const
 Return true if V is an internal reference to the given range. More...
 
bool isReferenceToStorage (const void *V) const
 Return true if V is an internal reference to this vector. More...
 
bool isRangeInStorage (const void *First, const void *Last) const
 Return true if First and Last form a valid (possibly empty) range in this vector's storage. More...
 
bool isSafeToReferenceAfterResize (const void *Elt, size_t NewSize)
 Return true unless Elt will be invalidated by resizing the vector to NewSize. More...
 
void assertSafeToReferenceAfterResize (const void *Elt, size_t NewSize)
 Check whether Elt will be invalidated by resizing the vector to NewSize. More...
 
void assertSafeToAdd (const void *Elt, size_t N=1)
 Check whether Elt will be invalidated by increasing the size of the vector by N. More...
 
void assertSafeToReferenceAfterClear (const T *From, const T *To)
 Check whether any part of the range will be invalidated by clearing. More...
 
template<class ItTy , std::enable_if_t<!std::is_same< std::remove_const_t< ItTy >, T * >::value, bool > = false>
void assertSafeToReferenceAfterClear (ItTy, ItTy)
 
void assertSafeToAddRange (const T *From, const T *To)
 Check whether any part of the range will be invalidated by growing. More...
 
template<class ItTy , std::enable_if_t<!std::is_same< std::remove_const_t< ItTy >, T * >::value, bool > = false>
void assertSafeToAddRange (ItTy, ItTy)
 
- Protected Member Functions inherited from llvm::SmallVectorBase< SmallVectorSizeType< T > >
 SmallVectorBase ()=delete
 
 SmallVectorBase (void *FirstEl, size_t TotalCapacity)
 
void * mallocForGrow (size_t MinSize, size_t TSize, size_t &NewCapacity)
 This is a helper for grow() that's out of line to reduce code duplication. More...
 
void grow_pod (void *FirstEl, size_t MinSize, size_t TSize)
 This is an implementation of the grow() method which only works on POD-like data types and is out of line to reduce code duplication. More...
 

Static Protected Member Functions

template<class U >
static const TreserveForParamAndGetAddressImpl (U *This, const T &Elt, size_t N)
 Reserve enough space to add one element, and return the updated element pointer in case it was a reference to the storage. More...
 
- Static Protected Member Functions inherited from llvm::SmallVectorBase< SmallVectorSizeType< T > >
static constexpr size_t SizeTypeMax ()
 The maximum value of the Size_T used. More...
 

Additional Inherited Members

- Protected Attributes inherited from llvm::SmallVectorBase< SmallVectorSizeType< T > >
void * BeginX
 
SmallVectorSizeType< TSize
 
SmallVectorSizeType< TCapacity
 

Detailed Description

template<typename T, typename = void>
class llvm::SmallVectorTemplateCommon< T, typename >

This is the part of SmallVectorTemplateBase which does not depend on whether the type T is a POD.

The extra dummy template argument is used by ArrayRef to avoid unnecessarily requiring T to be complete.

Definition at line 106 of file SmallVector.h.

Member Typedef Documentation

◆ const_iterator

template<typename T , typename = void>
using llvm::SmallVectorTemplateCommon< T, typename >::const_iterator = const T *

Definition at line 238 of file SmallVector.h.

◆ const_pointer

template<typename T , typename = void>
using llvm::SmallVectorTemplateCommon< T, typename >::const_pointer = const T *

Definition at line 246 of file SmallVector.h.

◆ const_reference

template<typename T , typename = void>
using llvm::SmallVectorTemplateCommon< T, typename >::const_reference = const T &

Definition at line 244 of file SmallVector.h.

◆ const_reverse_iterator

template<typename T , typename = void>
using llvm::SmallVectorTemplateCommon< T, typename >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 240 of file SmallVector.h.

◆ difference_type

template<typename T , typename = void>
using llvm::SmallVectorTemplateCommon< T, typename >::difference_type = ptrdiff_t

Definition at line 235 of file SmallVector.h.

◆ iterator

template<typename T , typename = void>
using llvm::SmallVectorTemplateCommon< T, typename >::iterator = T *

Definition at line 237 of file SmallVector.h.

◆ pointer

template<typename T , typename = void>
using llvm::SmallVectorTemplateCommon< T, typename >::pointer = T *

Definition at line 245 of file SmallVector.h.

◆ reference

template<typename T , typename = void>
using llvm::SmallVectorTemplateCommon< T, typename >::reference = T &

Definition at line 243 of file SmallVector.h.

◆ reverse_iterator

template<typename T , typename = void>
using llvm::SmallVectorTemplateCommon< T, typename >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 241 of file SmallVector.h.

◆ size_type

template<typename T , typename = void>
using llvm::SmallVectorTemplateCommon< T, typename >::size_type = size_t

Definition at line 234 of file SmallVector.h.

◆ value_type

template<typename T , typename = void>
using llvm::SmallVectorTemplateCommon< T, typename >::value_type = T

Definition at line 236 of file SmallVector.h.

Constructor & Destructor Documentation

◆ SmallVectorTemplateCommon()

template<typename T , typename = void>
llvm::SmallVectorTemplateCommon< T, typename >::SmallVectorTemplateCommon ( size_t  Size)
inlineprotected

Definition at line 121 of file SmallVector.h.

Member Function Documentation

◆ assertSafeToAdd()

template<typename T , typename = void>
void llvm::SmallVectorTemplateCommon< T, typename >::assertSafeToAdd ( const void *  Elt,
size_t  N = 1 
)
inlineprotected

Check whether Elt will be invalidated by increasing the size of the vector by N.

Definition at line 182 of file SmallVector.h.

Referenced by llvm::SmallVectorTemplateCommon< T >::assertSafeToAddRange().

◆ assertSafeToAddRange() [1/2]

template<typename T , typename = void>
void llvm::SmallVectorTemplateCommon< T, typename >::assertSafeToAddRange ( const T From,
const T To 
)
inlineprotected

Check whether any part of the range will be invalidated by growing.

Definition at line 200 of file SmallVector.h.

◆ assertSafeToAddRange() [2/2]

template<typename T , typename = void>
template<class ItTy , std::enable_if_t<!std::is_same< std::remove_const_t< ItTy >, T * >::value, bool > = false>
void llvm::SmallVectorTemplateCommon< T, typename >::assertSafeToAddRange ( ItTy  ,
ItTy   
)
inlineprotected

Definition at line 210 of file SmallVector.h.

◆ assertSafeToReferenceAfterClear() [1/2]

template<typename T , typename = void>
void llvm::SmallVectorTemplateCommon< T, typename >::assertSafeToReferenceAfterClear ( const T From,
const T To 
)
inlineprotected

Check whether any part of the range will be invalidated by clearing.

Definition at line 187 of file SmallVector.h.

◆ assertSafeToReferenceAfterClear() [2/2]

template<typename T , typename = void>
template<class ItTy , std::enable_if_t<!std::is_same< std::remove_const_t< ItTy >, T * >::value, bool > = false>
void llvm::SmallVectorTemplateCommon< T, typename >::assertSafeToReferenceAfterClear ( ItTy  ,
ItTy   
)
inlineprotected

Definition at line 197 of file SmallVector.h.

◆ assertSafeToReferenceAfterResize()

template<typename T , typename = void>
void llvm::SmallVectorTemplateCommon< T, typename >::assertSafeToReferenceAfterResize ( const void *  Elt,
size_t  NewSize 
)
inlineprotected

Check whether Elt will be invalidated by resizing the vector to NewSize.

Definition at line 174 of file SmallVector.h.

Referenced by llvm::SmallVectorTemplateCommon< T >::assertSafeToAdd(), and llvm::SmallVectorTemplateCommon< T >::assertSafeToReferenceAfterClear().

◆ back() [1/2]

template<typename T , typename = void>
reference llvm::SmallVectorTemplateCommon< T, typename >::back ( )
inline

Definition at line 294 of file SmallVector.h.

◆ back() [2/2]

template<typename T , typename = void>
const_reference llvm::SmallVectorTemplateCommon< T, typename >::back ( ) const
inline

Definition at line 298 of file SmallVector.h.

◆ begin() [1/2]

template<typename T , typename = void>
iterator llvm::SmallVectorTemplateCommon< T, typename >::begin ( )
inline

◆ begin() [2/2]

template<typename T , typename = void>
const_iterator llvm::SmallVectorTemplateCommon< T, typename >::begin ( ) const
inline

Definition at line 254 of file SmallVector.h.

◆ capacity_in_bytes()

template<typename T , typename = void>
size_t llvm::SmallVectorTemplateCommon< T, typename >::capacity_in_bytes ( ) const
inline

Definition at line 269 of file SmallVector.h.

◆ data() [1/2]

template<typename T , typename = void>
pointer llvm::SmallVectorTemplateCommon< T, typename >::data ( )
inline

Return a pointer to the vector's buffer, even if empty().

Definition at line 272 of file SmallVector.h.

◆ data() [2/2]

template<typename T , typename = void>
const_pointer llvm::SmallVectorTemplateCommon< T, typename >::data ( ) const
inline

Return a pointer to the vector's buffer, even if empty().

Definition at line 274 of file SmallVector.h.

◆ end() [1/2]

template<typename T , typename = void>
iterator llvm::SmallVectorTemplateCommon< T, typename >::end ( )
inline

◆ end() [2/2]

template<typename T , typename = void>
const_iterator llvm::SmallVectorTemplateCommon< T, typename >::end ( ) const
inline

Definition at line 256 of file SmallVector.h.

◆ front() [1/2]

template<typename T , typename = void>
reference llvm::SmallVectorTemplateCommon< T, typename >::front ( )
inline

Definition at line 285 of file SmallVector.h.

◆ front() [2/2]

template<typename T , typename = void>
const_reference llvm::SmallVectorTemplateCommon< T, typename >::front ( ) const
inline

Definition at line 289 of file SmallVector.h.

◆ grow_pod()

template<typename T , typename = void>
void llvm::SmallVectorTemplateCommon< T, typename >::grow_pod ( size_t  MinSize,
size_t  TSize 
)
inlineprotected

Definition at line 123 of file SmallVector.h.

◆ isRangeInStorage()

template<typename T , typename = void>
bool llvm::SmallVectorTemplateCommon< T, typename >::isRangeInStorage ( const void *  First,
const void *  Last 
) const
inlineprotected

Return true if First and Last form a valid (possibly empty) range in this vector's storage.

Definition at line 151 of file SmallVector.h.

◆ isReferenceToRange()

template<typename T , typename = void>
bool llvm::SmallVectorTemplateCommon< T, typename >::isReferenceToRange ( const void *  V,
const void *  First,
const void *  Last 
) const
inlineprotected

Return true if V is an internal reference to the given range.

Definition at line 138 of file SmallVector.h.

Referenced by llvm::SmallVectorTemplateCommon< T >::isReferenceToStorage().

◆ isReferenceToStorage()

template<typename T , typename = void>
bool llvm::SmallVectorTemplateCommon< T, typename >::isReferenceToStorage ( const void *  V) const
inlineprotected

Return true if V is an internal reference to this vector.

Definition at line 145 of file SmallVector.h.

Referenced by llvm::SmallVectorTemplateCommon< T >::isSafeToReferenceAfterResize().

◆ isSafeToReferenceAfterResize()

template<typename T , typename = void>
bool llvm::SmallVectorTemplateCommon< T, typename >::isSafeToReferenceAfterResize ( const void *  Elt,
size_t  NewSize 
)
inlineprotected

Return true unless Elt will be invalidated by resizing the vector to NewSize.

Definition at line 160 of file SmallVector.h.

Referenced by llvm::SmallVectorTemplateCommon< T >::assertSafeToReferenceAfterResize().

◆ isSmall()

template<typename T , typename = void>
bool llvm::SmallVectorTemplateCommon< T, typename >::isSmall ( ) const
inlineprotected

Return true if this is a smallvector which has not had dynamic memory allocated for it.

Definition at line 129 of file SmallVector.h.

◆ max_size()

template<typename T , typename = void>
size_type llvm::SmallVectorTemplateCommon< T, typename >::max_size ( ) const
inline

Definition at line 265 of file SmallVector.h.

◆ operator[]() [1/2]

template<typename T , typename = void>
reference llvm::SmallVectorTemplateCommon< T, typename >::operator[] ( size_type  idx)
inline

Definition at line 276 of file SmallVector.h.

◆ operator[]() [2/2]

template<typename T , typename = void>
const_reference llvm::SmallVectorTemplateCommon< T, typename >::operator[] ( size_type  idx) const
inline

Definition at line 280 of file SmallVector.h.

◆ rbegin() [1/2]

template<typename T , typename = void>
reverse_iterator llvm::SmallVectorTemplateCommon< T, typename >::rbegin ( )
inline

Definition at line 259 of file SmallVector.h.

◆ rbegin() [2/2]

template<typename T , typename = void>
const_reverse_iterator llvm::SmallVectorTemplateCommon< T, typename >::rbegin ( ) const
inline

Definition at line 260 of file SmallVector.h.

◆ rend() [1/2]

template<typename T , typename = void>
reverse_iterator llvm::SmallVectorTemplateCommon< T, typename >::rend ( )
inline

Definition at line 261 of file SmallVector.h.

◆ rend() [2/2]

template<typename T , typename = void>
const_reverse_iterator llvm::SmallVectorTemplateCommon< T, typename >::rend ( ) const
inline

Definition at line 262 of file SmallVector.h.

◆ reserveForParamAndGetAddressImpl()

template<typename T , typename = void>
template<class U >
static const T* llvm::SmallVectorTemplateCommon< T, typename >::reserveForParamAndGetAddressImpl ( U *  This,
const T Elt,
size_t  N 
)
inlinestaticprotected

Reserve enough space to add one element, and return the updated element pointer in case it was a reference to the storage.

Definition at line 215 of file SmallVector.h.

◆ resetToSmall()

template<typename T , typename = void>
void llvm::SmallVectorTemplateCommon< T, typename >::resetToSmall ( )
inlineprotected

Put this vector in a state of being small.

Definition at line 132 of file SmallVector.h.

◆ size_in_bytes()

template<typename T , typename = void>
size_type llvm::SmallVectorTemplateCommon< T, typename >::size_in_bytes ( ) const
inline

Definition at line 264 of file SmallVector.h.


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