emit basic block labels with mcstreamer.
authorChris Lattner <sabre@nondot.org>
Wed, 20 Jan 2010 07:24:05 +0000 (07:24 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 20 Jan 2010 07:24:05 +0000 (07:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93993 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
test/CodeGen/X86/2008-12-19-EarlyClobberBug.ll
test/CodeGen/X86/loop-hoist.ll

index bb0cb1819094a0660c0f265566eb82e11fb5d61e..660955a5f44a6c55c487fa3d43204371986a3e12 100644 (file)
@@ -1643,14 +1643,12 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock *MBB) const {
   // forward references to labels without knowing what their numbers
   // will be.
   if (MBB->hasAddressTaken()) {
-    O << *GetBlockAddressSymbol(MBB->getBasicBlock()->getParent(),
-                                MBB->getBasicBlock());
-    O << ':';
+    const BasicBlock *BB = MBB->getBasicBlock();
+    OutStreamer.EmitLabel(GetBlockAddressSymbol(BB->getParent(), BB));
     if (VerboseAsm) {
       O.PadToColumn(MAI->getCommentColumn());
-      O << MAI->getCommentString() << " Address Taken";
+      O << MAI->getCommentString() << " Address Taken" << '\n';
     }
-    O << '\n';
   }
 
   // Print the main label for the block.
@@ -1658,9 +1656,7 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock *MBB) const {
     if (VerboseAsm)
       O << MAI->getCommentString() << " BB#" << MBB->getNumber() << ':';
   } else {
-    O << *GetMBBSymbol(MBB->getNumber()) << ':';
-    if (!VerboseAsm)
-      O << '\n';
+    OutStreamer.EmitLabel(GetMBBSymbol(MBB->getNumber()));
   }
   
   // Print some comments to accompany the label.
index 13a9080c1401fbff02f0bceb91310d0c750e787c..a6cabc4fd33187d7ec02a0837b950b807303e8ec 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=i386-apple-darwin | FileCheck %s
+; RUN: llc < %s -mtriple=i386-apple-darwin -asm-verbose=0 | FileCheck %s
 ; PR3149
 ; Make sure the copy after inline asm is not coalesced away.
 
index b52066dac62ebe2a3d58b3a8354e36d30c3d73e7..b9008e5e3022da5601ea5b30f5e62afaef844dd3 100644 (file)
@@ -4,7 +4,7 @@
 
 ; CHECK: _foo:
 ; CHECK:    L_Arr$non_lazy_ptr
-; CHECK: LBB1_1:       ## %cond_true
+; CHECK: LBB1_1:
 
 @Arr = external global [0 x i32]               ; <[0 x i32]*> [#uses=1]