From b41dbbe32582dcfe18e6ea763886fabf5fd7c84d Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Wed, 13 Dec 2017 10:30:59 +0000 Subject: [CodeGen] Print jump-table index operands as %jump-table.0 in both MIR and debug output Work towards the unification of MIR and debug output by printing `%jump-table.0` instead of ``. Only debug syntax is affected. llvm-svn: 320566 --- llvm/lib/CodeGen/MachineFunction.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index f0d5eec..dba0dfb 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -906,7 +906,7 @@ void MachineJumpTableInfo::print(raw_ostream &OS) const { OS << "Jump Tables:\n"; for (unsigned i = 0, e = JumpTables.size(); i != e; ++i) { - OS << " jt#" << i << ": "; + OS << printJumpTableEntryReference(i) << ": "; for (unsigned j = 0, f = JumpTables[i].MBBs.size(); j != f; ++j) OS << ' ' << printMBBReference(*JumpTables[i].MBBs[j]); } @@ -918,6 +918,10 @@ void MachineJumpTableInfo::print(raw_ostream &OS) const { LLVM_DUMP_METHOD void MachineJumpTableInfo::dump() const { print(dbgs()); } #endif +Printable llvm::printJumpTableEntryReference(unsigned Idx) { + return Printable([Idx](raw_ostream &OS) { OS << "%jump-table." << Idx; }); +} + //===----------------------------------------------------------------------===// // MachineConstantPool implementation //===----------------------------------------------------------------------===// -- cgit v1.1