From 79aece6f38789342979183329050b2da0cab9c16 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Wed, 30 Jul 2014 00:25:33 +0000 Subject: [PATCH] Revert "UseListOrder: Remove move assignment" This reverts commit r214260. Turns out move assignment *is* necessary for MSVC [1]. [1]: http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/9631 llvm-svn: 214264 --- llvm/include/llvm/IR/UseListOrder.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/IR/UseListOrder.h b/llvm/include/llvm/IR/UseListOrder.h index 7c4ba07..f766231 100644 --- a/llvm/include/llvm/IR/UseListOrder.h +++ b/llvm/include/llvm/IR/UseListOrder.h @@ -54,12 +54,15 @@ class UseListShuffleVector { UseListShuffleVector(const UseListShuffleVector &X) LLVM_DELETED_FUNCTION; UseListShuffleVector & operator=(const UseListShuffleVector &X) LLVM_DELETED_FUNCTION; - UseListShuffleVector & - operator=(UseListShuffleVector &&X) LLVM_DELETED_FUNCTION; public: UseListShuffleVector() : Size(0) {} UseListShuffleVector(UseListShuffleVector &&X) { moveUnchecked(X); } + UseListShuffleVector &operator=(UseListShuffleVector &&X) { + destroy(); + moveUnchecked(X); + return *this; + } explicit UseListShuffleVector(size_t Size) : Size(Size) { if (!isSmall()) Storage.Ptr = new unsigned[Size]; @@ -90,11 +93,16 @@ struct UseListOrder { UseListOrder() : V(0), F(0) {} UseListOrder(UseListOrder &&X) : V(X.V), F(X.F), Shuffle(std::move(X.Shuffle)) {} + UseListOrder &operator=(UseListOrder &&X) { + V = X.V; + F = X.F; + Shuffle = std::move(X.Shuffle); + return *this; + } private: UseListOrder(const UseListOrder &X) LLVM_DELETED_FUNCTION; UseListOrder &operator=(const UseListOrder &X) LLVM_DELETED_FUNCTION; - UseListOrder &operator=(UseListOrder &&X) LLVM_DELETED_FUNCTION; }; typedef std::vector UseListOrderStack; -- 2.7.4