[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Reid Spencer reid at x10sys.com
Sat Jun 18 10:37:46 PDT 2005



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.355 -> 1.356
---
Log message:

Clean up some uninitialized variables and missing return statements that
GCC 4.0.0 compiler (sometimes incorrectly) warns about under release build.


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

 InstructionCombining.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.355 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.356
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.355	Thu Jun 16 22:59:17 2005
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Sat Jun 18 12:37:34 2005
@@ -757,7 +757,7 @@
       return BinaryOperator::createNot(Op1);
 
     // C - ~X == X + (1+C)
-    Value *X;
+    Value *X = 0;
     if (match(Op1, m_Not(m_Value(X))))
       return BinaryOperator::createAdd(X,
                     ConstantExpr::getAdd(C, ConstantInt::get(I.getType(), 1)));
@@ -852,7 +852,7 @@
                                                ConstantExpr::getNeg(DivRHS));
 
       // X - X*C --> X * (1-C)
-      ConstantInt *C2;
+      ConstantInt *C2 = 0;
       if (dyn_castFoldableMul(Op1I, C2) == Op0) {
         Constant *CP1 =
           ConstantExpr::getSub(ConstantInt::get(I.getType(), 1), C2);
@@ -5129,7 +5129,7 @@
 
 Instruction *InstCombiner::visitBranchInst(BranchInst &BI) {
   // Change br (not X), label True, label False to: br X, label False, True
-  Value *X;
+  Value *X = 0;
   BasicBlock *TrueDest;
   BasicBlock *FalseDest;
   if (match(&BI, m_Br(m_Not(m_Value(X)), TrueDest, FalseDest)) &&






More information about the llvm-commits mailing list