summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorMicah Villmow <villmow@gmail.com>2012-10-24 18:36:13 +0000
committerMicah Villmow <villmow@gmail.com>2012-10-24 18:36:13 +0000
commitbf3eeb2dfc1d7e4e4236ec1da7e20f58733b30cc (patch)
tree2514c697ab48d047ec6d2a104b35833dbf281645 /llvm/lib/Analysis/ConstantFolding.cpp
parentc9d17591d990b036df70bce2ed176357863cd417 (diff)
downloadbcm5719-llvm-bf3eeb2dfc1d7e4e4236ec1da7e20f58733b30cc.tar.gz
bcm5719-llvm-bf3eeb2dfc1d7e4e4236ec1da7e20f58733b30cc.zip
Add some cleanup to the DataLayout changes requested by Chandler.
llvm-svn: 166607
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index c0e9020d919..de6d61d78b2 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -937,8 +937,7 @@ Constant *llvm::ConstantFoldInstOperands(unsigned Opcode, Type *DestTy,
// pointer, so it can't be done in ConstantExpr::getCast.
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0]))
if (TD && CE->getOpcode() == Instruction::PtrToInt &&
- TD->getPointerSizeInBits(
- cast<PointerType>(CE->getOperand(0)->getType())->getAddressSpace())
+ TD->getTypeSizeInBits(CE->getOperand(0)->getType())
<= CE->getType()->getScalarSizeInBits())
return FoldBitCast(CE->getOperand(0), DestTy, *TD);
OpenPOWER on IntegriCloud