diff options
author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-02-14 20:23:05 +0000 |
---|---|---|
committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-02-14 20:23:05 +0000 |
commit | afad84e676123a4cdeffeed0062c8449c38bc6e3 (patch) | |
tree | 88c1ea318d875ecc21f2efbd61a1bf03c1fef578 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 15647b778bb3ce71f59f6068fe2a1bd2b25389b5 (diff) | |
download | bcm5719-llvm-afad84e676123a4cdeffeed0062c8449c38bc6e3.tar.gz bcm5719-llvm-afad84e676123a4cdeffeed0062c8449c38bc6e3.zip |
[CodeGen] Print predecessors, successors, then liveins in -debug printing
Reorder them to match MIR.
Predecessors are only comments, and they're not usually printed in MIR.
llvm-svn: 325166
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 46419ed0ab2..78cd9d6d2bb 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -325,18 +325,16 @@ 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(); - if (!livein_empty() && MRI.tracksLiveness()) { - if (Indexes) OS << '\t'; - OS.indent(2) << "liveins: "; - bool First = true; - for (const auto &LI : liveins()) { - if (!First) + // Print the preds of this block according to the CFG. + if (!pred_empty()) { + if (Indexes) OS << '\t'; + // 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 << ", "; - First = false; - OS << printReg(LI.PhysReg, TRI); - if (!LI.LaneMask.all()) - OS << ":0x" << PrintLaneMask(LI.LaneMask); + OS << printMBBReference(**I); } OS << '\n'; } @@ -372,15 +370,18 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST, } } - // Print the preds of this block according to the CFG. - if (!pred_empty()) { + if (!livein_empty() && MRI.tracksLiveness()) { if (Indexes) OS << '\t'; - // 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.indent(2) << "liveins: "; + + bool First = true; + for (const auto &LI : liveins()) { + if (!First) OS << ", "; - OS << printMBBReference(**I); + First = false; + OS << printReg(LI.PhysReg, TRI); + if (!LI.LaneMask.all()) + OS << ":0x" << PrintLaneMask(LI.LaneMask); } OS << '\n'; } |