* Pull BasicBlock::pred_* and BasicBlock::succ_* out of BasicBlock.h and into
  llvm/Support/CFG.h
* Make pred & succ iterators for intervals global functions
* Add #includes that are now neccesary because BasicBlock.h doesn't include
  InstrTypes.h anymore


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1750 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/SparcV9/SparcV9TargetMachine.cpp b/lib/Target/SparcV9/SparcV9TargetMachine.cpp
index b026ccd..a4556d1 100644
--- a/lib/Target/SparcV9/SparcV9TargetMachine.cpp
+++ b/lib/Target/SparcV9/SparcV9TargetMachine.cpp
@@ -84,15 +84,16 @@
 
 void InsertPrologEpilogCode::InsertEpilogCode(Method* method)
 {
-  for (Method::iterator I=method->begin(), E=method->end(); I != E; ++I)
-    if ((*I)->getTerminator()->getOpcode() == Instruction::Ret)
+  for (Method::iterator I=method->begin(), E=method->end(); I != E; ++I) {
+    Instruction *TermInst = (Instruction*)(*I)->getTerminator();
+    if (TermInst->getOpcode() == Instruction::Ret)
       {
         BasicBlock* exitBB = *I;
         unsigned N = GetInstructionsForEpilog(exitBB, Target, minstrVec);
         
         MachineCodeForBasicBlock& bbMvec = exitBB->getMachineInstrVec();
         MachineCodeForInstruction &termMvec =
-          MachineCodeForInstruction::get(exitBB->getTerminator());
+          MachineCodeForInstruction::get(TermInst);
         
         // Remove the NOPs in the delay slots of the return instruction
         const MachineInstrInfo &mii = Target.getInstrInfo();
@@ -115,6 +116,7 @@
         // Append the epilog code to the end of the basic block.
         bbMvec.push_back(minstrVec[0]);
       }
+  }
 }