From 4cf735b47e417f0ff4d0ce4e8b2d136c1fcb55b9 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Fri, 2 Mar 2007 23:03:17 +0000 Subject: [PATCH] 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 --- lib/Transforms/Utils/LowerAllocations.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp index 0213daf38c7..8acaeed26b9 100644 --- a/lib/Transforms/Utils/LowerAllocations.cpp +++ b/lib/Transforms/Utils/LowerAllocations.cpp @@ -121,7 +121,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) { if (MI->isArrayAllocation()) { if (isa(MallocArg) && - cast(MallocArg)->getZExtValue() == 1) { + cast(MallocArg)->isOne()) { MallocArg = MI->getOperand(0); // Operand * 1 = Operand } else if (Constant *CO = dyn_cast(MI->getOperand(0))) { CO = ConstantExpr::getIntegerCast(CO, IntPtrTy, false /*ZExt*/);