From 3fbbdf3144b9bd202564dcab5c96ca6b5c91e296 Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Thu, 15 Feb 2018 16:23:59 +0000 Subject: [CodeGen] Separate MBB metadata from instructions in -debug printing Add an empty line after 'liveins:', 'successors:', or '; predecessors:', the one that ends up to be the last one. llvm-svn: 325258 --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index fca93d82d00..ef9154f6edb 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -325,6 +325,7 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST, const TargetRegisterInfo *TRI = MF->getSubtarget().getRegisterInfo(); const MachineRegisterInfo &MRI = MF->getRegInfo(); const TargetInstrInfo &TII = *getParent()->getSubtarget().getInstrInfo(); + bool HasLineAttributes = false; // Print the preds of this block according to the CFG. if (!pred_empty()) { @@ -337,6 +338,7 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST, OS << printMBBReference(**I); } OS << '\n'; + HasLineAttributes = true; } if (!succ_empty()) { @@ -366,8 +368,10 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST, 100.0) << ')'; } - OS << '\n'; } + + OS << '\n'; + HasLineAttributes = true; } if (!livein_empty() && MRI.tracksLiveness()) { @@ -384,8 +388,12 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST, OS << ":0x" << PrintLaneMask(LI.LaneMask); } OS << '\n'; + HasLineAttributes = true; } + if (HasLineAttributes) + OS << '\n'; + bool IsInBundle = false; for (const MachineInstr &MI : instrs()) { if (Indexes) { -- cgit v1.2.3