mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-12 16:25:18 +00:00
Use APInt safe isOne() method on ConstantInt instead of getZExtValue()==1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34854 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -121,7 +121,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
|
|||||||
|
|
||||||
if (MI->isArrayAllocation()) {
|
if (MI->isArrayAllocation()) {
|
||||||
if (isa<ConstantInt>(MallocArg) &&
|
if (isa<ConstantInt>(MallocArg) &&
|
||||||
cast<ConstantInt>(MallocArg)->getZExtValue() == 1) {
|
cast<ConstantInt>(MallocArg)->isOne()) {
|
||||||
MallocArg = MI->getOperand(0); // Operand * 1 = Operand
|
MallocArg = MI->getOperand(0); // Operand * 1 = Operand
|
||||||
} else if (Constant *CO = dyn_cast<Constant>(MI->getOperand(0))) {
|
} else if (Constant *CO = dyn_cast<Constant>(MI->getOperand(0))) {
|
||||||
CO = ConstantExpr::getIntegerCast(CO, IntPtrTy, false /*ZExt*/);
|
CO = ConstantExpr::getIntegerCast(CO, IntPtrTy, false /*ZExt*/);
|
||||||
|
Reference in New Issue
Block a user