emit basic block labels with mcstreamer.
[oota-llvm.git] / lib / CodeGen / AsmPrinter / AsmPrinter.cpp
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.