24#ifndef LLVM_ADT_ILIST_H
25#define LLVM_ADT_ILIST_H
71 template <
class Iterator>
82template <
typename NodeTy>
89template <
typename NodeTy>
109template <
class IntrusiveListT,
class TraitsT>
114 typedef typename base_list_type::pointer
pointer;
121 typedef typename base_list_type::iterator
iterator;
152 using base_list_type::begin;
153 using base_list_type::end;
154 using base_list_type::rbegin;
155 using base_list_type::rend;
156 using base_list_type::empty;
157 using base_list_type::front;
158 using base_list_type::back;
161 assert(0 &&
"Swap does not use list traits callback correctly yet!");
162 base_list_type::swap(
RHS);
166 this->addNodeToList(New);
167 return base_list_type::insert(where, *New);
176 return insert(begin(), New);
178 return insert(++where, New);
190 this->removeNodeFromList(
Node);
191 base_list_type::remove(*
Node);
205 this->deleteNode(
remove(where));
224 if (position == last)
228 this->transferNodesFromList(L2, first, last);
230 base_list_type::splice(position, L2, first, last);
238 using base_list_type::size;
241 while (first != last)
242 first =
erase(first);
252 assert(!empty() &&
"pop_front() on empty list!");
256 assert(!empty() &&
"pop_back() on empty list!");
262 for (; first != last; ++first)
insert(where, *first);
268 transfer(where, L2, L2.begin(), L2.end());
272 if (where == first || where == last)
return;
273 transfer(where, L2, first, last);
276 if (first != last) transfer(where, L2, first, last);
285 template <
class Compare>
290 base_list_type::merge(
Right, comp);
294 using base_list_type::sort;
298 auto I =
N.getIterator();
301 return &*std::prev(
I);
310 auto Next = std::next(
N.getIterator());
328 :
public iplist_impl<simple_ilist<T, Options...>, ilist_traits<T>> {
339 *
static_cast<iplist_impl_type *
>(
this) = std::move(
X);
static cl::opt< ITMode > IT(cl::desc("IT block support"), cl::Hidden, cl::init(DefaultIT), cl::values(clEnumValN(DefaultIT, "arm-default-it", "Generate any type of IT block"), clEnumValN(RestrictedIT, "arm-restrict-it", "Disallow complex IT blocks")))
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A wrapper around an intrusive list with callbacks and non-intrusive ownership.
iterator erase(reference IT)
iterator erase(iterator first, iterator last)
void splice(iterator where, iplist_impl &L2, iterator first, iterator last)
base_list_type::reference reference
void splice(iterator where, iplist_impl &L2, reference N)
void splice(iterator where, iplist_impl &L2)
base_list_type::value_type value_type
base_list_type::const_reverse_iterator const_reverse_iterator
void push_back(pointer val)
base_list_type::reverse_iterator reverse_iterator
void swap(iplist_impl &RHS)
base_list_type::const_iterator const_iterator
base_list_type::iterator iterator
void insert(iterator where, InIt first, InIt last)
iplist_impl(const iplist_impl &)=delete
pointer getPrevNode(reference N) const
Get the previous node, or nullptr for the list head.
iterator erase(pointer IT)
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.
iterator insert(iterator where, const_reference New)
base_list_type::size_type size_type
base_list_type::difference_type difference_type
base_list_type::pointer pointer
iterator erase(iterator where)
pointer remove(iterator &IT)
iplist_impl(iplist_impl &&X)
base_list_type::const_reference const_reference
void splice(iterator where, iplist_impl &L2, iterator first)
iterator insertAfter(iterator where, pointer New)
void splice(iterator where, iplist_impl &L2, pointer N)
void push_front(pointer val)
void clearAndLeakNodesUnsafely()
Remove all nodes from the list like clear(), but do not call removeNodeFromList() or deleteNode().
iplist_impl & operator=(iplist_impl &&X)
iterator insert(iterator where, pointer New)
pointer remove(const iterator &IT)
pointer remove(pointer IT)
void merge(iplist_impl &Right)
void merge(iplist_impl &Right, Compare comp)
iplist_impl & operator=(const iplist_impl &)=delete
size_type max_size() const
void cloneFrom(const iplist_impl &L2, Cloner clone)
Clone another list.
base_list_type::const_pointer const_pointer
pointer remove(reference IT)
const_pointer getPrevNode(const_reference N) const
Get the previous node, or nullptr for the list head.
An intrusive list with ownership and callbacks specified/controlled by ilist_traits,...
iplist & operator=(iplist &&X)
iplist & operator=(const iplist &X)=delete
iplist(const iplist &X)=delete
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Use delete by default for iplist and ilist.
static void deleteNode(NodeTy *V)
Callbacks do nothing by default in iplist and ilist.
void removeNodeFromList(NodeTy *)
void addNodeToList(NodeTy *)
void transferNodesFromList(ilist_callback_traits &OldList, Iterator, Iterator)
Callback before transferring nodes to this list.
Custom traits to do nothing on deletion.
static void deleteNode(NodeTy *V)
A fragment for template traits for intrusive list that provides default node related operations.
Template traits for intrusive list.