15 #ifndef LLVM_ADT_ILIST_NODE_H 16 #define LLVM_ADT_ILIST_NODE_H 23 namespace ilist_detail {
29 template <
class OptionsT,
bool IsReverse,
bool IsConst>
class ilist_iterator;
41 using value_type =
typename OptionsT::value_type;
42 using node_base_type =
typename OptionsT::node_base_type;
43 using list_base_type =
typename OptionsT::list_base_type;
45 friend typename OptionsT::list_base_type;
94 using node_base_type::isKnownSentinel;
101 static_assert(OptionsT::is_sentinel_tracking_explicit,
102 "Use ilist_sentinel_tracking<true> to enable isSentinel()");
148 template <
class T,
class... Options>
151 typename ilist_detail::compute_node_options<T, Options...>::type> {
153 "Unrecognized node option!");
156 namespace ilist_detail {
166 template <
class OptionsT>
171 template <
class OptionsT>
177 template <
class OptionsT>
179 return static_cast<typename OptionsT::pointer
>(
N);
182 template <
class OptionsT>
183 static typename OptionsT::const_pointer
185 return static_cast<typename OptionsT::const_pointer
>(
N);
188 template <
class OptionsT>
193 template <
class OptionsT>
198 template <
class OptionsT>
204 template <
class OptionsT>
218 return NodeAccess::getNodePtr<OptionsT>(
N);
222 return NodeAccess::getNodePtr<OptionsT>(
N);
226 return NodeAccess::getValuePtr<OptionsT>(
N);
230 return NodeAccess::getValuePtr<OptionsT>(
N);
236 template <
class OptionsT>
240 this->initializeSentinel();
249 bool empty()
const {
return this == this->getPrev(); }
256 template <
typename NodeTy,
typename ParentTy,
class... Options>
267 const ParentTy *getNodeParent()
const {
268 return static_cast<const NodeTy *
>(
this)->
getParent();
279 getNodeParent()->*(ParentTy::getSublistAccess((NodeTy *)
nullptr));
280 return List.getPrevNode(*static_cast<NodeTy *>(
this));
293 getNodeParent()->*(ParentTy::getSublistAccess((NodeTy *)
nullptr));
294 return List.getNextNode(*static_cast<NodeTy *>(
this));
306 #endif // LLVM_ADT_ILIST_NODE_H static const ilist_node_impl< OptionsT > * getNext(const ilist_node_impl< OptionsT > &N)
NodeTy * getNextNode()
Get the next node, or nullptr for the list tail.
This class represents lattice values for constants.
const_reverse_self_iterator getReverseIterator() const
static const ilist_node_impl< OptionsT > * getNodePtr(typename OptionsT::const_pointer N)
block Block Frequency true
static node_type * getNodePtr(pointer N)
static const node_type * getNodePtr(const_pointer N)
static pointer getValuePtr(node_type *N)
Implementation for an ilist node.
static const_pointer getValuePtr(const node_type *N)
static ilist_node_impl< OptionsT > * getNodePtr(typename OptionsT::pointer N)
static ilist_node_impl< OptionsT > * getPrev(ilist_node_impl< OptionsT > &N)
An ilist node that can access its parent list.
typename ilist_detail::compute_node_options< Instruction, Options... >::type ::pointer pointer
typename ilist_detail::compute_node_options< Instruction, Options... >::type ::const_pointer const_pointer
self_iterator getIterator()
const NodeTy * getPrevNode() const
Get the previous node, or nullptr for the list head.
static const ilist_node_impl< OptionsT > * getPrev(const ilist_node_impl< OptionsT > &N)
An access class for ilist_node private API.
static OptionsT::pointer getValuePtr(ilist_node_impl< OptionsT > *N)
Iterator for intrusive lists based on ilist_node.
Check whether options are valid.
const_self_iterator getIterator() const
static OptionsT::const_pointer getValuePtr(const ilist_node_impl< OptionsT > *N)
const NodeTy * getNextNode() const
Get the next node, or nullptr for the list tail.
reverse_self_iterator getReverseIterator()
bool isSentinel() const
Check whether this is the sentinel node.
static bool isSentinel(const DWARFDebugNames::AttributeEncoding &AE)
static const Function * getParent(const Value *V)
static ilist_node_impl< OptionsT > * getNext(ilist_node_impl< OptionsT > &N)