[llvm-commits] [llvm] r98025 - in /llvm/trunk/lib/CodeGen/AsmPrinter: AsmPrinter.cpp DwarfDebug.cpp

Chris Lattner sabre at nondot.org
Mon Mar 8 17:02:30 PST 2010


Author: lattner
Date: Mon Mar  8 19:02:30 2010
New Revision: 98025

URL: http://llvm.org/viewvc/llvm-project?rev=98025&view=rev
Log:
mcstreamerize AsmPrinter::printLabel.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=98025&r1=98024&r2=98025&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Mar  8 19:02:30 2010
@@ -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

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=98025&r1=98024&r2=98025&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Mar  8 19:02:30 2010
@@ -1972,7 +1972,6 @@
 
   unsigned Label = MMI->NextLabelID();
   Asm->printLabel(Label);
-  O << '\n';
 
   SmallVector<DbgScope *, 2> &SD = I->second;
   for (SmallVector<DbgScope *, 2>::iterator SDI = SD.begin(), SDE = SD.end();
@@ -2131,7 +2130,6 @@
                                  DLT.getColumnNumber(), 
                                  DLT.getScope().getNode());
     Asm->printLabel(LabelID);
-    O << '\n';
   }
   if (TimePassesIsEnabled)
     DebugTimer->stopTimer();





More information about the llvm-commits mailing list