Of course, the copy ctor really should copy the operand as well
authorChris Lattner <sabre@nondot.org>
Sat, 23 Aug 2003 20:06:38 +0000 (20:06 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 23 Aug 2003 20:06:38 +0000 (20:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8077 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/ValueHolder.h

index aacdb5b75e57d6339e9717b3f1793b1934566674..cba246351f89990730aa73b44d2c77a33f28ac2e 100644 (file)
 
 struct ValueHolder : public User {
   ValueHolder(Value *V = 0);
-  ValueHolder(const ValueHolder &VH) : User(VH.getType(), Value::TypeVal) {}
+  ValueHolder(const ValueHolder &VH) : User(VH.getType(), Value::TypeVal) {
+    Operands.push_back(Use(VH.get(), this));
+  }
 
   // Getters...
-  const Value *get() const { return getOperand(0); }
-  operator const Value*() const { return getOperand(0); }
-  Value *get() { return getOperand(0); }
-  operator Value*() { return getOperand(0); }
+  Value *get() const { return (Value*)getOperand(0); }
+  operator Value*() const { return (Value*)getOperand(0); }
 
   // Setters...
   const ValueHolder &operator=(Value *V) {