[CodeGen] Print predecessors as MIR comments in -debug output

Make -debug MBB headers more copy-pastable into mir files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324769 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Francis Visoiu Mistrih
2018-02-09 19:46:02 +00:00
parent 6ccb37f13a
commit e18a2b4e7d
+7 -3
View File
@@ -374,9 +374,13 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST,
// Print the preds of this block according to the CFG.
if (!pred_empty()) {
if (Indexes) OS << '\t';
OS << " Predecessors according to CFG:";
for (const_pred_iterator PI = pred_begin(), E = pred_end(); PI != E; ++PI)
OS << " " << printMBBReference(*(*PI));
// Don't indent(2), align with previous line attributes.
OS << "; predecessors: ";
for (auto I = pred_begin(), E = pred_end(); I != E; ++I) {
if (I != pred_begin())
OS << ", ";
OS << printMBBReference(**I);
}
OS << '\n';
}