From 8e5c0b473af29927463ead651df5b9639c410b69 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 7 Nov 2001 14:01:59 +0000 Subject: [PATCH] Killing warnings git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1175 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/SparcV9/SparcV9InstrSelection.cpp | 6 +++--- lib/Target/SparcV9/SparcV9Internals.h | 1 + lib/Target/SparcV9/SparcV9RegInfo.cpp | 11 ++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp index 5860e146d10..bf27a2abd5f 100644 --- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp +++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp @@ -825,7 +825,7 @@ SetMemOperands_Internal(MachineInstr* minstr, MemAccessInst* memInst = (MemAccessInst*) vmInstrNode->getInstruction(); // Initialize so we default to storing the offset in a register. - int64_t smallConstOffset; + int64_t smallConstOffset = 0; Value* valueForRegOffset = NULL; MachineOperand::MachineOperandType offsetOpType =MachineOperand::MO_VirtualRegister; @@ -835,7 +835,7 @@ SetMemOperands_Internal(MachineInstr* minstr, if (idxVec.size() > 0) { bool isConstantOffset = false; - unsigned offset; + unsigned offset = 0; const PointerType* ptrType = (PointerType*) ptrVal->getType(); @@ -1616,7 +1616,7 @@ GetInstructionsByRule(InstructionNode* subtreeRoot, bool mustClearReg; int valueToMove; - MachineOpCode movOpCode; + MachineOpCode movOpCode = 0; Value* ccValue = NULL; if (subtreeRoot->leftChild()->getValue()->getType()->isIntegral() || diff --git a/lib/Target/SparcV9/SparcV9Internals.h b/lib/Target/SparcV9/SparcV9Internals.h index e7caf1399d4..d715d792a31 100644 --- a/lib/Target/SparcV9/SparcV9Internals.h +++ b/lib/Target/SparcV9/SparcV9Internals.h @@ -301,6 +301,7 @@ class UltraSparcRegInfo : public MachineRegInfo else { cerr << "TypeID: " << ty << endl; assert(0 && "Cannot resolve register class for type"); + return 0; } if(isCCReg) diff --git a/lib/Target/SparcV9/SparcV9RegInfo.cpp b/lib/Target/SparcV9/SparcV9RegInfo.cpp index 9f7d5c94fe6..6ce2df3176b 100644 --- a/lib/Target/SparcV9/SparcV9RegInfo.cpp +++ b/lib/Target/SparcV9/SparcV9RegInfo.cpp @@ -523,9 +523,10 @@ void UltraSparcRegInfo::colorCallArgs(const MachineInstr *const CallMI, CorrectCol = SparcIntRegOrder::o0; else if(RegClassID == FloatRegClassID) CorrectCol = SparcFloatRegOrder::f0; - else + else { assert( 0 && "Unknown RegClass"); - + return; + } // if the LR received the correct color, NOTHING to do @@ -787,15 +788,15 @@ void UltraSparcRegInfo::colorRetValue(const MachineInstr *const RetMI, unsigned RegClassID = getRegClassIDOfValue(RetVal); unsigned RegType = getRegType( RetVal ); - unsigned CorrectCol; if(RegClassID == IntRegClassID) CorrectCol = SparcIntRegOrder::i0; else if(RegClassID == FloatRegClassID) CorrectCol = SparcFloatRegOrder::f0; - else + else { assert( 0 && "Unknown RegClass"); - + return; + } // if the LR received the correct color, NOTHING to do