diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-05-07 22:54:15 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-05-07 22:54:15 +0000 |
commit | 48fc88fa541d9084daf3ade6e4df2046ad9736e2 (patch) | |
tree | 5c4aa1539ace252ca8f271594cf67c82ceff4dac /include | |
parent | be46ae1bb4c0236202351795fcb54ef7a9e4529b (diff) | |
download | external_llvm-48fc88fa541d9084daf3ade6e4df2046ad9736e2.zip external_llvm-48fc88fa541d9084daf3ade6e4df2046ad9736e2.tar.gz external_llvm-48fc88fa541d9084daf3ade6e4df2046ad9736e2.tar.bz2 |
Turn StripPointerCast() into a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50836 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/IntrinsicInst.h | 6 | ||||
-rw-r--r-- | include/llvm/Value.h | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/llvm/IntrinsicInst.h b/include/llvm/IntrinsicInst.h index 494eaae..c674e47 100644 --- a/include/llvm/IntrinsicInst.h +++ b/include/llvm/IntrinsicInst.h @@ -183,7 +183,7 @@ namespace llvm { /// getDest - This is just like getRawDest, but it strips off any cast /// instructions that feed it, giving the original input. The returned /// value is guaranteed to be a pointer. - Value *getDest() const { return StripPointerCasts(getRawDest()); } + Value *getDest() const { return getRawDest()->stripPointerCasts(); } /// set* - Set the specified arguments of the instruction. /// @@ -234,7 +234,7 @@ namespace llvm { /// getSource - This is just like getRawSource, but it strips off any cast /// instructions that feed it, giving the original input. The returned /// value is guaranteed to be a pointer. - Value *getSource() const { return StripPointerCasts(getRawSource()); } + Value *getSource() const { return getRawSource()->stripPointerCasts(); } void setSource(Value *Ptr) { @@ -264,7 +264,7 @@ namespace llvm { /// getSource - This is just like getRawSource, but it strips off any cast /// instructions that feed it, giving the original input. The returned /// value is guaranteed to be a pointer. - Value *getSource() const { return StripPointerCasts(getRawSource()); } + Value *getSource() const { return getRawSource()->stripPointerCasts(); } void setSource(Value *Ptr) { assert(getRawSource()->getType() == Ptr->getType() && diff --git a/include/llvm/Value.h b/include/llvm/Value.h index e3e6474..2bcac08 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -220,6 +220,11 @@ public: /// getRawType - This should only be used to implement the vmcore library. /// const Type *getRawType() const { return Ty.getRawType(); } + + /// 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. + Value *stripPointerCasts(); }; inline std::ostream &operator<<(std::ostream &OS, const Value &V) { @@ -272,11 +277,6 @@ template <> inline bool isa_impl<GlobalValue, Value>(const Value &Val) { return isa<GlobalVariable>(Val) || isa<Function>(Val) || isa<GlobalAlias>(Val); } -/// StripPointerCasts - This function 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. -Value *StripPointerCasts(Value *Ptr); - } // End llvm namespace #endif |