diff --git a/lib/CodeGen/MIRPrinter.cpp b/lib/CodeGen/MIRPrinter.cpp index 759a8d3234d..df2f441a031 100644 --- a/lib/CodeGen/MIRPrinter.cpp +++ b/lib/CodeGen/MIRPrinter.cpp @@ -581,6 +581,13 @@ void MIPrinter::printMBBReference(const MachineBasicBlock &MBB) { } } +static void printIRSlotNumber(raw_ostream &OS, int Slot) { + if (Slot == -1) + OS << ""; + else + OS << Slot; +} + void MIPrinter::printIRBlockReference(const BasicBlock &BB) { OS << "%ir-block."; if (BB.hasName()) { @@ -597,10 +604,7 @@ void MIPrinter::printIRBlockReference(const BasicBlock &BB) { CustomMST.incorporateFunction(*F); Slot = CustomMST.getLocalSlot(&BB); } - if (Slot == -1) - OS << ""; - else - OS << Slot; + printIRSlotNumber(OS, Slot); } void MIPrinter::printIRValueReference(const Value &V) {