diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-26 19:45:00 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-26 19:45:00 +0000 |
commit | 12f3ca4cdb95b193af905a00e722a4dcb40b3de3 (patch) | |
tree | ae1a7fcfc24a8d4b23206c57121c3f361d4b7f84 /include/llvm/IR/Value.h | |
parent | d99dafe2e4a385dd2a6c76da6d8258deb100657b (diff) |
Diffstat (limited to 'include/llvm/IR/Value.h')
-rw-r--r-- | include/llvm/IR/Value.h | 11 |
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 |