15#ifndef LLVM_ADT_ILIST_NODE_H
16#define LLVM_ADT_ILIST_NODE_H
23namespace ilist_detail {
33 return static_cast<const NodeTy *
>(
this)->getNodeBaseParent();
36 return static_cast<NodeTy *
>(
this)->getNodeBaseParent();
39 return static_cast<NodeTy *
>(
this)->setNodeBaseParent(Parent);
46template <
class OptionsT,
bool IsReverse,
bool IsConst>
class ilist_iterator;
47template <
class OptionsT,
bool IsReverse,
bool IsConst>
52template <
bool use_iterator_bits,
typename Opts,
bool arg1,
bool arg2>
57template <
typename Opts,
bool arg1,
bool arg2>
71template <
class OptionsT>
73 : OptionsT::node_base_type,
75 typename OptionsT::parent_ty> {
76 using value_type =
typename OptionsT::value_type;
77 using node_base_type =
typename OptionsT::node_base_type;
78 using list_base_type =
typename OptionsT::list_base_type;
80 friend typename OptionsT::list_base_type;
85 typename OptionsT::parent_ty>;
144 using node_base_type::isKnownSentinel;
151 static_assert(OptionsT::is_sentinel_tracking_explicit,
152 "Use ilist_sentinel_tracking<true> to enable isSentinel()");
153 return node_base_type::isSentinel();
215 typename ilist_detail::compute_node_options<T, Options...>::type> {
217 "Unrecognized node option!");
220namespace ilist_detail {
230 template <
class OptionsT>
235 template <
class OptionsT>
241 template <
class OptionsT>
243 return static_cast<typename OptionsT::pointer
>(
N);
246 template <
class OptionsT>
247 static typename OptionsT::const_pointer
249 return static_cast<typename OptionsT::const_pointer
>(
N);
252 template <
class OptionsT>
257 template <
class OptionsT>
262 template <
class OptionsT>
268 template <
class OptionsT>
282 return NodeAccess::getNodePtr<OptionsT>(
N);
286 return NodeAccess::getNodePtr<OptionsT>(
N);
290 return NodeAccess::getValuePtr<OptionsT>(
N);
294 return NodeAccess::getValuePtr<OptionsT>(
N);
300template <
class OptionsT>
304 this->initializeSentinel();
313 bool empty()
const {
return this == this->getPrev(); }
320template <
typename NodeTy,
typename ParentTy,
class...
Options>
331 const ParentTy *getNodeParent()
const {
332 return static_cast<const NodeTy *
>(
this)->
getParent();
343 getNodeParent()->*(ParentTy::getSublistAccess((NodeTy *)
nullptr));
344 return List.getPrevNode(*
static_cast<NodeTy *
>(
this));
357 getNodeParent()->*(ParentTy::getSublistAccess((NodeTy *)
nullptr));
358 return List.getNextNode(*
static_cast<NodeTy *
>(
this));
Given that RA is a live value
Mixin base class that is used to add getParent() and setParent(ParentTy*) methods to ilist_node_impl ...
const ParentTy * getParent() const
void setParent(ParentTy *Parent)
Iterator for intrusive lists based on ilist_node.
Iterator for intrusive lists based on ilist_node.
Implementation for an ilist node.
ilist_node_impl()=default
bool isSentinel() const
Check whether this is the sentinel node.
typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, true, false >::type reverse_self_iterator
typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, true >::type const_self_iterator
const_reverse_self_iterator getReverseIterator() const
typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, false >::type self_iterator
typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, true, true >::type const_reverse_self_iterator
const_self_iterator getIterator() const
reverse_self_iterator getReverseIterator()
self_iterator getIterator()
An ilist node that can access its parent list.
const NodeTy * getPrevNode() const
Get the previous node, or nullptr for the list head.
NodeTy * getNextNode()
Get the next node, or nullptr for the list tail.
const NodeTy * getNextNode() const
Get the next node, or nullptr for the list tail.
ilist_node_with_parent()=default
This is an optimization pass for GlobalISel generic memory operations.
An access class for ilist_node private API.
static ilist_node_impl< OptionsT > * getPrev(ilist_node_impl< OptionsT > &N)
static const ilist_node_impl< OptionsT > * getNext(const ilist_node_impl< OptionsT > &N)
static ilist_node_impl< OptionsT > * getNext(ilist_node_impl< OptionsT > &N)
static const ilist_node_impl< OptionsT > * getPrev(const ilist_node_impl< OptionsT > &N)
static ilist_node_impl< OptionsT > * getNodePtr(typename OptionsT::pointer N)
static const ilist_node_impl< OptionsT > * getNodePtr(typename OptionsT::const_pointer N)
static OptionsT::pointer getValuePtr(ilist_node_impl< OptionsT > *N)
static OptionsT::const_pointer getValuePtr(const ilist_node_impl< OptionsT > *N)
static pointer getValuePtr(node_type *N)
typename OptionsT::const_pointer const_pointer
static const_pointer getValuePtr(const node_type *N)
static const node_type * getNodePtr(const_pointer N)
static node_type * getNodePtr(pointer N)
typename OptionsT::pointer pointer
Check whether options are valid.