diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-04 19:01:48 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-04 19:01:48 +0000 |
commit | cfee6c49ea9186bd397766f51706521ff3dfa57f (patch) | |
tree | 2542aefa93fa2573c7e9072c85f69017ee71efbb /lib/Analysis | |
parent | dcac1523c0db69547fe0f929690875ef23299a9a (diff) | |
download | llvm-cfee6c49ea9186bd397766f51706521ff3dfa57f.tar.gz llvm-cfee6c49ea9186bd397766f51706521ff3dfa57f.tar.bz2 llvm-cfee6c49ea9186bd397766f51706521ff3dfa57f.tar.xz |
Add a Constant version of stripPointerCasts.
Thanks to rnk for the suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/ConstantFolding.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index 0ac1cb56aa..f1294dea97 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/lib/Analysis/ConstantFolding.cpp @@ -706,7 +706,7 @@ static Constant *CastGEPIndices(ArrayRef<Constant *> Ops, static Constant* StripPtrCastKeepAS(Constant* Ptr) { assert(Ptr->getType()->isPointerTy() && "Not a pointer type"); PointerType *OldPtrTy = cast<PointerType>(Ptr->getType()); - Ptr = cast<Constant>(Ptr->stripPointerCasts()); + Ptr = Ptr->stripPointerCasts(); PointerType *NewPtrTy = cast<PointerType>(Ptr->getType()); // Preserve the address space number of the pointer. |