summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/DIE.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/DIE.h')
-rw-r--r--include/llvm/CodeGen/DIE.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/DIE.h b/include/llvm/CodeGen/DIE.h
index 684f9e40ca5a..e8e7504a6cda 100644
--- a/include/llvm/CodeGen/DIE.h
+++ b/include/llvm/CodeGen/DIE.h
@@ -550,6 +550,14 @@ public:
return *static_cast<T *>(Last ? Last->Next.getPointer() : nullptr);
}
+ void takeNodes(IntrusiveBackList<T> &Other) {
+ for (auto &N : Other) {
+ N.Next.setPointerAndInt(&N, true);
+ push_back(N);
+ }
+ Other.Last = nullptr;
+ }
+
class const_iterator;
class iterator
: public iterator_facade_base<iterator, std::forward_iterator_tag, T> {
@@ -685,6 +693,10 @@ public:
return addValue(Alloc, DIEValue(Attribute, Form, std::forward<T>(Value)));
}
+ /// Take ownership of the nodes in \p Other, and append them to the back of
+ /// the list.
+ void takeValues(DIEValueList &Other) { List.takeNodes(Other.List); }
+
value_range values() {
return make_range(value_iterator(List.begin()), value_iterator(List.end()));
}