Adjust to User.h changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19884 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-01-29 00:30:52 +00:00
parent f718e70c7e
commit b8d5b1211f
2 changed files with 12 additions and 8 deletions

View File

@ -37,10 +37,17 @@ class Use {
Use *Prev, *Next; Use *Prev, *Next;
friend struct ilist_traits<Use>; friend struct ilist_traits<Use>;
public: public:
inline Use(Value *v, User *user); inline void init(Value *V, User *U);
inline Use(const Use &u);
Use(Value *V, User *U) { init(V, U); }
Use(const Use &U) { init(U.Val, U.U); }
inline ~Use(); 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; } operator Value*() const { return Val; }
Value *get() const { return Val; } Value *get() const { return Val; }
User *getUser() const { return U; } User *getUser() const { return U; }

View File

@ -41,7 +41,6 @@ class SymbolTable;
/// as operands to other values. /// as operands to other values.
/// ///
class Value { class Value {
private:
unsigned SubclassID; // Subclass identifier (for isa/dyn_cast) unsigned SubclassID; // Subclass identifier (for isa/dyn_cast)
PATypeHolder Ty; PATypeHolder Ty;
iplist<Use> Uses; iplist<Use> Uses;
@ -168,11 +167,9 @@ inline const User *UseListConstIteratorWrapper::operator*() const {
} }
Use::Use(Value *v, User *user) : Val(v), U(user) { void Use::init(Value *v, User *user) {
if (Val) Val->addUse(*this); Val = v;
} U = user;
Use::Use(const Use &u) : Val(u.Val), U(u.U) {
if (Val) Val->addUse(*this); if (Val) Val->addUse(*this);
} }