diff options
author | Micah Villmow <villmow@gmail.com> | 2012-10-24 18:36:13 +0000 |
---|---|---|
committer | Micah Villmow <villmow@gmail.com> | 2012-10-24 18:36:13 +0000 |
commit | b52fb876171e3670e7307fda4459ca005d49d9f5 (patch) | |
tree | e3327db438225073f62c4f4733c814082c9abfe5 /lib/Transforms/Scalar/SROA.cpp | |
parent | 199063ea37d8cc651a20ab00eef4326cd9331371 (diff) | |
download | external_llvm-b52fb876171e3670e7307fda4459ca005d49d9f5.zip external_llvm-b52fb876171e3670e7307fda4459ca005d49d9f5.tar.gz external_llvm-b52fb876171e3670e7307fda4459ca005d49d9f5.tar.bz2 |
Add some cleanup to the DataLayout changes requested by Chandler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SROA.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SROA.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp index 71c6225..728ce99 100644 --- a/lib/Transforms/Scalar/SROA.cpp +++ b/lib/Transforms/Scalar/SROA.cpp @@ -2364,8 +2364,9 @@ private: Value *getAdjustedAllocaPtr(IRBuilder<> &IRB, Type *PointerTy) { assert(BeginOffset >= NewAllocaBeginOffset); - unsigned AS = cast<PointerType>(PointerTy)->getAddressSpace(); - APInt Offset(TD.getPointerSizeInBits(AS), BeginOffset - NewAllocaBeginOffset); + assert(PointerTy->isPointerTy() && + "Type must be pointer type!"); + APInt Offset(TD.getTypeSizeInBits(PointerTy), BeginOffset - NewAllocaBeginOffset); return getAdjustedPtr(IRB, TD, &NewAI, Offset, PointerTy, getName("")); } @@ -2687,9 +2688,8 @@ private: = P.getMemTransferOffsets(II); assert(OldPtr->getType()->isPointerTy() && "Must be a pointer type!"); - unsigned AS = cast<PointerType>(OldPtr->getType())->getAddressSpace(); // Compute the relative offset within the transfer. - unsigned IntPtrWidth = TD.getPointerSizeInBits(AS); + unsigned IntPtrWidth = TD.getTypeSizeInBits(OldPtr->getType()); APInt RelOffset(IntPtrWidth, BeginOffset - (IsDest ? MTO.DestBegin : MTO.SourceBegin)); |