LLVM 20.0.0git
Public Types | Public Member Functions | List of all members
llvm::iplist_impl< IntrusiveListT, TraitsT > Class Template Reference

A wrapper around an intrusive list with callbacks and non-intrusive ownership. More...

#include "llvm/ADT/ilist.h"

Inheritance diagram for llvm::iplist_impl< IntrusiveListT, TraitsT >:
Inheritance graph
[legend]

Public Types

typedef base_list_type::pointer pointer
 
typedef base_list_type::const_pointer const_pointer
 
typedef base_list_type::reference reference
 
typedef base_list_type::const_reference const_reference
 
typedef base_list_type::value_type value_type
 
typedef base_list_type::size_type size_type
 
typedef base_list_type::difference_type difference_type
 
typedef base_list_type::iterator iterator
 
typedef base_list_type::const_iterator const_iterator
 
typedef base_list_type::reverse_iterator reverse_iterator
 
typedef base_list_type::const_reverse_iterator const_reverse_iterator
 

Public Member Functions

 iplist_impl ()=default
 
 iplist_impl (const iplist_impl &)=delete
 
iplist_imploperator= (const iplist_impl &)=delete
 
 iplist_impl (iplist_impl &&X)
 
iplist_imploperator= (iplist_impl &&X)
 
 ~iplist_impl ()
 
size_type max_size () const
 
void swap (iplist_impl &RHS)
 
iterator insert (iterator where, pointer New)
 
iterator insert (iterator where, const_reference New)
 
iterator insertAfter (iterator where, pointer New)
 
template<class Cloner >
void cloneFrom (const iplist_impl &L2, Cloner clone)
 Clone another list.
 
pointer remove (iterator &IT)
 
pointer remove (const iterator &IT)
 
pointer remove (pointer IT)
 
pointer remove (reference IT)
 
iterator erase (iterator where)
 
iterator erase (pointer IT)
 
iterator erase (reference IT)
 
void clearAndLeakNodesUnsafely ()
 Remove all nodes from the list like clear(), but do not call removeNodeFromList() or deleteNode().
 
iterator erase (iterator first, iterator last)
 
void clear ()
 
void push_front (pointer val)
 
void push_back (pointer val)
 
void pop_front ()
 
void pop_back ()
 
template<class InIt >
void insert (iterator where, InIt first, InIt last)
 
void splice (iterator where, iplist_impl &L2)
 
void splice (iterator where, iplist_impl &L2, iterator first)
 
void splice (iterator where, iplist_impl &L2, iterator first, iterator last)
 
void splice (iterator where, iplist_impl &L2, reference N)
 
void splice (iterator where, iplist_impl &L2, pointer N)
 
template<class Compare >
void merge (iplist_impl &Right, Compare comp)
 
void merge (iplist_impl &Right)
 
pointer getPrevNode (reference N) const
 Get the previous node, or nullptr for the list head.
 
const_pointer getPrevNode (const_reference N) const
 Get the previous node, or nullptr for the list head.
 
pointer getNextNode (reference N) const
 Get the next node, or nullptr for the list tail.
 
const_pointer getNextNode (const_reference N) const
 Get the next node, or nullptr for the list tail.
 

Detailed Description

template<class IntrusiveListT, class TraitsT>
class llvm::iplist_impl< IntrusiveListT, TraitsT >

A wrapper around an intrusive list with callbacks and non-intrusive ownership.

This wraps a purely intrusive list (like simple_ilist) with a configurable traits class. The traits can implement callbacks and customize the ownership semantics.

This is a subset of ilist functionality that can safely be used on nodes of polymorphic types, i.e. a heterogeneous list with a common base class that holds the next/prev pointers. The only state of the list itself is an ilist_sentinel, which holds pointers to the first and last nodes in the list.

Definition at line 110 of file ilist.h.

Member Typedef Documentation

◆ const_iterator

template<class IntrusiveListT , class TraitsT >
typedef base_list_type::const_iterator llvm::iplist_impl< IntrusiveListT, TraitsT >::const_iterator

Definition at line 122 of file ilist.h.

◆ const_pointer

template<class IntrusiveListT , class TraitsT >
typedef base_list_type::const_pointer llvm::iplist_impl< IntrusiveListT, TraitsT >::const_pointer

Definition at line 115 of file ilist.h.

◆ const_reference

template<class IntrusiveListT , class TraitsT >
typedef base_list_type::const_reference llvm::iplist_impl< IntrusiveListT, TraitsT >::const_reference

Definition at line 117 of file ilist.h.

◆ const_reverse_iterator

template<class IntrusiveListT , class TraitsT >
typedef base_list_type::const_reverse_iterator llvm::iplist_impl< IntrusiveListT, TraitsT >::const_reverse_iterator

Definition at line 125 of file ilist.h.

◆ difference_type

template<class IntrusiveListT , class TraitsT >
typedef base_list_type::difference_type llvm::iplist_impl< IntrusiveListT, TraitsT >::difference_type

Definition at line 120 of file ilist.h.

◆ iterator

template<class IntrusiveListT , class TraitsT >
typedef base_list_type::iterator llvm::iplist_impl< IntrusiveListT, TraitsT >::iterator

Definition at line 121 of file ilist.h.

◆ pointer

template<class IntrusiveListT , class TraitsT >
typedef base_list_type::pointer llvm::iplist_impl< IntrusiveListT, TraitsT >::pointer

Definition at line 114 of file ilist.h.

◆ reference

template<class IntrusiveListT , class TraitsT >
typedef base_list_type::reference llvm::iplist_impl< IntrusiveListT, TraitsT >::reference

Definition at line 116 of file ilist.h.

◆ reverse_iterator

template<class IntrusiveListT , class TraitsT >
typedef base_list_type::reverse_iterator llvm::iplist_impl< IntrusiveListT, TraitsT >::reverse_iterator

Definition at line 123 of file ilist.h.

◆ size_type

template<class IntrusiveListT , class TraitsT >
typedef base_list_type::size_type llvm::iplist_impl< IntrusiveListT, TraitsT >::size_type

Definition at line 119 of file ilist.h.

◆ value_type

template<class IntrusiveListT , class TraitsT >
typedef base_list_type::value_type llvm::iplist_impl< IntrusiveListT, TraitsT >::value_type

Definition at line 118 of file ilist.h.

Constructor & Destructor Documentation

◆ iplist_impl() [1/3]

template<class IntrusiveListT , class TraitsT >
llvm::iplist_impl< IntrusiveListT, TraitsT >::iplist_impl ( )
default

◆ iplist_impl() [2/3]

template<class IntrusiveListT , class TraitsT >
llvm::iplist_impl< IntrusiveListT, TraitsT >::iplist_impl ( const iplist_impl< IntrusiveListT, TraitsT > &  )
delete

◆ iplist_impl() [3/3]

template<class IntrusiveListT , class TraitsT >
llvm::iplist_impl< IntrusiveListT, TraitsT >::iplist_impl ( iplist_impl< IntrusiveListT, TraitsT > &&  X)
inline

Definition at line 137 of file ilist.h.

◆ ~iplist_impl()

template<class IntrusiveListT , class TraitsT >
llvm::iplist_impl< IntrusiveListT, TraitsT >::~iplist_impl ( )
inline

Definition at line 147 of file ilist.h.

References llvm::iplist_impl< IntrusiveListT, TraitsT >::clear().

Member Function Documentation

◆ clear()

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::clear ( )
inline

◆ clearAndLeakNodesUnsafely()

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::clearAndLeakNodesUnsafely ( )
inline

Remove all nodes from the list like clear(), but do not call removeNodeFromList() or deleteNode().

This should only be used immediately before freeing nodes in bulk to avoid traversing the list and bringing all the nodes into cache.

Definition at line 217 of file ilist.h.

◆ cloneFrom()

template<class IntrusiveListT , class TraitsT >
template<class Cloner >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::cloneFrom ( const iplist_impl< IntrusiveListT, TraitsT > &  L2,
Cloner  clone 
)
inline

◆ erase() [1/4]

template<class IntrusiveListT , class TraitsT >
iterator llvm::iplist_impl< IntrusiveListT, TraitsT >::erase ( iterator  first,
iterator  last 
)
inline

Definition at line 240 of file ilist.h.

References llvm::iplist_impl< IntrusiveListT, TraitsT >::erase().

◆ erase() [2/4]

template<class IntrusiveListT , class TraitsT >
iterator llvm::iplist_impl< IntrusiveListT, TraitsT >::erase ( iterator  where)
inline

◆ erase() [3/4]

template<class IntrusiveListT , class TraitsT >
iterator llvm::iplist_impl< IntrusiveListT, TraitsT >::erase ( pointer  IT)
inline

◆ erase() [4/4]

template<class IntrusiveListT , class TraitsT >
iterator llvm::iplist_impl< IntrusiveListT, TraitsT >::erase ( reference  IT)
inline

◆ getNextNode() [1/2]

template<class IntrusiveListT , class TraitsT >
const_pointer llvm::iplist_impl< IntrusiveListT, TraitsT >::getNextNode ( const_reference  N) const
inline

Get the next node, or nullptr for the list tail.

Definition at line 316 of file ilist.h.

References llvm::iplist_impl< IntrusiveListT, TraitsT >::getNextNode(), and N.

◆ getNextNode() [2/2]

template<class IntrusiveListT , class TraitsT >
pointer llvm::iplist_impl< IntrusiveListT, TraitsT >::getNextNode ( reference  N) const
inline

Get the next node, or nullptr for the list tail.

Definition at line 309 of file ilist.h.

References N.

Referenced by llvm::iplist_impl< IntrusiveListT, TraitsT >::getNextNode().

◆ getPrevNode() [1/2]

template<class IntrusiveListT , class TraitsT >
const_pointer llvm::iplist_impl< IntrusiveListT, TraitsT >::getPrevNode ( const_reference  N) const
inline

Get the previous node, or nullptr for the list head.

Definition at line 304 of file ilist.h.

References llvm::iplist_impl< IntrusiveListT, TraitsT >::getPrevNode(), and N.

◆ getPrevNode() [2/2]

template<class IntrusiveListT , class TraitsT >
pointer llvm::iplist_impl< IntrusiveListT, TraitsT >::getPrevNode ( reference  N) const
inline

Get the previous node, or nullptr for the list head.

Definition at line 297 of file ilist.h.

References I, and N.

Referenced by llvm::iplist_impl< IntrusiveListT, TraitsT >::getPrevNode().

◆ insert() [1/3]

template<class IntrusiveListT , class TraitsT >
iterator llvm::iplist_impl< IntrusiveListT, TraitsT >::insert ( iterator  where,
const_reference  New 
)
inline

Definition at line 170 of file ilist.h.

References llvm::iplist_impl< IntrusiveListT, TraitsT >::insert().

◆ insert() [2/3]

template<class IntrusiveListT , class TraitsT >
template<class InIt >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::insert ( iterator  where,
InIt  first,
InIt  last 
)
inline

Definition at line 261 of file ilist.h.

References llvm::iplist_impl< IntrusiveListT, TraitsT >::insert().

◆ insert() [3/3]

template<class IntrusiveListT , class TraitsT >
iterator llvm::iplist_impl< IntrusiveListT, TraitsT >::insert ( iterator  where,
pointer  New 
)
inline

◆ insertAfter()

template<class IntrusiveListT , class TraitsT >
iterator llvm::iplist_impl< IntrusiveListT, TraitsT >::insertAfter ( iterator  where,
pointer  New 
)
inline

◆ max_size()

template<class IntrusiveListT , class TraitsT >
size_type llvm::iplist_impl< IntrusiveListT, TraitsT >::max_size ( ) const
inline

Definition at line 150 of file ilist.h.

◆ merge() [1/2]

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::merge ( iplist_impl< IntrusiveListT, TraitsT > &  Right)
inline

◆ merge() [2/2]

template<class IntrusiveListT , class TraitsT >
template<class Compare >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::merge ( iplist_impl< IntrusiveListT, TraitsT > &  Right,
Compare  comp 
)
inline

Definition at line 286 of file ilist.h.

References llvm::Right.

◆ operator=() [1/2]

template<class IntrusiveListT , class TraitsT >
iplist_impl & llvm::iplist_impl< IntrusiveListT, TraitsT >::operator= ( const iplist_impl< IntrusiveListT, TraitsT > &  )
delete

◆ operator=() [2/2]

template<class IntrusiveListT , class TraitsT >
iplist_impl & llvm::iplist_impl< IntrusiveListT, TraitsT >::operator= ( iplist_impl< IntrusiveListT, TraitsT > &&  X)
inline

Definition at line 140 of file ilist.h.

References X.

◆ pop_back()

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::pop_back ( )
inline

◆ pop_front()

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::pop_front ( )
inline

Definition at line 251 of file ilist.h.

References assert(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::erase().

◆ push_back()

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::push_back ( pointer  val)
inline

◆ push_front()

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::push_front ( pointer  val)
inline

◆ remove() [1/4]

template<class IntrusiveListT , class TraitsT >
pointer llvm::iplist_impl< IntrusiveListT, TraitsT >::remove ( const iterator IT)
inline

Definition at line 195 of file ilist.h.

References IT, and llvm::iplist_impl< IntrusiveListT, TraitsT >::remove().

◆ remove() [2/4]

template<class IntrusiveListT , class TraitsT >
pointer llvm::iplist_impl< IntrusiveListT, TraitsT >::remove ( iterator IT)
inline

◆ remove() [3/4]

template<class IntrusiveListT , class TraitsT >
pointer llvm::iplist_impl< IntrusiveListT, TraitsT >::remove ( pointer  IT)
inline

◆ remove() [4/4]

template<class IntrusiveListT , class TraitsT >
pointer llvm::iplist_impl< IntrusiveListT, TraitsT >::remove ( reference  IT)
inline

◆ splice() [1/5]

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::splice ( iterator  where,
iplist_impl< IntrusiveListT, TraitsT > &  L2 
)
inline

◆ splice() [2/5]

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::splice ( iterator  where,
iplist_impl< IntrusiveListT, TraitsT > &  L2,
iterator  first 
)
inline

Definition at line 270 of file ilist.h.

◆ splice() [3/5]

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::splice ( iterator  where,
iplist_impl< IntrusiveListT, TraitsT > &  L2,
iterator  first,
iterator  last 
)
inline

Definition at line 275 of file ilist.h.

◆ splice() [4/5]

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::splice ( iterator  where,
iplist_impl< IntrusiveListT, TraitsT > &  L2,
pointer  N 
)
inline

Definition at line 281 of file ilist.h.

References N, and llvm::iplist_impl< IntrusiveListT, TraitsT >::splice().

◆ splice() [5/5]

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::splice ( iterator  where,
iplist_impl< IntrusiveListT, TraitsT > &  L2,
reference  N 
)
inline

Definition at line 278 of file ilist.h.

References N, and llvm::iplist_impl< IntrusiveListT, TraitsT >::splice().

◆ swap()

template<class IntrusiveListT , class TraitsT >
void llvm::iplist_impl< IntrusiveListT, TraitsT >::swap ( iplist_impl< IntrusiveListT, TraitsT > &  RHS)
inline

Definition at line 160 of file ilist.h.

References assert(), and RHS.


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