summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-02-09 19:46:02 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-02-09 19:46:02 +0000
commit33979ce32da1613b787b4b8094085e7515e40904 (patch)
treeb7929a0549ff0445956ce927cd1fbedb29bd0465 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parentfc58346bf0c1bfef65fe5b86920c3e43a20cbc13 (diff)
downloadbcm5719-llvm-33979ce32da1613b787b4b8094085e7515e40904.tar.gz
bcm5719-llvm-33979ce32da1613b787b4b8094085e7515e40904.zip
[CodeGen] Print predecessors as MIR comments in -debug output
Make -debug MBB headers more copy-pastable into mir files. llvm-svn: 324769
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 72cc47da7c5..923aad6395d 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -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';
}
OpenPOWER on IntegriCloud