9#ifndef LLVM_ADT_SIMPLE_ILIST_H
10#define LLVM_ADT_SIMPLE_ILIST_H
77template <
typename T,
class...
Options>
81 typename ilist_detail::compute_node_options<T, Options...>::type> {
83 "Unrecognized node option!");
86 using list_base_type =
typename OptionsT::list_base_type;
91 using pointer =
typename OptionsT::pointer;
166 list_base_type::insertBefore(*
I.getNodePtr(), *this->getNodePtr(&
Node));
171 template <
class Iterator>
178 template <
class Cloner,
class Disposer>
192 template <
class Disposer>
203 assert(
I !=
end() &&
"Cannot remove end of list!");
212 list_base_type::removeRange(*
First.getNodePtr(), *
Last.getNodePtr());
217 template <
class Disposer>
219 auto Next = std::next(
I);
226 template <
class Disposer>
255 list_base_type::transferBefore(*
I.getNodePtr(), *
First.getNodePtr(),
270 template <
class Compare>
void sort(Compare comp);
275template <
class Compare>
277 if (
this == &
RHS ||
RHS.empty())
282 if (comp(*RI, *LI)) {
285 RI = std::find_if(RI, RE, [&](
reference RV) {
return !comp(RV, *LI); });
286 splice(LI,
RHS, RunStart, RI);
293 splice(LE,
RHS, RI, RE);
297template <
class Compare>
300 if (empty() || std::next(begin()) == end())
305 while (
End != end() && ++
End != end()) {
Given that RA is a live value
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
static LoopDeletionResult merge(LoopDeletionResult A, LoopDeletionResult B)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A simple intrusive list implementation.
typename OptionsT::reference reference
iterator eraseAndDispose(iterator First, iterator Last, Disposer dispose)
Remove a range of nodes and dispose of them.
typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, true, false >::type reverse_iterator
iterator eraseAndDispose(iterator I, Disposer dispose)
Remove a node by iterator and dispose of it.
void splice(iterator I, simple_ilist &, iterator First, iterator Last)
Splice in a range of nodes from another list.
typename OptionsT::const_reference const_reference
simple_ilist(simple_ilist &&X)
simple_ilist & operator=(const simple_ilist &)=delete
const_reverse_iterator rend() const
const_reverse_iterator rbegin() const
void splice(iterator I, simple_ilist &L2)
Splice in another list.
const_reference front() const
simple_ilist & operator=(simple_ilist &&X)
void swap(simple_ilist &X)
Swap with another list in place using std::swap.
const_reference back() const
iterator erase(iterator I)
Remove a node by iterator; never deletes.
void pop_back()
Remove the node at the back; never deletes.
simple_ilist(const simple_ilist &)=delete
void push_front(reference Node)
Insert a node at the front; never copies.
void cloneFrom(const simple_ilist &L2, Cloner clone, Disposer dispose)
Clone another list.
typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, true, true >::type const_reverse_iterator
iterator insert(iterator I, reference Node)
Insert a node by reference; never copies.
void merge(simple_ilist &RHS, Compare comp)
void merge(simple_ilist &RHS)
Merge in another list.
const_iterator end() const
void clear()
Clear the list; never deletes.
void insert(iterator I, Iterator First, Iterator Last)
Insert a range of nodes; never copies.
const_iterator begin() const
typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, false >::type iterator
bool empty() const
Check if the list is empty in constant time.
void pop_front()
Remove the node at the front; never deletes.
iterator erase(iterator First, iterator Last)
Remove a range of nodes; never deletes.
typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, true >::type const_iterator
typename OptionsT::value_type value_type
void push_back(reference Node)
Insert a node at the back; never copies.
typename OptionsT::const_pointer const_pointer
void sort()
Sort the list.
void splice(iterator I, simple_ilist &L2, iterator Node)
Splice in a node from another list.
reverse_iterator rbegin()
void remove(reference N)
Remove a node by reference; never deletes.
void clearAndDispose(Disposer dispose)
Clear the list and dispose of the nodes.
typename OptionsT::pointer pointer
size_type size() const
Calculate the size of the list in linear time.
void removeAndDispose(reference N, Disposer dispose)
Remove a node by reference and dispose of it.
This file defines the ilist_node class template, which is a convenient base class for creating classe...
This is an optimization pass for GlobalISel generic memory operations.
void sort(IteratorTy Start, IteratorTy End)
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
static node_type * getNodePtr(pointer N)
Check whether options are valid.