summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-05-07 22:54:15 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-05-07 22:54:15 +0000
commit0b12ecf6ff6b5d3a144178257b6206f0c4788792 (patch)
tree5c4aa1539ace252ca8f271594cf67c82ceff4dac /include
parent4561ab5d8199cbfe21288d06b89d8268b48e4be2 (diff)
downloadllvm-0b12ecf6ff6b5d3a144178257b6206f0c4788792.tar.gz
llvm-0b12ecf6ff6b5d3a144178257b6206f0c4788792.tar.bz2
llvm-0b12ecf6ff6b5d3a144178257b6206f0c4788792.tar.xz
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.h6
-rw-r--r--include/llvm/Value.h10
2 files changed, 8 insertions, 8 deletions
diff --git a/include/llvm/IntrinsicInst.h b/include/llvm/IntrinsicInst.h
index 494eaaec4d..c674e47b3a 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 e3e6474959..2bcac08a95 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