[DWARF] Make DWARFDebugLine::ParsingState::RowNumber a local variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358374 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h b/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
index 4304e84..0fc34a8 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
@@ -355,9 +355,6 @@
/// 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;
};
diff --git a/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
index 8299be3..47df83e 100644
--- a/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+++ b/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
@@ -426,18 +426,18 @@
}
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);