OSDN Git Service

Adjust to User.h changes.
authorChris Lattner <sabre@nondot.org>
Sat, 29 Jan 2005 00:30:52 +0000 (00:30 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 29 Jan 2005 00:30:52 +0000 (00:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19884 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Use.h
include/llvm/Value.h

index 88b723b..8f29394 100644 (file)
@@ -37,10 +37,17 @@ class Use {
   Use *Prev, *Next;
   friend struct ilist_traits<Use>;
 public:
-  inline Use(Value *v, User *user);
-  inline Use(const Use &u);
+  inline void init(Value *V, User *U);
+
+  Use(Value *V, User *U) { init(V, U); }
+  Use(const Use &U) { init(U.Val, U.U); }
   inline ~Use();
 
+  /// Default ctor - This leaves the Use completely unitialized.  The only thing
+  /// that is valid to do with this use is to call the "init" method.
+  inline Use() : Val(0) {}
+
+
   operator Value*() const { return Val; }
   Value *get() const { return Val; }
   User *getUser() const { return U; }
index 2e618a5..90bbe6f 100644 (file)
@@ -41,7 +41,6 @@ class SymbolTable;
 /// as operands to other values.
 ///
 class Value {
-private:
   unsigned SubclassID;               // Subclass identifier (for isa/dyn_cast)
   PATypeHolder Ty;
   iplist<Use> Uses;
@@ -168,11 +167,9 @@ inline const User *UseListConstIteratorWrapper::operator*() const {
 }
 
 
-Use::Use(Value *v, User *user) : Val(v), U(user) {
-  if (Val) Val->addUse(*this);
-}
-
-Use::Use(const Use &u) : Val(u.Val), U(u.U) {
+void Use::init(Value *v, User *user) {
+  Val = v;
+  U = user;
   if (Val) Val->addUse(*this);
 }