LLVM 20.0.0git
Classes | Public Types | Public Member Functions | List of all members
llvm::AllocatorList< T, AllocatorT > Class Template Reference

A linked-list with a custom, local allocator. More...

#include "llvm/ADT/AllocatorList.h"

Inheritance diagram for llvm::AllocatorList< T, AllocatorT >:
Inheritance graph
[legend]

Public Types

using value_type = T
 
using pointer = T *
 
using reference = T &
 
using const_pointer = const T *
 
using const_reference = const T &
 
using size_type = typename list_type::size_type
 
using difference_type = typename list_type::difference_type
 
using iterator = IteratorImpl< T, typename list_type::iterator >
 
using reverse_iterator = IteratorImpl< T, typename list_type::reverse_iterator >
 
using const_iterator = IteratorImpl< const T, typename list_type::const_iterator >
 
using const_reverse_iterator = IteratorImpl< const T, typename list_type::const_reverse_iterator >
 

Public Member Functions

 AllocatorList ()=default
 
 AllocatorList (AllocatorList &&X)
 
 AllocatorList (const AllocatorList &X)
 
AllocatorListoperator= (AllocatorList &&X)
 
AllocatorListoperator= (const AllocatorList &X)
 
 ~AllocatorList ()
 
void swap (AllocatorList &RHS)
 
bool empty ()
 
size_t size ()
 
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
 
Tback ()
 
Tfront ()
 
const Tback () const
 
const Tfront () const
 
template<class... Ts>
iterator emplace (iterator I, Ts &&... Vs)
 
iterator insert (iterator I, T &&V)
 
iterator insert (iterator I, const T &V)
 
template<class Iterator >
void insert (iterator I, Iterator First, Iterator Last)
 
iterator erase (iterator I)
 
iterator erase (iterator First, iterator Last)
 
void clear ()
 
void pop_back ()
 
void pop_front ()
 
void push_back (T &&V)
 
void push_front (T &&V)
 
void push_back (const T &V)
 
void push_front (const T &V)
 
template<class... Ts>
void emplace_back (Ts &&... Vs)
 
template<class... Ts>
void emplace_front (Ts &&... Vs)
 
void resetAlloc ()
 Reset the underlying allocator.
 

Detailed Description

template<class T, class AllocatorT>
class llvm::AllocatorList< T, AllocatorT >

A linked-list with a custom, local allocator.

Expose a std::list-like interface that owns and uses a custom LLVM-style allocator (e.g., BumpPtrAllocator), leveraging simple_ilist for the implementation details.

Because this list owns the allocator, calling splice() with a different list isn't generally safe. As such, splice has been left out of the interface entirely.

Definition at line 33 of file AllocatorList.h.

Member Typedef Documentation

◆ const_iterator

template<class T , class AllocatorT >
using llvm::AllocatorList< T, AllocatorT >::const_iterator = IteratorImpl<const T, typename list_type::const_iterator>

Definition at line 126 of file AllocatorList.h.

◆ const_pointer

template<class T , class AllocatorT >
using llvm::AllocatorList< T, AllocatorT >::const_pointer = const T *

Definition at line 80 of file AllocatorList.h.

◆ const_reference

template<class T , class AllocatorT >
using llvm::AllocatorList< T, AllocatorT >::const_reference = const T &

Definition at line 81 of file AllocatorList.h.

◆ const_reverse_iterator

template<class T , class AllocatorT >
using llvm::AllocatorList< T, AllocatorT >::const_reverse_iterator = IteratorImpl<const T, typename list_type::const_reverse_iterator>

Definition at line 128 of file AllocatorList.h.

◆ difference_type

template<class T , class AllocatorT >
using llvm::AllocatorList< T, AllocatorT >::difference_type = typename list_type::difference_type

Definition at line 83 of file AllocatorList.h.

◆ iterator

template<class T , class AllocatorT >
using llvm::AllocatorList< T, AllocatorT >::iterator = IteratorImpl<T, typename list_type::iterator>

Definition at line 123 of file AllocatorList.h.

◆ pointer

template<class T , class AllocatorT >
using llvm::AllocatorList< T, AllocatorT >::pointer = T *

Definition at line 78 of file AllocatorList.h.

◆ reference

template<class T , class AllocatorT >
using llvm::AllocatorList< T, AllocatorT >::reference = T &

Definition at line 79 of file AllocatorList.h.

◆ reverse_iterator

template<class T , class AllocatorT >
using llvm::AllocatorList< T, AllocatorT >::reverse_iterator = IteratorImpl<T, typename list_type::reverse_iterator>

Definition at line 124 of file AllocatorList.h.

◆ size_type

template<class T , class AllocatorT >
using llvm::AllocatorList< T, AllocatorT >::size_type = typename list_type::size_type

Definition at line 82 of file AllocatorList.h.

◆ value_type

template<class T , class AllocatorT >
using llvm::AllocatorList< T, AllocatorT >::value_type = T

Definition at line 77 of file AllocatorList.h.

Constructor & Destructor Documentation

◆ AllocatorList() [1/3]

template<class T , class AllocatorT >
llvm::AllocatorList< T, AllocatorT >::AllocatorList ( )
default

◆ AllocatorList() [2/3]

template<class T , class AllocatorT >
llvm::AllocatorList< T, AllocatorT >::AllocatorList ( AllocatorList< T, AllocatorT > &&  X)
inline

Definition at line 132 of file AllocatorList.h.

References List.

◆ AllocatorList() [3/3]

template<class T , class AllocatorT >
llvm::AllocatorList< T, AllocatorT >::AllocatorList ( const AllocatorList< T, AllocatorT > &  X)
inline

Definition at line 135 of file AllocatorList.h.

References List, and X.

◆ ~AllocatorList()

template<class T , class AllocatorT >
llvm::AllocatorList< T, AllocatorT >::~AllocatorList ( )
inline

Definition at line 151 of file AllocatorList.h.

References llvm::AllocatorList< T, AllocatorT >::clear().

Member Function Documentation

◆ back() [1/2]

template<class T , class AllocatorT >
T & llvm::AllocatorList< T, AllocatorT >::back ( )
inline

Definition at line 174 of file AllocatorList.h.

References List.

◆ back() [2/2]

template<class T , class AllocatorT >
const T & llvm::AllocatorList< T, AllocatorT >::back ( ) const
inline

Definition at line 176 of file AllocatorList.h.

References List.

◆ begin() [1/2]

template<class T , class AllocatorT >
iterator llvm::AllocatorList< T, AllocatorT >::begin ( )
inline

◆ begin() [2/2]

template<class T , class AllocatorT >
const_iterator llvm::AllocatorList< T, AllocatorT >::begin ( ) const
inline

Definition at line 163 of file AllocatorList.h.

References List.

◆ clear()

template<class T , class AllocatorT >
void llvm::AllocatorList< T, AllocatorT >::clear ( )
inline

◆ emplace()

template<class T , class AllocatorT >
template<class... Ts>
iterator llvm::AllocatorList< T, AllocatorT >::emplace ( iterator  I,
Ts &&...  Vs 
)
inline

◆ emplace_back()

template<class T , class AllocatorT >
template<class... Ts>
void llvm::AllocatorList< T, AllocatorT >::emplace_back ( Ts &&...  Vs)
inline

◆ emplace_front()

template<class T , class AllocatorT >
template<class... Ts>
void llvm::AllocatorList< T, AllocatorT >::emplace_front ( Ts &&...  Vs)
inline

◆ empty()

template<class T , class AllocatorT >
bool llvm::AllocatorList< T, AllocatorT >::empty ( )
inline

◆ end() [1/2]

template<class T , class AllocatorT >
iterator llvm::AllocatorList< T, AllocatorT >::end ( )
inline

◆ end() [2/2]

template<class T , class AllocatorT >
const_iterator llvm::AllocatorList< T, AllocatorT >::end ( ) const
inline

Definition at line 164 of file AllocatorList.h.

References List.

◆ erase() [1/2]

template<class T , class AllocatorT >
iterator llvm::AllocatorList< T, AllocatorT >::erase ( iterator  First,
iterator  Last 
)
inline

Definition at line 200 of file AllocatorList.h.

References llvm::First, llvm::Last, and List.

◆ erase() [2/2]

template<class T , class AllocatorT >
iterator llvm::AllocatorList< T, AllocatorT >::erase ( iterator  I)
inline

Definition at line 196 of file AllocatorList.h.

References I, and List.

◆ front() [1/2]

template<class T , class AllocatorT >
T & llvm::AllocatorList< T, AllocatorT >::front ( )
inline

Definition at line 175 of file AllocatorList.h.

References List.

Referenced by llvm::yaml::Scanner::peekNext().

◆ front() [2/2]

template<class T , class AllocatorT >
const T & llvm::AllocatorList< T, AllocatorT >::front ( ) const
inline

Definition at line 177 of file AllocatorList.h.

References List.

◆ insert() [1/3]

template<class T , class AllocatorT >
iterator llvm::AllocatorList< T, AllocatorT >::insert ( iterator  I,
const T V 
)
inline

Definition at line 186 of file AllocatorList.h.

References I, and List.

◆ insert() [2/3]

template<class T , class AllocatorT >
template<class Iterator >
void llvm::AllocatorList< T, AllocatorT >::insert ( iterator  I,
Iterator  First,
Iterator  Last 
)
inline

Definition at line 191 of file AllocatorList.h.

References llvm::First, I, llvm::Last, and List.

◆ insert() [3/3]

template<class T , class AllocatorT >
iterator llvm::AllocatorList< T, AllocatorT >::insert ( iterator  I,
T &&  V 
)
inline

◆ operator=() [1/2]

template<class T , class AllocatorT >
AllocatorList & llvm::AllocatorList< T, AllocatorT >::operator= ( AllocatorList< T, AllocatorT > &&  X)
inline

Definition at line 139 of file AllocatorList.h.

References llvm::AllocatorList< T, AllocatorT >::clear(), List, and X.

◆ operator=() [2/2]

template<class T , class AllocatorT >
AllocatorList & llvm::AllocatorList< T, AllocatorT >::operator= ( const AllocatorList< T, AllocatorT > &  X)
inline

Definition at line 146 of file AllocatorList.h.

References List, and X.

◆ pop_back()

template<class T , class AllocatorT >
void llvm::AllocatorList< T, AllocatorT >::pop_back ( )
inline

Definition at line 206 of file AllocatorList.h.

References List.

◆ pop_front()

template<class T , class AllocatorT >
void llvm::AllocatorList< T, AllocatorT >::pop_front ( )
inline

Definition at line 207 of file AllocatorList.h.

References List.

Referenced by llvm::yaml::Scanner::getNext().

◆ push_back() [1/2]

template<class T , class AllocatorT >
void llvm::AllocatorList< T, AllocatorT >::push_back ( const T V)
inline

◆ push_back() [2/2]

template<class T , class AllocatorT >
void llvm::AllocatorList< T, AllocatorT >::push_back ( T &&  V)
inline

◆ push_front() [1/2]

template<class T , class AllocatorT >
void llvm::AllocatorList< T, AllocatorT >::push_front ( const T V)
inline

◆ push_front() [2/2]

template<class T , class AllocatorT >
void llvm::AllocatorList< T, AllocatorT >::push_front ( T &&  V)
inline

◆ rbegin() [1/2]

template<class T , class AllocatorT >
reverse_iterator llvm::AllocatorList< T, AllocatorT >::rbegin ( )
inline

Definition at line 165 of file AllocatorList.h.

References List.

◆ rbegin() [2/2]

template<class T , class AllocatorT >
const_reverse_iterator llvm::AllocatorList< T, AllocatorT >::rbegin ( ) const
inline

Definition at line 167 of file AllocatorList.h.

References List.

◆ rend() [1/2]

template<class T , class AllocatorT >
reverse_iterator llvm::AllocatorList< T, AllocatorT >::rend ( )
inline

Definition at line 166 of file AllocatorList.h.

References List.

◆ rend() [2/2]

template<class T , class AllocatorT >
const_reverse_iterator llvm::AllocatorList< T, AllocatorT >::rend ( ) const
inline

Definition at line 170 of file AllocatorList.h.

References List.

◆ resetAlloc()

template<class T , class AllocatorT >
void llvm::AllocatorList< T, AllocatorT >::resetAlloc ( )
inline

Reset the underlying allocator.

Precondition
empty()

Definition at line 222 of file AllocatorList.h.

References assert(), and llvm::AllocatorList< T, AllocatorT >::empty().

Referenced by llvm::yaml::Scanner::getNext().

◆ size()

template<class T , class AllocatorT >
size_t llvm::AllocatorList< T, AllocatorT >::size ( )
inline

Definition at line 159 of file AllocatorList.h.

References List.

◆ swap()

template<class T , class AllocatorT >
void llvm::AllocatorList< T, AllocatorT >::swap ( AllocatorList< T, AllocatorT > &  RHS)
inline

Definition at line 153 of file AllocatorList.h.

References List, RHS, and std::swap().


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