Get rid of this for_each loop
[oota-llvm.git] / lib / CodeGen / MachineBasicBlock.cpp
index a69d1580a35b9e2325a07b8a9992c744cd2e000e..695ba13a49ddf58bc7880ebf9c76696380880e4f 100644 (file)
@@ -46,7 +46,7 @@ void ilist_traits<MachineBasicBlock>::removeNodeFromList(MachineBasicBlock* N) {
 }
 
 
-MachineInstr* ilist_traits<MachineInstr>::createSentinal() {
+MachineInstr* ilist_traits<MachineInstr>::createSentinel() {
   MachineInstr* dummy = new MachineInstr(0, 0);
   LeakDetector::removeGarbageObject(dummy);
   return dummy;
@@ -100,6 +100,14 @@ void MachineBasicBlock::print(std::ostream &OS) const {
     OS << "\t";
     I->print(OS, &getParent()->getTarget());
   }
+
+  // Print the successors of this block according to the CFG.
+  if (!succ_empty()) {
+    OS << "    Successors according to CFG:";
+    for (const_succ_iterator SI = succ_begin(), E = succ_end(); SI != E; ++SI)
+      OS << " " << *SI;
+    OS << "\n";
+  }
 }
 
 void MachineBasicBlock::addSuccessor(MachineBasicBlock *succ) {