summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-05-06 01:48:55 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-05-06 01:48:55 +0000
commiteaf14786ca3975266ed7041ac242122c02baf1cf (patch)
treedf9d224b2e6f54b3dc537fd7dda76ab372b77a22 /include
parentf93b6d2ec56e56113d52f263a92ed2bcfa3acefb (diff)
downloadllvm-eaf14786ca3975266ed7041ac242122c02baf1cf.tar.gz
llvm-eaf14786ca3975266ed7041ac242122c02baf1cf.tar.bz2
llvm-eaf14786ca3975266ed7041ac242122c02baf1cf.tar.xz
Fix const merging when an alias of a const is llvm.used.
We used to disable constant merging not only if a constant is llvm.used, but also if an alias of a constant is llvm.used. This change fixes that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/IR/Value.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/llvm/IR/Value.h b/include/llvm/IR/Value.h
index fb61a2ac70..5fba3d5714 100644
--- a/include/llvm/IR/Value.h
+++ b/include/llvm/IR/Value.h
@@ -260,14 +260,24 @@ public:
/// this value.
bool hasValueHandle() const { return HasValueHandle; }
- /// stripPointerCasts - This method strips off any unneeded pointer casts and
- /// all-zero GEPs from the specified value, returning the original uncasted
- /// value. If this is called on a non-pointer value, it returns 'this'.
+ /// \brief This method strips off any unneeded pointer casts,
+ /// all-zero GEPs and aliases from the specified value, returning the original
+ /// uncasted value. If this is called on a non-pointer value, it returns
+ /// 'this'.
Value *stripPointerCasts();
const Value *stripPointerCasts() const {
return const_cast<Value*>(this)->stripPointerCasts();
}
+ /// \brief This method strips off any unneeded pointer casts and
+ /// all-zero GEPs from the specified value, returning the original
+ /// uncasted value. If this is called on a non-pointer value, it returns
+ /// 'this'.
+ Value *stripPointerCastsNoFollowAliases();
+ const Value *stripPointerCastsNoFollowAliases() const {
+ return const_cast<Value*>(this)->stripPointerCastsNoFollowAliases();
+ }
+
/// stripInBoundsConstantOffsets - This method strips off unneeded pointer casts and
/// all-constant GEPs from the specified value, returning the original
/// pointer value. If this is called on a non-pointer value, it returns