diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-09 02:08:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-09 02:08:02 +0000 |
commit | 1e233f510c3d5d26de97d90ec6b061a6643e892c (patch) | |
tree | 9655b7c732d9772e2657be67c4349aac805232ee | |
parent | b7db73348241ff51f6ac6c4b65cd3d2ff36036b3 (diff) | |
download | external_llvm-1e233f510c3d5d26de97d90ec6b061a6643e892c.zip external_llvm-1e233f510c3d5d26de97d90ec6b061a6643e892c.tar.gz external_llvm-1e233f510c3d5d26de97d90ec6b061a6643e892c.tar.bz2 |
Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98035 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/DwarfWriter.h | 9 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 7 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 19 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.h | 10 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 12 |
5 files changed, 29 insertions, 28 deletions
diff --git a/include/llvm/CodeGen/DwarfWriter.h b/include/llvm/CodeGen/DwarfWriter.h index d59e22a..3c7f802 100644 --- a/include/llvm/CodeGen/DwarfWriter.h +++ b/include/llvm/CodeGen/DwarfWriter.h @@ -35,6 +35,7 @@ class Value; class Module; class MDNode; class MCAsmInfo; +class MCSymbol; class raw_ostream; class Instruction; class DICompileUnit; @@ -82,10 +83,10 @@ public: /// void EndFunction(const MachineFunction *MF); - /// RecordSourceLine - Register a source line with debug info. Returns a - /// unique label ID used to generate a label and provide correspondence to + /// RecordSourceLine - Register a source line with debug info. Returns the + /// unique label that was emitted and which provides correspondence to /// the source line list. - unsigned RecordSourceLine(unsigned Line, unsigned Col, MDNode *Scope); + MCSymbol *RecordSourceLine(unsigned Line, unsigned Col, MDNode *Scope); /// getRecordSourceLineCount - Count source lines. unsigned getRecordSourceLineCount(); @@ -94,7 +95,7 @@ public: /// be emitted. bool ShouldEmitDwarfDebug() const; - void BeginScope(const MachineInstr *MI, unsigned Label); + void BeginScope(const MachineInstr *MI, MCSymbol *Label); void EndScope(const MachineInstr *MI); }; diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index cdd5fff..358521e 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1319,10 +1319,9 @@ void AsmPrinter::processDebugLoc(const MachineInstr *MI, // After printing instruction DW->EndScope(MI); } else if (CurDLT.getNode() != PrevDLT) { - unsigned L = DW->RecordSourceLine(CurDLT.getLineNumber(), - CurDLT.getColumnNumber(), - CurDLT.getScope().getNode()); - printLabel(L); + MCSymbol *L = DW->RecordSourceLine(CurDLT.getLineNumber(), + CurDLT.getColumnNumber(), + CurDLT.getScope().getNode()); DW->BeginScope(MI, L); PrevDLT = CurDLT.getNode(); } diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index af651a7..a0842d8 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1948,14 +1948,14 @@ void DwarfDebug::collectVariableInfo() { } /// beginScope - Process beginning of a scope starting at Label. -void DwarfDebug::beginScope(const MachineInstr *MI, unsigned Label) { +void DwarfDebug::beginScope(const MachineInstr *MI, MCSymbol *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(getDWLabel("label", Label)); + (*SDI)->setStartLabel(Label); } /// endScope - Process end of a scope. @@ -2124,7 +2124,7 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) { Col = DLT.getColumnNumber(); } - Asm->printLabel(recordSourceLine(Line, Col, DLT.getScope().getNode())); + recordSourceLine(Line, Col, DLT.getScope().getNode()); } if (TimePassesIsEnabled) DebugTimer->stopTimer(); @@ -2180,11 +2180,10 @@ void DwarfDebug::endFunction(const MachineFunction *MF) { DebugTimer->stopTimer(); } -/// 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) { +/// 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) { if (!MMI) return 0; @@ -2217,7 +2216,9 @@ unsigned DwarfDebug::recordSourceLine(unsigned Line, unsigned Col, if (TimePassesIsEnabled) DebugTimer->stopTimer(); - return ID; + MCSymbol *Label = getDWLabel("label", ID); + Asm->OutStreamer.EmitLabel(Label); + return Label; } /// getOrCreateSourceID - Public version of GetOrCreateSourceID. This can be diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 0c04502..40d1d64 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -512,10 +512,10 @@ public: /// void endFunction(const MachineFunction *MF); - /// 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); + /// 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); /// 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, unsigned Label); + void beginScope(const MachineInstr *MI, MCSymbol *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 08e1bbc..9fd4c44 100644 --- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -73,11 +73,11 @@ void DwarfWriter::EndFunction(const MachineFunction *MF) { MMI->EndFunction(); } -/// 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) { +/// 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) { return DD->recordSourceLine(Line, Col, Scope); } @@ -92,7 +92,7 @@ bool DwarfWriter::ShouldEmitDwarfDebug() const { return DD && DD->ShouldEmitDwarfDebug(); } -void DwarfWriter::BeginScope(const MachineInstr *MI, unsigned L) { +void DwarfWriter::BeginScope(const MachineInstr *MI, MCSymbol *L) { DD->beginScope(MI, L); } void DwarfWriter::EndScope(const MachineInstr *MI) { |