Go to the documentation of this file.
24 #ifndef LLVM_ADT_ILIST_H
25 #define LLVM_ADT_ILIST_H
71 template <
class Iterator>
82 template <
typename NodeTy>
89 template <
typename NodeTy>
95 namespace ilist_detail {
97 template <
class T>
T &
make();
107 static Yes &
test(U *
I, decltype(
I->getNext(&make<NodeT>())) * =
nullptr);
108 template <
class>
static No &
test(...);
111 static const bool value =
sizeof(test<TraitsT>(
nullptr)) ==
sizeof(
Yes);
121 static Yes &
test(U *
I, decltype(
I->createSentinel()) * =
nullptr);
122 template <
class>
static No &
test(...);
125 static const bool value =
sizeof(test<TraitsT>(
nullptr)) ==
sizeof(
Yes);
137 static Yes &
test(U *
I, decltype(
I->createNode(make<NodeT>())) * = 0);
138 template <
class>
static No &
test(...);
141 static const bool value =
sizeof(test<TraitsT>(
nullptr)) ==
sizeof(
Yes);
166 template <
class IntrusiveListT,
class TraitsT>
190 "ilist customization points have changed!");
220 using base_list_type::empty;
221 using base_list_type::front;
222 using base_list_type::back;
225 assert(0 &&
"Swap does not use list traits callback correctly yet!");
230 this->addNodeToList(New);
231 return base_list_type::insert(where, *New);
242 return insert(++where, New);
254 this->removeNodeFromList(
Node);
269 this->deleteNode(
remove(where));
288 if (position ==
last)
292 this->transferNodesFromList(
L2, first,
last);
294 base_list_type::splice(position,
L2, first,
last);
305 while (first !=
last)
306 first =
erase(first);
316 assert(!empty() &&
"pop_front() on empty list!");
320 assert(!empty() &&
"pop_back() on empty list!");
326 for (; first !=
last; ++first)
insert(where, *first);
332 transfer(where,
L2,
L2.begin(),
L2.end());
336 if (where == first || where ==
last)
return;
337 transfer(where,
L2, first,
last);
340 if (first !=
last) transfer(where,
L2, first,
last);
349 template <
class Compare>
362 auto I =
N.getIterator();
365 return &*std::prev(
I);
374 auto Next = std::next(
N.getIterator());
390 template <
class T,
class...
Options>
392 :
public iplist_impl<simple_ilist<T, Options...>, ilist_traits<T>> {
403 *
static_cast<iplist_impl_type *
>(
this) =
std::move(
X);
422 #endif // LLVM_ADT_ILIST_H
iterator erase(reference IT)
This is an optimization pass for GlobalISel generic memory operations.
void merge(iplist_impl &Right)
reverse_iterator rbegin(StringRef path, Style style=Style::native)
Get reverse begin iterator over path.
void push_back(pointer val)
base_list_type::difference_type difference_type
void clearAndLeakNodesUnsafely()
Remove all nodes from the list like clear(), but do not call removeNodeFromList() or deleteNode().
base_list_type::pointer pointer
typename OptionsT::const_pointer const_pointer
iterator erase(iterator first, iterator last)
pointer getNextNode(reference N) const
Get the next node, or nullptr for the list tail.
Type trait to check for a traits class that has a createSentinel member (as a canary for any of the i...
base_list_type::const_reverse_iterator const_reverse_iterator
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")))
Callbacks do nothing by default in iplist and ilist.
void insert(iterator where, InIt first, InIt last)
const_iterator end(StringRef path)
Get end iterator over path.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
static Yes & test(U *I, decltype(I->createNode(make< NodeT >())) *=0)
pointer remove(iterator &IT)
void cloneFrom(const iplist_impl &L2, Cloner clone)
Clone another list.
An intrusive list with ownership and callbacks specified/controlled by ilist_traits,...
iplist_impl & operator=(iplist_impl &&X)
void splice(iterator where, iplist_impl &L2)
typename OptionsT::value_type value_type
iterator erase(iterator where)
base_list_type::const_reference const_reference
pointer getPrevNode(reference N) const
Get the previous node, or nullptr for the list head.
static void clear(coro::Shape &Shape)
typename OptionsT::reference reference
static void deleteNode(NodeTy *V)
void swap(iplist_impl &RHS)
iterator erase(pointer IT)
void push_front(pointer val)
void splice(iterator where, iplist_impl &L2, reference N)
iplist_impl(iplist_impl &&X)
void splice(iterator where, iplist_impl &L2, iterator first)
bitcast float %x to i32 %s=and i32 %t, 2147483647 %d=bitcast i32 %s to float ret float %d } declare float @fabsf(float %n) define float @bar(float %x) nounwind { %d=call float @fabsf(float %x) ret float %d } This IR(from PR6194):target datalayout="e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target triple="x86_64-apple-darwin10.0.0" %0=type { double, double } %struct.float3=type { float, float, float } define void @test(%0, %struct.float3 *nocapture %res) nounwind noinline ssp { entry:%tmp18=extractvalue %0 %0, 0 t
iplist_impl & operator=(const iplist_impl &)=delete
static LoopDeletionResult merge(LoopDeletionResult A, LoopDeletionResult B)
A wrapper around an intrusive list with callbacks and non-intrusive ownership.
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
base_list_type::reference reference
Type trait to check for a traits class that has a createNode member.
base_list_type::reverse_iterator reverse_iterator
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
base_list_type::const_pointer const_pointer
Template traits for intrusive list.
void merge(iplist_impl &Right, Compare comp)
A fragment for template traits for intrusive list that provides default node related operations.
void sort(IteratorTy Start, IteratorTy End)
The initial backend is deliberately restricted to z10 We should add support for later architectures at some point If an asm ties an i32 r result to an i64 the input will be treated as an leaving the upper bits uninitialised For i64 store i32 val
void swap(llvm::iplist< Ty > &Left, llvm::iplist< Ty > &Right)
base_list_type::iterator iterator
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
static Yes & test(U *I, decltype(I->createSentinel()) *=nullptr)
Use delete by default for iplist and ilist.
typename OptionsT::const_reference const_reference
static Yes & test(U *I, decltype(I->getNext(&make< NodeT >())) *=nullptr)
pointer remove(pointer IT)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
const_pointer getPrevNode(const_reference N) const
Get the previous node, or nullptr for the list head.
pointer remove(reference IT)
QP Compare Ordered outs ins xscmpudp No builtin are required Or llvm fcmp order unorder compare DP QP Compare builtin are required DP Compare
std::error_code remove(const Twine &path, bool IgnoreNonExisting=true)
Remove path.
Custom traits to do nothing on deletion.
iterator insert(iterator where, const_reference New)
void addNodeToList(NodeTy *)
When an MBB is added to an MF, we need to update the parent pointer of the MBB, the MBB numbering,...
size_type max_size() const
const_pointer getNextNode(const_reference N) const
Get the next node, or nullptr for the list tail.
pointer remove(const iterator &IT)
base_list_type::value_type value_type
Iterator for intrusive lists based on ilist_node.
void removeNodeFromList(NodeTy *)
iplist & operator=(iplist &&X)
Type trait to check for a traits class that has a getNext member (as a canary for any of the ilist_ne...
iterator insertAfter(iterator where, pointer New)
iterator insert(iterator where, pointer New)
void splice(iterator where, iplist_impl &L2, iterator first, iterator last)
static void deleteNode(NodeTy *V)
base_list_type::size_type size_type
base_list_type::const_iterator const_iterator
reverse_iterator rend(StringRef path)
Get reverse end iterator over path.
void splice(iterator where, iplist_impl &L2, pointer N)
typename OptionsT::pointer pointer
void transferNodesFromList(ilist_callback_traits &OldList, Iterator, Iterator)
Callback before transferring nodes to this list.
iplist & operator=(const iplist &X)=delete