UseListOrder: Try to resolve buildbot failure
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 29 Jul 2014 21:30:21 +0000 (21:30 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 29 Jul 2014 21:30:21 +0000 (21:30 +0000)
MSVC [1] thinks `UseListShuffleVector` needs a copy constructor, but I
don't.  Let's see if being explicit about `UseListOrder` is convincing.

[1]: http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/11664/steps/build_Lld/logs/stdio

Here's the failure:

C:/lld-x86_64_win7/lld-x86_64-win7/llvm.src/include\llvm/IR/UseListOrder.h(92): error C2248: 'llvm::UseListShuffleVector::operator =' : cannot access private member declared in class 'llvm::UseListShuffleVector' (C:\lld-x86_64_win7\lld-x86_64-win7\llvm.src\lib\Bitcode\Writer\ValueEnumerator.cpp) [C:\lld-x86_64_win7\lld-x86_64-win7\llvm.obj\lib\Bitcode\Writer\LLVMBitWriter.vcxproj]
          C:/lld-x86_64_win7/lld-x86_64-win7/llvm.src/include\llvm/IR/UseListOrder.h(56) : see declaration of 'llvm::UseListShuffleVector::operator ='
          C:/lld-x86_64_win7/lld-x86_64-win7/llvm.src/include\llvm/IR/UseListOrder.h(32) : see declaration of 'llvm::UseListShuffleVector'
          This diagnostic occurred in the compiler generated function 'llvm::UseListOrder &llvm::UseListOrder::operator =(const llvm::UseListOrder &)'

llvm-svn: 214224

llvm/include/llvm/IR/UseListOrder.h

index 33c3a01..f766231 100644 (file)
@@ -89,6 +89,20 @@ struct UseListOrder {
 
   UseListOrder(const Value *V, const Function *F, size_t ShuffleSize)
       : V(V), F(F), Shuffle(ShuffleSize) {}
+
+  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;
 };
 
 typedef std::vector<UseListOrder> UseListOrderStack;