UseListShuffleVector: Remove copy constructor
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 29 Jul 2014 20:45:52 +0000 (20:45 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 29 Jul 2014 20:45:52 +0000 (20:45 +0000)
Remove the copy constructor added in r214178 to appease MSVC17 since it
shouldn't be called at all.  My guess is that explicitly deleting it
will make the compiler happy.  To round out the operations I've also
deleted copy assignment and added move assignment.  Otherwise no
functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214213 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/UseListOrder.h

index 420e6d409bdb66f50cf74d0c0b29af950e6c05e7..33c3a018ef12ef234ed69ea92f5563ee356f77ea 100644 (file)
@@ -51,15 +51,17 @@ class UseListShuffleVector {
     X.Size = 0;
   }
 
+  UseListShuffleVector(const UseListShuffleVector &X) LLVM_DELETED_FUNCTION;
+  UseListShuffleVector &
+  operator=(const UseListShuffleVector &X) LLVM_DELETED_FUNCTION;
+
 public:
   UseListShuffleVector() : Size(0) {}
   UseListShuffleVector(UseListShuffleVector &&X) { moveUnchecked(X); }
-  UseListShuffleVector(const UseListShuffleVector &X) {
-    std::memcpy(this, &X, sizeof(UseListShuffleVector));
-    if (!isSmall()) {
-      Storage.Ptr = new unsigned[Size];
-      std::memcpy(Storage.Ptr, X.Storage.Ptr, Size * sizeof(*Storage.Ptr));
-    }
+  UseListShuffleVector &operator=(UseListShuffleVector &&X) {
+    destroy();
+    moveUnchecked(X);
+    return *this;
   }
   explicit UseListShuffleVector(size_t Size) : Size(Size) {
     if (!isSmall())