summaryrefslogtreecommitdiff
path: root/include/llvm/IR/Value.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/IR/Value.h')
-rw-r--r--include/llvm/IR/Value.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/IR/Value.h b/include/llvm/IR/Value.h
index a4b48d7f3539b..00f8213992574 100644
--- a/include/llvm/IR/Value.h
+++ b/include/llvm/IR/Value.h
@@ -482,6 +482,17 @@ public:
static_cast<const Value *>(this)->stripPointerCasts());
}
+ /// \brief Strip off pointer casts, all-zero GEPs, aliases and barriers.
+ ///
+ /// Returns the original uncasted value. If this is called on a non-pointer
+ /// value, it returns 'this'. This function should be used only in
+ /// Alias analysis.
+ const Value *stripPointerCastsAndBarriers() const;
+ Value *stripPointerCastsAndBarriers() {
+ return const_cast<Value *>(
+ static_cast<const Value *>(this)->stripPointerCastsAndBarriers());
+ }
+
/// \brief Strip off pointer casts and all-zero GEPs.
///
/// Returns the original uncasted value. If this is called on a non-pointer