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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214264 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2014-07-30 00:25:33 +00:00
parent 0630cb25a1
commit f8b862d87c

View File

@ -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<UseListOrder> UseListOrderStack;