Added LLVM copyright header (for lack of a better term).
[oota-llvm.git] / include / llvm / Support / ValueHolder.h
index aacdb5b75e57d6339e9717b3f1793b1934566674..62ab9d9ca29bb8fd90268ef86b68d19704176836 100644 (file)
@@ -1,4 +1,11 @@
 //===-- llvm/Support/ValueHolder.h - Wrapper for Value's --------*- C++ -*-===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 //
 // This class defines a simple subclass of User, which keeps a pointer to a
 // Value, which automatically updates when Value::replaceAllUsesWith is called.
 
 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) {