diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-11-09 00:49:43 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-11-09 00:49:43 +0000 | 
| commit | a2620ac1568a788a122ecfd5c03d136e92dd38fe (patch) | |
| tree | 895ee544d9cd691e289cc54898265bf736600c8b | |
| parent | 63aeefeafba129ae4cbc3cc3bf007a064b978e06 (diff) | |
| download | bcm5719-llvm-a2620ac1568a788a122ecfd5c03d136e92dd38fe.tar.gz bcm5719-llvm-a2620ac1568a788a122ecfd5c03d136e92dd38fe.zip  | |
Fix warning
llvm-svn: 4649
4 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/InductionVariable.cpp b/llvm/lib/Analysis/InductionVariable.cpp index 6aaf8c018e1..c71033e4607 100644 --- a/llvm/lib/Analysis/InductionVariable.cpp +++ b/llvm/lib/Analysis/InductionVariable.cpp @@ -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) { diff --git a/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp b/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp index a2e9bb642e4..c7bf70c806b 100644 --- a/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp +++ b/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp @@ -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; diff --git a/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp b/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp index b0c15f7bf6b..bc815c6e23f 100644 --- a/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp +++ b/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp @@ -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* diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index e540310f6b3..f57d8b1c36b 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -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...  | 

