From: Reid Spencer Date: Sat, 18 Jun 2005 17:37:34 +0000 (+0000) Subject: Clean up some uninitialized variables and missing return statements that X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=4b828e6384e1e6c9936130dd9fe805c2140b05fc;p=oota-llvm.git Clean up some uninitialized variables and missing return statements that GCC 4.0.0 compiler (sometimes incorrectly) warns about under release build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22249 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/PPCBranchSelector.cpp b/lib/Target/PowerPC/PPCBranchSelector.cpp index 7ace3c10d43..fdf1dd338a7 100644 --- a/lib/Target/PowerPC/PPCBranchSelector.cpp +++ b/lib/Target/PowerPC/PPCBranchSelector.cpp @@ -43,8 +43,9 @@ namespace { case PPC::IMPLICIT_DEF: // no asm emitted return 0; default: - return 4; // PowerPC instructions are all 4 bytes + break; } + return 4; // PowerPC instructions are all 4 bytes } virtual bool runOnMachineFunction(MachineFunction &Fn) { diff --git a/lib/Target/SparcV9/SparcV9BurgISel.cpp b/lib/Target/SparcV9/SparcV9BurgISel.cpp index ef3f9e09e45..be1baa3fe00 100644 --- a/lib/Target/SparcV9/SparcV9BurgISel.cpp +++ b/lib/Target/SparcV9/SparcV9BurgISel.cpp @@ -2915,8 +2915,9 @@ extern bool ThisIsAChainRule(int eruleno) { return true; break; default: - return false; break; + break; } + return false; } /// GetInstructionsByRule - Choose machine instructions for the diff --git a/lib/Target/SparcV9/SparcV9CodeEmitter.cpp b/lib/Target/SparcV9/SparcV9CodeEmitter.cpp index 06131616342..d977ff94ca3 100644 --- a/lib/Target/SparcV9/SparcV9CodeEmitter.cpp +++ b/lib/Target/SparcV9/SparcV9CodeEmitter.cpp @@ -56,7 +56,7 @@ unsigned SparcV9CodeEmitter::getRealRegNum(unsigned fakeReg, MachineInstr &MI) { const SparcV9RegInfo &RI = *TM.getRegInfo(); - unsigned regClass, regType = RI.getRegType(fakeReg); + unsigned regClass = 0, regType = RI.getRegType(fakeReg); // At least map fakeReg into its class fakeReg = RI.getClassRegNum(fakeReg, regClass); diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 83998c8bc2d..55dd09846e6 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -757,7 +757,7 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) { 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 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) { 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::visitStoreInst(StoreInst &SI) { 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)) &&