X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FValue.h;h=ee7e25ac76a7aae45bbc949e3a94fb39fa6fcbdf;hb=884c70c912b699a4d14d05dcac1ac4f2d47c0f9a;hp=1d2c61ea1991a48126b4a697c3ef93bede232a6a;hpb=bfe2f407db4cfb27f7e0cebbffcd3db8d53f864c;p=oota-llvm.git diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 1d2c61ea199..ee7e25ac76a 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -165,7 +165,7 @@ public: /// bool hasNUsesOrMore(unsigned N) const; - bool isUsedInBasicBlock(BasicBlock *BB) const; + bool isUsedInBasicBlock(const BasicBlock *BB) const; /// getNumUses - This method computes the number of uses of this Value. This /// is a linear time operation. Use hasOneUse, hasNUses, or hasMoreThanNUses @@ -228,11 +228,20 @@ public: /// stripPointerCasts - This method strips off any unneeded pointer /// casts from the specified value, returning the original uncasted value. - /// Note that the returned value is guaranteed to have pointer type. + /// Note that the returned value has pointer type if the specified value does. Value *stripPointerCasts(); const Value *stripPointerCasts() const { return const_cast(this)->stripPointerCasts(); } + + /// getUnderlyingObject - This method strips off any GEP address adjustments + /// and pointer casts from the specified value, returning the original object + /// being addressed. Note that the returned value has pointer type if the + /// specified value does. + Value *getUnderlyingObject(); + const Value *getUnderlyingObject() const { + return const_cast(this)->getUnderlyingObject(); + } }; inline std::ostream &operator<<(std::ostream &OS, const Value &V) { @@ -244,11 +253,6 @@ inline raw_ostream &operator<<(raw_ostream &OS, const Value &V) { return OS; } -void Use::init(Value *V, User *) { - Val = V; - if (V) V->addUse(*this); -} - void Use::set(Value *V) { if (Val) removeFromList(); Val = V; @@ -285,7 +289,8 @@ template <> inline bool isa_impl(const Value &Val) { return Val.getValueID() == Value::GlobalAliasVal; } template <> inline bool isa_impl(const Value &Val) { - return isa(Val) || isa(Val) || isa(Val); + return isa(Val) || isa(Val) || + isa(Val); } } // End llvm namespace