[llvm] 1bcf21c - Use std::uninitialized_move where appropriate. NFCI.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 27 05:56:59 PDT 2022


Author: Benjamin Kramer
Date: 2022-08-27T14:56:43+02:00
New Revision: 1bcf21ca7f3649387df9815e065be2a0435b5a39

URL: https://github.com/llvm/llvm-project/commit/1bcf21ca7f3649387df9815e065be2a0435b5a39
DIFF: https://github.com/llvm/llvm-project/commit/1bcf21ca7f3649387df9815e065be2a0435b5a39.diff

LOG: Use std::uninitialized_move where appropriate. NFCI.

Added: 
    

Modified: 
    llvm/include/llvm/ADT/SmallVector.h
    mlir/lib/IR/OperationSupport.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
index a29886c38e3f8..47a303568d020 100644
--- a/llvm/include/llvm/ADT/SmallVector.h
+++ b/llvm/include/llvm/ADT/SmallVector.h
@@ -335,8 +335,7 @@ class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {
   /// constructing elements as needed.
   template<typename It1, typename It2>
   static void uninitialized_move(It1 I, It1 E, It2 Dest) {
-    std::uninitialized_copy(std::make_move_iterator(I),
-                            std::make_move_iterator(E), Dest);
+    std::uninitialized_move(I, E, Dest);
   }
 
   /// Copy the range [I, E) onto the uninitialized memory starting with "Dest",

diff  --git a/mlir/lib/IR/OperationSupport.cpp b/mlir/lib/IR/OperationSupport.cpp
index 53d55ef01fdcc..33828a954c633 100644
--- a/mlir/lib/IR/OperationSupport.cpp
+++ b/mlir/lib/IR/OperationSupport.cpp
@@ -342,8 +342,7 @@ MutableArrayRef<OpOperand> detail::OperandStorage::resize(Operation *owner,
 
   // Move the current operands to the new storage.
   MutableArrayRef<OpOperand> newOperands(newOperandStorage, newSize);
-  std::uninitialized_copy(std::make_move_iterator(origOperands.begin()),
-                          std::make_move_iterator(origOperands.end()),
+  std::uninitialized_move(origOperands.begin(), origOperands.end(),
                           newOperands.begin());
 
   // Destroy the original operands.


        


More information about the llvm-commits mailing list