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 | 43376a74af423286955a04a7a0ddb5918669ac6d (patch) | |
| tree | 3b1b46965a6e5124a152612e3719e3da83d9bb1a /llvm/lib/Transforms | |
| parent | bb38d79ad6718ca71fdc0808048d525b041515b9 (diff) | |
| download | llvm-43376a74af423286955a04a7a0ddb5918669ac6d.zip llvm-43376a74af423286955a04a7a0ddb5918669ac6d.tar.gz llvm-43376a74af423286955a04a7a0ddb5918669ac6d.tar.bz2 | |
Use APInt safe isOne() method on ConstantInt instead of getZExtValue()==1
llvm-svn: 34854
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Utils/LowerAllocations.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerAllocations.cpp b/llvm/lib/Transforms/Utils/LowerAllocations.cpp index 0213daf..8acaeed 100644 --- a/llvm/lib/Transforms/Utils/LowerAllocations.cpp +++ b/llvm/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*/); |
