diff options
author | Dan Gohman <gohman@apple.com> | 2009-10-06 17:38:38 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-10-06 17:38:38 +0000 |
commit | e3cc3f3c84abfdf8eb3bd19dfa806ceea49f15d6 (patch) | |
tree | cf632431a5862f4e5b082c6fb51c706037c27299 /lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
parent | 6cf4963cdc33f06031ebf86e0606afa4b79ccde5 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83392 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 00f398083f..f149f10f3b 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/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'; } } |