summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2017-12-14 10:03:14 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2017-12-14 10:03:14 +0000
commitbdaf8bfa99830bad36c9833ca6a661294fb27577 (patch)
tree578d5e8ffac8947f5141e51b8ca5cff12d89fc62 /llvm/lib/CodeGen/MachineOperand.cpp
parent5df3bbf3e637b8f9175e0f96e02aab0776f1d2f1 (diff)
downloadbcm5719-llvm-bdaf8bfa99830bad36c9833ca6a661294fb27577.tar.gz
bcm5719-llvm-bdaf8bfa99830bad36c9833ca6a661294fb27577.zip
[CodeGen] Print live-out register lists as liveout(...) in both MIR and debug output
Work towards the unification of MIR and debug output by printing `liveout(...)` instead of `<regliveout>`. Only debug syntax is affected. llvm-svn: 320683
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOperand.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp
index 7ffdbea08c1..009722b981a 100644
--- a/llvm/lib/CodeGen/MachineOperand.cpp
+++ b/llvm/lib/CodeGen/MachineOperand.cpp
@@ -637,9 +637,25 @@ void MachineOperand::print(raw_ostream &OS, ModuleSlotTracker &MST,
OS << ">";
break;
}
- case MachineOperand::MO_RegisterLiveOut:
- OS << "<regliveout>";
+ case MachineOperand::MO_RegisterLiveOut: {
+ const uint32_t *RegMask = getRegLiveOut();
+ OS << "liveout(";
+ if (!TRI) {
+ OS << "<unknown>";
+ } else {
+ bool IsCommaNeeded = false;
+ for (unsigned Reg = 0, E = TRI->getNumRegs(); Reg < E; ++Reg) {
+ if (RegMask[Reg / 32] & (1U << (Reg % 32))) {
+ if (IsCommaNeeded)
+ OS << ", ";
+ OS << printReg(Reg, TRI);
+ IsCommaNeeded = true;
+ }
+ }
+ }
+ OS << ")";
break;
+ }
case MachineOperand::MO_Metadata:
OS << '<';
getMetadata()->printAsOperand(OS, MST);
OpenPOWER on IntegriCloud