]> granicus.if.org Git - llvm/commitdiff
[DWARF] Make DWARFDebugLine::ParsingState::RowNumber a local variable
authorFangrui Song <maskray@google.com>
Mon, 15 Apr 2019 07:40:30 +0000 (07:40 +0000)
committerFangrui Song <maskray@google.com>
Mon, 15 Apr 2019 07:40:30 +0000 (07:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358374 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
lib/DebugInfo/DWARF/DWARFDebugLine.cpp

index 4304e84350aa9d997e0f8a3e39a9293d6ee9809c..0fc34a8e7e48ccaa7df7593cd76cc93bb144802c 100644 (file)
@@ -355,9 +355,6 @@ private:
 
     /// Line table we're currently parsing.
     struct LineTable *LineTable;
-    /// The row number that starts at zero for the prologue, and increases for
-    /// each row added to the matrix.
-    unsigned RowNumber = 0;
     struct Row Row;
     struct Sequence Sequence;
   };
index 8299be38ac60cd495719652a335a0b80ffd484d4..47df83e6817226545a52408f7118ce5ec4859a9b 100644 (file)
@@ -426,18 +426,18 @@ void DWARFDebugLine::ParsingState::resetRowAndSequence() {
 }
 
 void DWARFDebugLine::ParsingState::appendRowToMatrix() {
+  unsigned RowNumber = LineTable->Rows.size();
   if (Sequence.Empty) {
     // Record the beginning of instruction sequence.
     Sequence.Empty = false;
     Sequence.LowPC = Row.Address.Address;
     Sequence.FirstRowIndex = RowNumber;
   }
-  ++RowNumber;
   LineTable->appendRow(Row);
   if (Row.EndSequence) {
     // Record the end of instruction sequence.
     Sequence.HighPC = Row.Address.Address;
-    Sequence.LastRowIndex = RowNumber;
+    Sequence.LastRowIndex = RowNumber + 1;
     Sequence.SectionIndex = Row.Address.SectionIndex;
     if (Sequence.isValid())
       LineTable->appendSequence(Sequence);