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/Analysis/ConstantFolding.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/Analysis/ConstantFolding.cpp')
-rw-r--r-- | lib/Analysis/ConstantFolding.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index c0e9020..de6d61d 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/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); |