Speculatively revert r98035. It appears to have caused a set of buildbot
failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98039 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 358521e..cdd5fff 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1319,9 +1319,10 @@
     // After printing instruction
     DW->EndScope(MI);
   } else if (CurDLT.getNode() != PrevDLT) {
-    MCSymbol *L = DW->RecordSourceLine(CurDLT.getLineNumber(), 
-                                       CurDLT.getColumnNumber(),
-                                       CurDLT.getScope().getNode());
+    unsigned L = DW->RecordSourceLine(CurDLT.getLineNumber(), 
+                                      CurDLT.getColumnNumber(),
+                                      CurDLT.getScope().getNode());
+    printLabel(L);
     DW->BeginScope(MI, L);
     PrevDLT = CurDLT.getNode();
   }
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index a0842d8..af651a7 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1948,14 +1948,14 @@
 }
 
 /// beginScope - Process beginning of a scope starting at Label.
-void DwarfDebug::beginScope(const MachineInstr *MI, MCSymbol *Label) {
+void DwarfDebug::beginScope(const MachineInstr *MI, unsigned Label) {
   InsnToDbgScopeMapTy::iterator I = DbgScopeBeginMap.find(MI);
   if (I == DbgScopeBeginMap.end())
     return;
   ScopeVector &SD = I->second;
   for (ScopeVector::iterator SDI = SD.begin(), SDE = SD.end();
        SDI != SDE; ++SDI)
-    (*SDI)->setStartLabel(Label);
+    (*SDI)->setStartLabel(getDWLabel("label", Label));
 }
 
 /// endScope - Process end of a scope.
@@ -2124,7 +2124,7 @@
       Col = DLT.getColumnNumber();
     }
     
-    recordSourceLine(Line, Col, DLT.getScope().getNode());
+    Asm->printLabel(recordSourceLine(Line, Col, DLT.getScope().getNode()));
   }
   if (TimePassesIsEnabled)
     DebugTimer->stopTimer();
@@ -2180,10 +2180,11 @@
     DebugTimer->stopTimer();
 }
 
-/// recordSourceLine - Register a source line with debug info. Returns the
-/// unique label that was emitted and which provides correspondence to
-/// the source line list.
-MCSymbol *DwarfDebug::recordSourceLine(unsigned Line, unsigned Col, MDNode *S) {
+/// recordSourceLine - Records location information and associates it with a
+/// label. Returns a unique label ID used to generate a label and provide
+/// correspondence to the source line list.
+unsigned DwarfDebug::recordSourceLine(unsigned Line, unsigned Col,
+                                      MDNode *S) {
   if (!MMI)
     return 0;
 
@@ -2216,9 +2217,7 @@
   if (TimePassesIsEnabled)
     DebugTimer->stopTimer();
 
-  MCSymbol *Label = getDWLabel("label", ID);
-  Asm->OutStreamer.EmitLabel(Label);
-  return Label;
+  return ID;
 }
 
 /// getOrCreateSourceID - Public version of GetOrCreateSourceID. This can be
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 40d1d64..0c04502 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -512,10 +512,10 @@
   ///
   void endFunction(const MachineFunction *MF);
 
-  /// recordSourceLine - Register a source line with debug info. Returns the
-  /// unique label that was emitted and which provides correspondence to
-  /// the source line list.
-  MCSymbol *recordSourceLine(unsigned Line, unsigned Col, MDNode *Scope);
+  /// recordSourceLine - Records location information and associates it with a 
+  /// label. Returns a unique label ID used to generate a label and provide
+  /// correspondence to the source line list.
+  unsigned recordSourceLine(unsigned Line, unsigned Col, MDNode *Scope);
 
   /// getSourceLineCount - Return the number of source lines in the debug
   /// info.
@@ -539,7 +539,7 @@
   void collectVariableInfo();
 
   /// beginScope - Process beginning of a scope starting at Label.
-  void beginScope(const MachineInstr *MI, MCSymbol *Label);
+  void beginScope(const MachineInstr *MI, unsigned Label);
 
   /// endScope - Prcess end of a scope.
   void endScope(const MachineInstr *MI);
diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index 9fd4c44..08e1bbc 100644
--- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
@@ -73,11 +73,11 @@
     MMI->EndFunction();
 }
 
-/// RecordSourceLine - Register a source line with debug info. Returns the
-/// unique label that was emitted and which provides correspondence to
-/// the source line list.
-MCSymbol *DwarfWriter::RecordSourceLine(unsigned Line, unsigned Col, 
-                                        MDNode *Scope) {
+/// RecordSourceLine - Records location information and associates it with a 
+/// label. Returns a unique label ID used to generate a label and provide
+/// correspondence to the source line list.
+unsigned DwarfWriter::RecordSourceLine(unsigned Line, unsigned Col, 
+                                       MDNode *Scope) {
   return DD->recordSourceLine(Line, Col, Scope);
 }
 
@@ -92,7 +92,7 @@
   return DD && DD->ShouldEmitDwarfDebug();
 }
 
-void DwarfWriter::BeginScope(const MachineInstr *MI, MCSymbol *L) {
+void DwarfWriter::BeginScope(const MachineInstr *MI, unsigned L) {
   DD->beginScope(MI, L);
 }
 void DwarfWriter::EndScope(const MachineInstr *MI) {