Fix warning
authorChris Lattner <sabre@nondot.org>
Sat, 9 Nov 2002 00:49:43 +0000 (00:49 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 9 Nov 2002 00:49:43 +0000 (00:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4649 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/InductionVariable.cpp
lib/CodeGen/InstrSelection/InstrSelection.cpp
lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
lib/Transforms/Scalar/InstructionCombining.cpp

index 6aaf8c018e148f66174d5e93d49b9e0bb54b4187..c71033e4607db668495a6dc3333d57962d3b2594 100644 (file)
@@ -180,7 +180,7 @@ Value* InductionVariable::getExecutionCount(LoopInfo *LoopInfo) {
   }
 
   // Find final node: predecesor of the loop header that's also an exit
-  BasicBlock *terminator;
+  BasicBlock *terminator = 0;
   BasicBlock *header = L->getHeader();
   for (pred_iterator PI = pred_begin(header), PE = pred_end(header);
        PI != PE; ++PI) {
index a2e9bb642e4eb585e45da8752cd391a2d5f5b0cc..c7bf70c806bbb546b1646c7150d9f03d2ab214f7 100644 (file)
@@ -220,7 +220,7 @@ InstructionSelection::InsertCodeForPhis(Function &F)
 
 void
 InstructionSelection::InsertPhiElimInstructions(BasicBlock *BB,
-                                                const vector<MachineInstr*>& CpVec)
+                                            const vector<MachineInstr*>& CpVec)
 { 
   Instruction *TermInst = (Instruction*)BB->getTerminator();
   MachineCodeForInstruction &MC4Term = MachineCodeForInstruction::get(TermInst);
@@ -228,10 +228,10 @@ InstructionSelection::InsertPhiElimInstructions(BasicBlock *BB,
   assert (FirstMIOfTerm && "No Machine Instrs for terminator");
 
   MachineFunction &MF = MachineFunction::get(BB->getParent());
-  MachineBasicBlock *MBB;
 
   // FIXME: if PHI instructions existed in the machine code, this would be
   // unnecesary.
+  MachineBasicBlock *MBB = 0;
   for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
     if (I->getBasicBlock() == BB) {
       MBB = I;
index a2e9bb642e4eb585e45da8752cd391a2d5f5b0cc..c7bf70c806bbb546b1646c7150d9f03d2ab214f7 100644 (file)
@@ -220,7 +220,7 @@ InstructionSelection::InsertCodeForPhis(Function &F)
 
 void
 InstructionSelection::InsertPhiElimInstructions(BasicBlock *BB,
-                                                const vector<MachineInstr*>& CpVec)
+                                            const vector<MachineInstr*>& CpVec)
 { 
   Instruction *TermInst = (Instruction*)BB->getTerminator();
   MachineCodeForInstruction &MC4Term = MachineCodeForInstruction::get(TermInst);
@@ -228,10 +228,10 @@ InstructionSelection::InsertPhiElimInstructions(BasicBlock *BB,
   assert (FirstMIOfTerm && "No Machine Instrs for terminator");
 
   MachineFunction &MF = MachineFunction::get(BB->getParent());
-  MachineBasicBlock *MBB;
 
   // FIXME: if PHI instructions existed in the machine code, this would be
   // unnecesary.
+  MachineBasicBlock *MBB = 0;
   for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
     if (I->getBasicBlock() == BB) {
       MBB = I;
index b0c15f7bf6be4241a0f6eab8a34dc7a24f793522..bc815c6e23f6095dce883cb1ea4ea976a6babf6a 100644 (file)
@@ -87,7 +87,7 @@ bool ProfilePaths::runOnFunction(Function &F){
   std::vector<Edge> edges;
 
   Node *tmp;
-  Node *exitNode, *startNode;
+  Node *exitNode = 0, *startNode = 0;
 
   // The nodes must be uniquesly identified:
   // That is, no two nodes must hav same BB*
index e540310f6b3022492228e347de4f9b42c1e1b726..f57d8b1c36bfbb94dff081061c441c2f1df8584d 100644 (file)
@@ -724,13 +724,15 @@ Instruction *InstCombiner::visitAllocationInst(AllocationInst &AI) {
   if (AI.isArrayAllocation())    // Check C != 1
     if (const ConstantUInt *C = dyn_cast<ConstantUInt>(AI.getArraySize())) {
       const Type *NewTy = ArrayType::get(AI.getAllocatedType(), C->getValue());
-      AllocationInst *New;
+      AllocationInst *New = 0;
 
       // Create and insert the replacement instruction...
       if (isa<MallocInst>(AI))
         New = new MallocInst(NewTy, 0, AI.getName(), &AI);
-      else if (isa<AllocaInst>(AI))
+      else {
+        assert(isa<AllocaInst>(AI) && "Unknown type of allocation inst!");
         New = new AllocaInst(NewTy, 0, AI.getName(), &AI);
+      }
       
       // Scan to the end of the allocation instructions, to skip over a block of
       // allocas if possible...