summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-10-06 17:38:38 +0000
committerDan Gohman <gohman@apple.com>2009-10-06 17:38:38 +0000
commit10d3dc569b2afe1ba9dccf6650b131b87f9be4ad (patch)
tree3e110925ac5ddd5d4e2d7e4c3c101847fef91538 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parent92e3a06623077fceb781f66acfc691b26642c376 (diff)
downloadbcm5719-llvm-10d3dc569b2afe1ba9dccf6650b131b87f9be4ad.tar.gz
bcm5719-llvm-10d3dc569b2afe1ba9dccf6650b131b87f9be4ad.zip
Instead of printing unnecessary basic block labels as labels in
verbose-asm mode, print comments instead. This eliminates a non-comment difference between verbose-asm mode and non-verbose-asm mode. Also, factor out the relevant code out of all the targets and into target-independent code. llvm-svn: 83392
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 00f398083f1..f149f10f3b4 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1623,8 +1623,15 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock *MBB) const {
if (unsigned Align = MBB->getAlignment())
EmitAlignment(Log2_32(Align));
- GetMBBSymbol(MBB->getNumber())->print(O, MAI);
- O << ':';
+ if (MBB->pred_empty() || MBB->isOnlyReachableByFallthrough()) {
+ if (VerboseAsm)
+ O << MAI->getCommentString() << " BB#" << MBB->getNumber() << ':';
+ } else {
+ GetMBBSymbol(MBB->getNumber())->print(O, MAI);
+ O << ':';
+ if (!VerboseAsm)
+ O << '\n';
+ }
if (VerboseAsm) {
if (const BasicBlock *BB = MBB->getBasicBlock())
@@ -1635,6 +1642,7 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock *MBB) const {
}
EmitComments(*MBB);
+ O << '\n';
}
}
OpenPOWER on IntegriCloud