From f3ee51441909cf1accfcce4c9b5b9f851e2c07b6 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Mon, 12 Jan 2009 22:54:42 +0000 Subject: [PATCH] Use SrcLineInfo from DwarfWriter. The MachineModuleInfo copy will disappear soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62114 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index c3ca514d350..9f94a2b79ef 100644 --- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -1170,7 +1170,7 @@ public: }; //===----------------------------------------------------------------------===// -/// SourceLineInfo - This class is used to record source line correspondence. +/// SrcLineInfo - This class is used to record source line correspondence. /// class SrcLineInfo { unsigned Line; // Source line number. @@ -1327,7 +1327,7 @@ private: /// SectionSourceLines - Tracks line numbers per text section. /// - std::vector > SectionSourceLines; + std::vector > SectionSourceLines; /// didInitial - Flag to indicate if initial emission has been done. /// @@ -3126,7 +3126,7 @@ private: for (unsigned j = 0; j < SecSrcLinesSize; ++j) { // Isolate current sections line info. - const std::vector &LineInfos = SectionSourceLines[j]; + const std::vector &LineInfos = SectionSourceLines[j]; if (VerboseAsm) { const Section* S = SectionMap[j + 1]; @@ -3140,7 +3140,7 @@ private: // Construct rows of the address, source, line, column matrix. for (unsigned i = 0, N = LineInfos.size(); i < N; ++i) { - const SourceLineInfo &LineInfo = LineInfos[i]; + const SrcLineInfo &LineInfo = LineInfos[i]; unsigned LabelID = MMI->MappedLabel(LineInfo.getLabelID()); if (!LabelID) continue; @@ -3735,9 +3735,8 @@ public: // Emit label for the implicitly defined dbg.stoppoint at the start of // the function. - const std::vector &LineInfos = MMI->getSourceLines(); - if (!LineInfos.empty()) { - const SourceLineInfo &LineInfo = LineInfos[0]; + if (!Lines.empty()) { + const SrcLineInfo &LineInfo = Lines[0]; Asm->printLabel(LineInfo.getLabelID()); } } @@ -3751,16 +3750,14 @@ public: EmitLabel("func_end", SubprogramCount); // Get function line info. - const std::vector &LineInfos = MMI->getSourceLines(); - - if (!LineInfos.empty()) { + if (!Lines.empty()) { // Get section line info. unsigned ID = SectionMap.insert(Asm->CurrentSection_); if (SectionSourceLines.size() < ID) SectionSourceLines.resize(ID); - std::vector &SectionLineInfos = SectionSourceLines[ID-1]; + std::vector &SectionLineInfos = SectionSourceLines[ID-1]; // Append the function info to section info. SectionLineInfos.insert(SectionLineInfos.end(), - LineInfos.begin(), LineInfos.end()); + Lines.begin(), Lines.end()); } // Construct scopes for subprogram.