diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-05-06 01:48:55 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-05-06 01:48:55 +0000 |
commit | eaf14786ca3975266ed7041ac242122c02baf1cf (patch) | |
tree | df9d224b2e6f54b3dc537fd7dda76ab372b77a22 /include/llvm/IR | |
parent | f93b6d2ec56e56113d52f263a92ed2bcfa3acefb (diff) | |
download | external_llvm-eaf14786ca3975266ed7041ac242122c02baf1cf.zip external_llvm-eaf14786ca3975266ed7041ac242122c02baf1cf.tar.gz external_llvm-eaf14786ca3975266ed7041ac242122c02baf1cf.tar.bz2 |
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/llvm/IR')
-rw-r--r-- | include/llvm/IR/Value.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/llvm/IR/Value.h b/include/llvm/IR/Value.h index fb61a2a..5fba3d5 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 |