LLVM  8.0.1
Public Types | Public Member Functions | Friends | List of all members
llvm::ilist_iterator< OptionsT, IsReverse, IsConst > Class Template Reference

Iterator for intrusive lists based on ilist_node. More...

#include "llvm/ADT/ilist_iterator.h"

Inheritance diagram for llvm::ilist_iterator< OptionsT, IsReverse, IsConst >:
Inheritance graph
[legend]
Collaboration diagram for llvm::ilist_iterator< OptionsT, IsReverse, IsConst >:
Collaboration graph
[legend]

Public Types

using value_type = typename Traits::value_type
 
using pointer = typename Traits::pointer
 
using reference = typename Traits::reference
 
using difference_type = ptrdiff_t
 
using iterator_category = std::bidirectional_iterator_tag
 
using const_pointer = typename OptionsT::const_pointer
 
using const_reference = typename OptionsT::const_reference
 

Public Member Functions

 ilist_iterator (node_reference N)
 Create from an ilist_node. More...
 
 ilist_iterator (pointer NP)
 
 ilist_iterator (reference NR)
 
 ilist_iterator ()=default
 
template<bool RHSIsConst>
 ilist_iterator (const ilist_iterator< OptionsT, IsReverse, RHSIsConst > &RHS, typename std::enable_if< IsConst||!RHSIsConst, void *>::type=nullptr)
 
template<bool RHSIsConst>
std::enable_if< IsConst||!RHSIsConst, ilist_iterator & >::type operator= (const ilist_iterator< OptionsT, IsReverse, RHSIsConst > &RHS)
 
 ilist_iterator (const ilist_iterator< OptionsT, !IsReverse, IsConst > &RHS)
 Explicit conversion between forward/reverse iterators. More...
 
ilist_iterator< OptionsT, !IsReverse, IsConst > getReverse () const
 Get a reverse iterator to the same node. More...
 
ilist_iterator< OptionsT, IsReverse, falsegetNonConst () const
 Const-cast. More...
 
reference operator* () const
 
pointer operator-> () const
 
ilist_iteratoroperator-- ()
 
ilist_iteratoroperator++ ()
 
ilist_iterator operator-- (int)
 
ilist_iterator operator++ (int)
 
node_pointer getNodePtr () const
 Get the underlying ilist_node. More...
 
bool isEnd () const
 Check for end. Only valid if ilist_sentinel_tracking<true>. More...
 

Friends

bool operator== (const ilist_iterator &LHS, const ilist_iterator &RHS)
 
bool operator!= (const ilist_iterator &LHS, const ilist_iterator &RHS)
 

Detailed Description

template<class OptionsT, bool IsReverse, bool IsConst>
class llvm::ilist_iterator< OptionsT, IsReverse, IsConst >

Iterator for intrusive lists based on ilist_node.

Definition at line 58 of file ilist_iterator.h.

Member Typedef Documentation

◆ const_pointer

template<class OptionsT, bool IsReverse, bool IsConst>
using llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::const_pointer = typename OptionsT::const_pointer

Definition at line 72 of file ilist_iterator.h.

◆ const_reference

template<class OptionsT, bool IsReverse, bool IsConst>
using llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::const_reference = typename OptionsT::const_reference

Definition at line 73 of file ilist_iterator.h.

◆ difference_type

template<class OptionsT, bool IsReverse, bool IsConst>
using llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::difference_type = ptrdiff_t

Definition at line 70 of file ilist_iterator.h.

◆ iterator_category

template<class OptionsT, bool IsReverse, bool IsConst>
using llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::iterator_category = std::bidirectional_iterator_tag

Definition at line 71 of file ilist_iterator.h.

◆ pointer

template<class OptionsT, bool IsReverse, bool IsConst>
using llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::pointer = typename Traits::pointer

Definition at line 68 of file ilist_iterator.h.

◆ reference

template<class OptionsT, bool IsReverse, bool IsConst>
using llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::reference = typename Traits::reference

Definition at line 69 of file ilist_iterator.h.

◆ value_type

template<class OptionsT, bool IsReverse, bool IsConst>
using llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::value_type = typename Traits::value_type

Definition at line 67 of file ilist_iterator.h.

Constructor & Destructor Documentation

◆ ilist_iterator() [1/6]

template<class OptionsT, bool IsReverse, bool IsConst>
llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::ilist_iterator ( node_reference  N)
inlineexplicit

Create from an ilist_node.

Definition at line 83 of file ilist_iterator.h.

◆ ilist_iterator() [2/6]

template<class OptionsT, bool IsReverse, bool IsConst>
llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::ilist_iterator ( pointer  NP)
inlineexplicit

Definition at line 85 of file ilist_iterator.h.

◆ ilist_iterator() [3/6]

template<class OptionsT, bool IsReverse, bool IsConst>
llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::ilist_iterator ( reference  NR)
inlineexplicit

Definition at line 86 of file ilist_iterator.h.

◆ ilist_iterator() [4/6]

template<class OptionsT, bool IsReverse, bool IsConst>
llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::ilist_iterator ( )
default

◆ ilist_iterator() [5/6]

template<class OptionsT, bool IsReverse, bool IsConst>
template<bool RHSIsConst>
llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::ilist_iterator ( const ilist_iterator< OptionsT, IsReverse, RHSIsConst > &  RHS,
typename std::enable_if< IsConst||!RHSIsConst, void *>::type  = nullptr 
)
inline

Definition at line 92 of file ilist_iterator.h.

◆ ilist_iterator() [6/6]

template<class OptionsT, bool IsReverse, bool IsConst>
llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::ilist_iterator ( const ilist_iterator< OptionsT, !IsReverse, IsConst > &  RHS)
inlineexplicit

Explicit conversion between forward/reverse iterators.

Translate between forward and reverse iterators without changing range boundaries. The resulting iterator will dereference (and have a handle) to the previous node, which is somewhat unexpected; but converting the two endpoints in a range will give the same range in reverse.

This matches std::reverse_iterator conversions.

Definition at line 114 of file ilist_iterator.h.

Member Function Documentation

◆ getNodePtr()

template<class OptionsT, bool IsReverse, bool IsConst>
node_pointer llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::getNodePtr ( ) const
inline

◆ getNonConst()

template<class OptionsT, bool IsReverse, bool IsConst>
ilist_iterator<OptionsT, IsReverse, false> llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::getNonConst ( ) const
inline

Const-cast.

Definition at line 130 of file ilist_iterator.h.

◆ getReverse()

template<class OptionsT, bool IsReverse, bool IsConst>
ilist_iterator<OptionsT, !IsReverse, IsConst> llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::getReverse ( ) const
inline

Get a reverse iterator to the same node.

Gives a reverse iterator that will dereference (and have a handle) to the same node. Converting the endpoint iterators in a range will give a different range; for range operations, use the explicit conversions.

Definition at line 123 of file ilist_iterator.h.

Referenced by llvm::createLanaiDelaySlotFillerPass(), findLiveSetAtInst(), llvm::slpvectorizer::BoUpSLP::getSpillCost(), isObjectDereferencedInBlock(), and llvm::slpvectorizer::BoUpSLP::optimizeGatherSequence().

◆ isEnd()

template<class OptionsT, bool IsReverse, bool IsConst>
bool llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::isEnd ( ) const
inline

Check for end. Only valid if ilist_sentinel_tracking<true>.

Definition at line 177 of file ilist_iterator.h.

◆ operator*()

template<class OptionsT, bool IsReverse, bool IsConst>
reference llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::operator* ( ) const
inline

Definition at line 139 of file ilist_iterator.h.

References assert().

◆ operator++() [1/2]

template<class OptionsT, bool IsReverse, bool IsConst>
ilist_iterator& llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::operator++ ( )
inline

Definition at line 158 of file ilist_iterator.h.

References llvm::ilist_detail::NodeAccess::getPrev().

◆ operator++() [2/2]

template<class OptionsT, bool IsReverse, bool IsConst>
ilist_iterator llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::operator++ ( int  )
inline

Definition at line 167 of file ilist_iterator.h.

◆ operator--() [1/2]

template<class OptionsT, bool IsReverse, bool IsConst>
ilist_iterator& llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::operator-- ( )
inline

Definition at line 154 of file ilist_iterator.h.

References llvm::ilist_detail::NodeAccess::getNext().

◆ operator--() [2/2]

template<class OptionsT, bool IsReverse, bool IsConst>
ilist_iterator llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::operator-- ( int  )
inline

Definition at line 162 of file ilist_iterator.h.

◆ operator->()

template<class OptionsT, bool IsReverse, bool IsConst>
pointer llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::operator-> ( ) const
inline

Definition at line 143 of file ilist_iterator.h.

References llvm::operator*().

◆ operator=()

template<class OptionsT, bool IsReverse, bool IsConst>
template<bool RHSIsConst>
std::enable_if<IsConst || !RHSIsConst, ilist_iterator &>::type llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::operator= ( const ilist_iterator< OptionsT, IsReverse, RHSIsConst > &  RHS)
inline

Definition at line 101 of file ilist_iterator.h.

Friends And Related Function Documentation

◆ operator!=

template<class OptionsT, bool IsReverse, bool IsConst>
bool operator!= ( const ilist_iterator< OptionsT, IsReverse, IsConst > &  LHS,
const ilist_iterator< OptionsT, IsReverse, IsConst > &  RHS 
)
friend

Definition at line 149 of file ilist_iterator.h.

◆ operator==

template<class OptionsT, bool IsReverse, bool IsConst>
bool operator== ( const ilist_iterator< OptionsT, IsReverse, IsConst > &  LHS,
const ilist_iterator< OptionsT, IsReverse, IsConst > &  RHS 
)
friend

Definition at line 146 of file ilist_iterator.h.


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