diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-03-02 23:03:17 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-03-02 23:03:17 +0000 |
commit | 4cf735b47e417f0ff4d0ce4e8b2d136c1fcb55b9 (patch) | |
tree | 31d4cf0e54dc55640d3f7cfde2079f5293bf34f8 | |
parent | e1c99d4c69d20731579ae462db39c3c1393f50fd (diff) |
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
-rw-r--r-- | lib/Transforms/Utils/LowerAllocations.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp index 0213daf38c..8acaeed26b 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<ConstantInt>(MallocArg) && - cast<ConstantInt>(MallocArg)->getZExtValue() == 1) { + cast<ConstantInt>(MallocArg)->isOne()) { MallocArg = MI->getOperand(0); // Operand * 1 = Operand } else if (Constant *CO = dyn_cast<Constant>(MI->getOperand(0))) { CO = ConstantExpr::getIntegerCast(CO, IntPtrTy, false /*ZExt*/); |