This code can be reused when printing references to unnamed local IR values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245519
91177308-0d34-0410-b5e6-
96231b3b80d8
}
}
+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()) {
CustomMST.incorporateFunction(*F);
Slot = CustomMST.getLocalSlot(&BB);
}
- if (Slot == -1)
- OS << "<badref>";
- else
- OS << Slot;
+ printIRSlotNumber(OS, Slot);
}
void MIPrinter::printIRValueReference(const Value &V) {