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 | 78598d9ab5f2fc567c9ebb6a90004ce5f0e9aa91 (patch) | |
tree | f1bcb36baf8c62883e0b50efaf62122f38628076 /llvm/lib/Analysis/ConstantFolding.cpp | |
parent | bb9e7a3d06ed7466e31db2f186732baa3deb9fb1 (diff) | |
download | bcm5719-llvm-78598d9ab5f2fc567c9ebb6a90004ce5f0e9aa91.tar.gz bcm5719-llvm-78598d9ab5f2fc567c9ebb6a90004ce5f0e9aa91.zip |
Add a Constant version of stripPointerCasts.
Thanks to rnk for the suggestion.
llvm-svn: 210205
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r-- | llvm/lib/Analysis/ConstantFolding.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index 0ac1cb56aa2..f1294dea978 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/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. |