[llvm] r214213 - UseListShuffleVector: Remove copy constructor

David Blaikie dblaikie at gmail.com
Tue Jul 29 15:36:36 PDT 2014


On Tue, Jul 29, 2014 at 1:45 PM, Duncan P. N. Exon Smith
<dexonsmith at apple.com> wrote:
> Author: dexonsmith
> Date: Tue Jul 29 15:45:52 2014
> New Revision: 214213
>
> URL: http://llvm.org/viewvc/llvm-project?rev=214213&view=rev
> Log:
> 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.

If you're not using nor unit testing move assignment (or other
operations), I'd probably just leave it out (possibly explicitly
deleted with a comment about how someone can add it when they need
it), though I'm not adamant about this.

- David

>
> Modified:
>     llvm/trunk/include/llvm/IR/UseListOrder.h
>
> Modified: llvm/trunk/include/llvm/IR/UseListOrder.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/UseListOrder.h?rev=214213&r1=214212&r2=214213&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/IR/UseListOrder.h (original)
> +++ llvm/trunk/include/llvm/IR/UseListOrder.h Tue Jul 29 15:45:52 2014
> @@ -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())
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list