[llvm] [ADT] Add SmallVectorImpl::append_range (PR #93384)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Sat May 25 15:06:05 PDT 2024


================
@@ -701,6 +701,10 @@ class SmallVectorImpl : public SmallVectorTemplateBase<T> {
     this->set_size(this->size() + NumInputs);
   }
 
+  template <typename RangeTy> void append_range(RangeTy &&R) {
+    this->append(R.begin(), R.end());
----------------
kuhar wrote:

Does this optimize around the temporaries here and move the elements? Should we have a test for this?

https://github.com/llvm/llvm-project/pull/93384


More information about the llvm-commits mailing list