Skip to content

Commit bcb3a41

Browse files
committed
UseListShuffleVector: Remove copy constructor
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
1 parent 49d1690 commit bcb3a41

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

include/llvm/IR/UseListOrder.h

+8-6
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,17 @@ class UseListShuffleVector {
5151
X.Size = 0;
5252
}
5353

54+
UseListShuffleVector(const UseListShuffleVector &X) LLVM_DELETED_FUNCTION;
55+
UseListShuffleVector &
56+
operator=(const UseListShuffleVector &X) LLVM_DELETED_FUNCTION;
57+
5458
public:
5559
UseListShuffleVector() : Size(0) {}
5660
UseListShuffleVector(UseListShuffleVector &&X) { moveUnchecked(X); }
57-
UseListShuffleVector(const UseListShuffleVector &X) {
58-
std::memcpy(this, &X, sizeof(UseListShuffleVector));
59-
if (!isSmall()) {
60-
Storage.Ptr = new unsigned[Size];
61-
std::memcpy(Storage.Ptr, X.Storage.Ptr, Size * sizeof(*Storage.Ptr));
62-
}
61+
UseListShuffleVector &operator=(UseListShuffleVector &&X) {
62+
destroy();
63+
moveUnchecked(X);
64+
return *this;
6365
}
6466
explicit UseListShuffleVector(size_t Size) : Size(Size) {
6567
if (!isSmall())

0 commit comments

Comments
 (0)