[llvm-commits] CVS: llvm/lib/Transforms/Utils/LowerAllocations.cpp

Reid Spencer reid at x10sys.com
Fri Mar 2 15:03:34 PST 2007



Changes in directory llvm/lib/Transforms/Utils:

LowerAllocations.cpp updated: 1.71 -> 1.72
---
Log message:

Use APInt safe isOne() method on ConstantInt instead of getZExtValue()==1


---
Diffs of the changes:  (+1 -1)

 LowerAllocations.cpp |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Transforms/Utils/LowerAllocations.cpp
diff -u llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.71 llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.72
--- llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.71	Thu Jan 25 17:23:25 2007
+++ llvm/lib/Transforms/Utils/LowerAllocations.cpp	Fri Mar  2 17:03:17 2007
@@ -121,7 +121,7 @@
 
       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*/);






More information about the llvm-commits mailing list