Speculatively revert r98035. It appears to have caused a set of buildbot
authorEric Christopher <echristo@apple.com>
Tue, 9 Mar 2010 02:36:31 +0000 (02:36 +0000)
committerEric Christopher <echristo@apple.com>
Tue, 9 Mar 2010 02:36:31 +0000 (02:36 +0000)
failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98039 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/DwarfWriter.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h
lib/CodeGen/AsmPrinter/DwarfWriter.cpp

index 3c7f8024d9cd55339f3bd4d58bef12bf0dc70f42..d59e22a8127de2c898e053b73af9ceb8ec9ce647 100644 (file)
@@ -35,7 +35,6 @@ class Value;
 class Module;
 class MDNode;
 class MCAsmInfo;
-class MCSymbol;
 class raw_ostream;
 class Instruction;
 class DICompileUnit;
@@ -83,10 +82,10 @@ public:
   ///
   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
+  /// RecordSourceLine - Register a source line with debug info. Returns a
+  /// unique label ID used to generate a label and provide correspondence to
   /// the source line list.
-  MCSymbol *RecordSourceLine(unsigned Line, unsigned Col, MDNode *Scope);
+  unsigned RecordSourceLine(unsigned Line, unsigned Col, MDNode *Scope);
 
   /// getRecordSourceLineCount - Count source lines.
   unsigned getRecordSourceLineCount();
@@ -95,7 +94,7 @@ public:
   /// be emitted.
   bool ShouldEmitDwarfDebug() const;
 
-  void BeginScope(const MachineInstr *MI, MCSymbol *Label);
+  void BeginScope(const MachineInstr *MI, unsigned Label);
   void EndScope(const MachineInstr *MI);
 };
 
index 358521ef1314284a2b498c262b67becf8b3726f4..cdd5fff3a62f5f3239ede2cb04c99df368fe3e3d 100644 (file)
@@ -1319,9 +1319,10 @@ void AsmPrinter::processDebugLoc(const MachineInstr *MI,
     // 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();
   }
index a0842d81e5549d8c96241d23f621a84d16ffdb02..af651a71d9839c874d0a0eeedf118787774cf188 100644 (file)
@@ -1948,14 +1948,14 @@ void DwarfDebug::collectVariableInfo() {
 }
 
 /// 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 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
       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 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
     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 @@ MCSymbol *DwarfDebug::recordSourceLine(unsigned Line, unsigned Col, MDNode *S) {
   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
index 40d1d646761a0bff8fbd950ce400fd142db988a7..0c04502444cf25ae95f2c23297e244e82d2f631f 100644 (file)
@@ -512,10 +512,10 @@ public:
   ///
   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 @@ public:
   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);
index 9fd4c4478540c78c0075a5b35c43ef31e3e711b6..08e1bbce08f48d640596cea481bd9952357bcdd2 100644 (file)
@@ -73,11 +73,11 @@ void DwarfWriter::EndFunction(const MachineFunction *MF) {
     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 @@ bool DwarfWriter::ShouldEmitDwarfDebug() const {
   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) {