10 #ifndef LLVM_ADT_SIMPLE_ILIST_H 11 #define LLVM_ADT_SIMPLE_ILIST_H 78 template <
typename T,
class... Options>
82 typename ilist_detail::compute_node_options<T, Options...>::type> {
84 "Unrecognized node option!");
87 using list_base_type =
typename OptionsT::list_base_type;
92 using pointer =
typename OptionsT::pointer;
136 return std::distance(
begin(),
end());
166 template <
class Iterator>
168 for (; First != Last; ++First)
173 template <
class Cloner,
class Disposer>
187 template <
class Disposer>
198 assert(I !=
end() &&
"Cannot remove end of list!");
212 template <
class Disposer>
214 auto Next = std::next(I);
221 template <
class Disposer>
223 while (First != Last)
245 splice(I, L2, Node, std::next(Node));
269 template <
class T,
class... Options>
270 template <
class Compare>
272 if (
this == &RHS || RHS.
empty())
277 if (comp(*RI, *LI)) {
281 splice(LI, RHS, RunStart, RI);
291 template <
class T,
class... Options>
292 template <
class Compare>
300 while (End !=
end() && ++End !=
end()) {
315 #endif // LLVM_ADT_SIMPLE_ILIST_H void sort()
Sort the list.
ilist_iterator< OptionsT, false, false > iterator
void cloneFrom(const simple_ilist &L2, Cloner clone, Disposer dispose)
Clone another list.
iterator erase(iterator I)
Remove a node by iterator; never deletes.
void pop_front()
Remove the node at the front; never deletes.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This class represents lattice values for constants.
typename OptionsT::const_reference const_reference
ilist_iterator< OptionsT, false, true > const_iterator
void swap(simple_ilist &X)
Swap with another list in place using std::swap.
std::error_code remove(const Twine &path, bool IgnoreNonExisting=true)
Remove path.
void push_back(reference Node)
Insert a node at the back; never copies.
void merge(simple_ilist &RHS)
Merge in another list.
void pop_back()
Remove the node at the back; never deletes.
iterator erase(iterator First, iterator Last)
Remove a range of nodes; never deletes.
static node_type * getNodePtr(pointer N)
ilist_iterator< OptionsT, true, true > const_reverse_iterator
simple_ilist & operator=(const simple_ilist &)=delete
#define LLVM_NODISCARD
LLVM_NODISCARD - Warn if a type or return value is discarded.
ilist_iterator< OptionsT, true, false > reverse_iterator
void removeAndDispose(reference N, Disposer dispose)
Remove a node by reference and dispose of it.
void splice(iterator I, simple_ilist &L2)
Splice in another list.
A simple intrusive list implementation.
const_reverse_iterator rend() const
node_pointer getNodePtr() const
Get the underlying ilist_node.
void clear()
Clear the list; never deletes.
void insert(iterator I, Iterator First, Iterator Last)
Insert a range of nodes; never copies.
const_iterator end() const
iterator eraseAndDispose(iterator I, Disposer dispose)
Remove a node by iterator and dispose of it.
simple_ilist(simple_ilist &&X)
LLVM_NODISCARD size_type size() const
Calculate the size of the list in linear time.
typename ilist_detail::compute_node_options< MachineInstr, Options... >::type ::pointer pointer
typename ilist_detail::compute_node_options< MachineInstr, Options... >::type ::const_pointer const_pointer
auto find_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
const_reference back() const
Iterator for intrusive lists based on ilist_node.
void splice(iterator I, simple_ilist &L2, iterator Node)
Splice in a node from another list.
Check whether options are valid.
const_iterator begin() const
const_reference front() const
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
LLVM_NODISCARD bool empty() const
Check if the list is empty in constant time.
void clearAndDispose(Disposer dispose)
Clear the list and dispose of the nodes.
typename OptionsT::value_type value_type
simple_ilist & operator=(simple_ilist &&X)
iterator insert(iterator I, reference Node)
Insert a node by reference; never copies.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
iterator eraseAndDispose(iterator First, iterator Last, Disposer dispose)
Remove a range of nodes and dispose of them.
void splice(iterator I, simple_ilist &, iterator First, iterator Last)
Splice in a range of nodes from another list.
const_reverse_iterator rbegin() const
typename OptionsT::reference reference
reverse_iterator rbegin()
void push_front(reference Node)
Insert a node at the front; never copies.