1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

MIR Printer: Extract the code that prints IR slots to a separate function. NFC.

This code can be reused when printing references to unnamed local IR values.

llvm-svn: 245519
This commit is contained in:
Alex Lorenz 2015-08-19 23:24:37 +00:00
parent bdabca9432
commit 2c7bf54551

View File

@ -581,6 +581,13 @@ void MIPrinter::printMBBReference(const MachineBasicBlock &MBB) {
}
}
static void printIRSlotNumber(raw_ostream &OS, int Slot) {
if (Slot == -1)
OS << "<badref>";
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 << "<badref>";
else
OS << Slot;
printIRSlotNumber(OS, Slot);
}
void MIPrinter::printIRValueReference(const Value &V) {