Extend printBasicBlockLabel a bit so that it can be used to print all
basic block labels, consolidating the code to do so in one place for each
target.
llvm-svn: 28050
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index 1753160..76a03dc 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter.cpp
@@ -728,9 +728,14 @@
/// printBasicBlockLabel - This method prints the label for the specified
/// MachineBasicBlock
-void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB) const {
+void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
+ bool printColon,
+ bool printComment) const {
O << PrivateGlobalPrefix << "LBB"
<< Mang->getValueName(MBB->getParent()->getFunction())
- << "_" << MBB->getNumber() << '\t' << CommentString
- << MBB->getBasicBlock()->getName();
+ << "_" << MBB->getNumber();
+ if (printColon)
+ O << ':';
+ if (printComment)
+ O << '\t' << CommentString << MBB->getBasicBlock()->getName();
}