mcstreamerize AsmPrinter::printLabel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98025 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 246538b..cdd5fff 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1323,7 +1323,6 @@
CurDLT.getColumnNumber(),
CurDLT.getScope().getNode());
printLabel(L);
- O << '\n';
DW->BeginScope(MI, L);
PrevDLT = CurDLT.getNode();
}
@@ -1554,12 +1553,17 @@
/// printLabel - This method prints a local label used by debug and
/// exception handling tables.
void AsmPrinter::printLabelInst(const MachineInstr *MI) const {
- printLabel(MI->getOperand(0).getImm());
- OutStreamer.AddBlankLine();
+ MCSymbol *Sym =
+ OutContext.GetOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix()) +
+ "label" + Twine(MI->getOperand(0).getImm()));
+ OutStreamer.EmitLabel(Sym);
}
void AsmPrinter::printLabel(unsigned Id) const {
- O << MAI->getPrivateGlobalPrefix() << "label" << Id << ':';
+ MCSymbol *Sym =
+ OutContext.GetOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix()) +
+ "label" + Twine(Id));
+ OutStreamer.EmitLabel(Sym);
}
/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM