aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-03-02 23:03:17 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-03-02 23:03:17 +0000
commit43376a74af423286955a04a7a0ddb5918669ac6d (patch)
tree3b1b46965a6e5124a152612e3719e3da83d9bb1a /llvm/lib/Transforms
parentbb38d79ad6718ca71fdc0808048d525b041515b9 (diff)
downloadllvm-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.cpp2
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*/);