summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-02-09 01:14:44 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-02-09 01:14:44 +0000
commitfb7b14f70d33225a8299db98bff6e99d79f13ae7 (patch)
tree3f4b3ce4ba2abf5581a9a56f06f470156d4b0e5f /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent79c3255fe4fc61d8b05f3d2993eb807fef8f2cff (diff)
downloadbcm5719-llvm-fb7b14f70d33225a8299db98bff6e99d79f13ae7.tar.gz
bcm5719-llvm-fb7b14f70d33225a8299db98bff6e99d79f13ae7.zip
[CodeGen] Unify the syntax of MBB liveins in MIR and -debug output
Instead of: Live Ins: %r0 %r1 print: liveins: %r0, %r1 llvm-svn: 324694
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 76ed383ac3f..72cc47da7c5 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -323,18 +323,25 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST,
OS << ":\n";
const TargetRegisterInfo *TRI = MF->getSubtarget().getRegisterInfo();
- if (!livein_empty()) {
+ const MachineRegisterInfo &MRI = MF->getRegInfo();
+ if (!livein_empty() && MRI.tracksLiveness()) {
if (Indexes) OS << '\t';
- OS << " Live Ins:";
- for (const auto &LI : LiveIns) {
- OS << ' ' << printReg(LI.PhysReg, TRI);
+ OS.indent(2) << "liveins: ";
+
+ bool First = true;
+ for (const auto &LI : liveins()) {
+ if (!First)
+ OS << ", ";
+ First = false;
+ OS << printReg(LI.PhysReg, TRI);
if (!LI.LaneMask.all())
- OS << ':' << PrintLaneMask(LI.LaneMask);
+ OS << ":0x" << PrintLaneMask(LI.LaneMask);
}
OS << '\n';
}
if (!succ_empty()) {
+ if (Indexes) OS << '\t';
// Print the successors
OS.indent(2) << "successors: ";
for (auto I = succ_begin(), E = succ_end(); I != E; ++I) {
OpenPOWER on IntegriCloud