* 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

llvm-svn: 1750
diff --git a/llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp b/llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp
index 6e6d14c..edf84d4 100644
--- a/llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp
+++ b/llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp
@@ -17,6 +17,7 @@
 #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h" // FIXME: Remove when AnalysisUsage sets can be symbolic!
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/BasicBlock.h"
+#include "llvm/Instruction.h"
 #include "SchedPriorities.h"
 #include <ext/hash_set>
 #include <algorithm>
@@ -1287,14 +1288,11 @@
 				SchedGraph *graph)
 {
   const MachineInstrInfo& mii = S.getInstrInfo();
-  const TerminatorInst *termInstr = bb->getTerminator();
+  const Instruction *termInstr = (Instruction*)bb->getTerminator();
   MachineCodeForInstruction &termMvec=MachineCodeForInstruction::get(termInstr);
   vector<SchedGraphNode*> delayNodeVec;
   const MachineInstr* brInstr = NULL;
   
-  assert(termInstr->getOpcode() != Instruction::Call
-         && "Call used as terminator?");
-  
   if (termInstr->getOpcode() != Instruction::Ret)
     {
       // To find instructions that need delay slots without searching the full
diff --git a/llvm/lib/CodeGen/InstrSched/SchedGraph.h b/llvm/lib/CodeGen/InstrSched/SchedGraph.h
index 80355e4..fb6087c 100644
--- a/llvm/lib/CodeGen/InstrSched/SchedGraph.h
+++ b/llvm/lib/CodeGen/InstrSched/SchedGraph.h
@@ -391,13 +391,13 @@
 // for <const SchedGraphNode, SchedGraphNode::const_iterator>.
 // 
 template <class _NodeType, class _EdgeType, class _EdgeIter>
-class PredIterator: public std::bidirectional_iterator<_NodeType, ptrdiff_t> {
+class SGPredIterator: public std::bidirectional_iterator<_NodeType, ptrdiff_t> {
 protected:
   _EdgeIter oi;
 public:
-  typedef PredIterator<_NodeType, _EdgeType, _EdgeIter> _Self;
+  typedef SGPredIterator<_NodeType, _EdgeType, _EdgeIter> _Self;
   
-  inline PredIterator(_EdgeIter startEdge) : oi(startEdge) {}
+  inline SGPredIterator(_EdgeIter startEdge) : oi(startEdge) {}
   
   inline bool operator==(const _Self& x) const { return oi == x.oi; }
   inline bool operator!=(const _Self& x) const { return !operator==(x); }
@@ -420,13 +420,13 @@
 };
 
 template <class _NodeType, class _EdgeType, class _EdgeIter>
-class SuccIterator: public std::bidirectional_iterator<_NodeType, ptrdiff_t> {
+class SGSuccIterator: public std::bidirectional_iterator<_NodeType, ptrdiff_t> {
 protected:
   _EdgeIter oi;
 public:
-  typedef SuccIterator<_NodeType, _EdgeType, _EdgeIter> _Self;
+  typedef SGSuccIterator<_NodeType, _EdgeType, _EdgeIter> _Self;
   
-  inline SuccIterator(_EdgeIter startEdge) : oi(startEdge) {}
+  inline SGSuccIterator(_EdgeIter startEdge) : oi(startEdge) {}
   
   inline bool operator==(const _Self& x) const { return oi == x.oi; }
   inline bool operator!=(const _Self& x) const { return !operator==(x); }
@@ -451,9 +451,9 @@
 // sg_pred_iterator
 // sg_pred_const_iterator
 //
-typedef PredIterator<SchedGraphNode, SchedGraphEdge, SchedGraphNode::iterator>
+typedef SGPredIterator<SchedGraphNode, SchedGraphEdge, SchedGraphNode::iterator>
     sg_pred_iterator;
-typedef PredIterator<const SchedGraphNode, const SchedGraphEdge,SchedGraphNode::const_iterator>
+typedef SGPredIterator<const SchedGraphNode, const SchedGraphEdge,SchedGraphNode::const_iterator>
     sg_pred_const_iterator;
 
 inline sg_pred_iterator       pred_begin(      SchedGraphNode *N) {
@@ -474,9 +474,9 @@
 // sg_succ_iterator
 // sg_succ_const_iterator
 //
-typedef SuccIterator<SchedGraphNode, SchedGraphEdge, SchedGraphNode::iterator>
+typedef SGSuccIterator<SchedGraphNode, SchedGraphEdge, SchedGraphNode::iterator>
     sg_succ_iterator;
-typedef SuccIterator<const SchedGraphNode, const SchedGraphEdge,SchedGraphNode::const_iterator>
+typedef SGSuccIterator<const SchedGraphNode, const SchedGraphEdge,SchedGraphNode::const_iterator>
     sg_succ_const_iterator;
 
 inline sg_succ_iterator       succ_begin(      SchedGraphNode *N) {
diff --git a/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp b/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp
index cd0ca66..af02e57 100644
--- a/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp
+++ b/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp
@@ -159,7 +159,7 @@
 
 void InsertPhiElimInst(BasicBlock *BB, MachineInstr *CpMI) { 
 
-  TerminatorInst *TermInst = BB->getTerminator();
+  Instruction *TermInst = (Instruction*)BB->getTerminator();
   MachineCodeForInstruction &MC4Term = MachineCodeForInstruction::get(TermInst);
   MachineInstr *FirstMIOfTerm = *( MC4Term.begin() );