From 17425db0e31154e7c52e973128a0c145a879aed2 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 15 Apr 2019 07:40:30 +0000 Subject: [PATCH] [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 --- include/llvm/DebugInfo/DWARF/DWARFDebugLine.h | 3 --- lib/DebugInfo/DWARF/DWARFDebugLine.cpp | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h b/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h index 4304e84350a..0fc34a8e7e4 100644 --- a/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h +++ b/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h @@ -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; }; diff --git a/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/lib/DebugInfo/DWARF/DWARFDebugLine.cpp index 8299be38ac6..47df83e6817 100644 --- a/lib/DebugInfo/DWARF/DWARFDebugLine.cpp +++ b/lib/DebugInfo/DWARF/DWARFDebugLine.cpp @@ -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); -- 2.50.1