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
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())
}
EmitComments(*MBB);
+ O << '\n';
}
}
// Print a label for the basic block.
if (I != MF.begin()) {
EmitBasicBlockStart(I);
- O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
II != E; ++II) {
I != E; ++I) {
if (I != MF.begin()) {
EmitBasicBlockStart(I);
- O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
II != E; ++II) {
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
I != E; ++I) {
// Print a label for the basic block.
- if (!VerboseAsm && (I->pred_empty() || I->isOnlyReachableByFallthrough())) {
- // This is an entry block or a block that's only reachable via a
- // fallthrough edge. In non-VerboseAsm mode, don't print the label.
- } else {
- EmitBasicBlockStart(I);
- O << '\n';
- }
+ EmitBasicBlockStart(I);
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
II != E; ++II) {
// Print a label for the basic block.
if (I != MF.begin()) {
EmitBasicBlockStart(I);
- O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
II != E; ++II) {
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
I != E; ++I) {
// Print a label for the basic block.
- if (!VerboseAsm && (I->pred_empty() || I->isOnlyReachableByFallthrough())) {
- // This is an entry block or a block that's only reachable via a
- // fallthrough edge. In non-VerboseAsm mode, don't print the label.
- } else {
- EmitBasicBlockStart(I);
- O << '\n';
- }
+ EmitBasicBlockStart(I);
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
II != E; ++II)
// Print a label for the basic block.
if (I != MF.begin()) {
EmitBasicBlockStart(I);
- O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
// Print a label for the basic block.
if (I != MF.begin()) {
EmitBasicBlockStart(I);
- O << '\n';
}
// Print a basic block.
// Print a label for the basic block.
if (I != MF.begin()) {
EmitBasicBlockStart(I);
- O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
II != E; ++II) {
// Print a label for the basic block.
if (I != MF.begin()) {
EmitBasicBlockStart(I);
- O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
II != IE; ++II) {
// Print a label for the basic block.
if (I != MF.begin()) {
EmitBasicBlockStart(I);
- O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
II != E; ++II) {
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
I != E; ++I) {
// Print a label for the basic block.
- if (!VerboseAsm && (I->pred_empty() || I->isOnlyReachableByFallthrough())) {
- // This is an entry block or a block that's only reachable via a
- // fallthrough edge. In non-VerboseAsm mode, don't print the label.
- } else {
- EmitBasicBlockStart(I);
- O << '\n';
- }
+ EmitBasicBlockStart(I);
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
II != E; ++II)
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
I != E; ++I) {
// Print a label for the basic block.
- if (!VerboseAsm && (I->pred_empty() || I->isOnlyReachableByFallthrough())) {
- // This is an entry block or a block that's only reachable via a
- // fallthrough edge. In non-VerboseAsm mode, don't print the label.
- } else {
- EmitBasicBlockStart(I);
- O << '\n';
- }
+ EmitBasicBlockStart(I);
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
II != IE; ++II) {
// Print the assembly for the instruction.
// Print a label for the basic block.
if (I != MF.begin()) {
EmitBasicBlockStart(I);
- O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
entry:
; CHECK: cmpl $2
; CHECK-NEXT: je
-; CHECK-NEXT: LBB1_1
+; CHECK-NEXT: %entry
switch i32 %argc, label %UnifiedReturnBlock [
i32 1, label %bb
-; RUN: llc < %s -mtriple=i686-pc-linux-gnu -relocation-model=pic | FileCheck %s -check-prefix=LINUX
+; RUN: llc < %s -mtriple=i686-pc-linux-gnu -relocation-model=pic -asm-verbose=false | FileCheck %s -check-prefix=LINUX
@ptr = external global i32*
@dst = external global i32
ret void
; LINUX: test1:
-; LINUX: .LBB1_0:
; LINUX: call .L1$pb
; LINUX-NEXT: .L1$pb:
; LINUX-NEXT: popl