diff options
author | Fangrui Song <maskray@google.com> | 2019-04-11 02:02:44 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-04-11 02:02:44 +0000 |
commit | 6a285dfe71cbf4713cf8be92e83360553d5c93b8 (patch) | |
tree | d933b2f30126355f04276e91fe0bf700458f362a /llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | |
parent | ff79ee144cd62ee4b6eae2f2f809130cda32cadb (diff) | |
download | bcm5719-llvm-6a285dfe71cbf4713cf8be92e83360553d5c93b8.tar.gz bcm5719-llvm-6a285dfe71cbf4713cf8be92e83360553d5c93b8.zip |
[DWARF] Set discriminator to 0 for DW_LNS_copy
Summary:
Make DW_LNS_copy set the discriminator register to 0, to conform to
DWARF 4 & 5: "Then it sets the discriminator register to 0, and sets the
basic_block, prologue_end and epilogue_begin registers to false."
Because all of DW_LNE_end_sequence, DN_LNS_copy, and special opcodes reset
discriminator to 0, we can move discriminator=0 to appendRowToMatrix.
Also, make DW_LNS_copy print before appending the row, as it is similar
to a address+=0,line+=0 special opcode, which prints before appending
the row.
Reviewers: dblaikie, probinson, aprantl
Reviewed By: dblaikie
Subscribers: danielcdh, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60364
llvm-svn: 358148
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp index 9a720651ebb..8299be38ac6 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp @@ -347,6 +347,7 @@ Error DWARFDebugLine::Prologue::parse(const DWARFDataExtractor &DebugLineData, DWARFDebugLine::Row::Row(bool DefaultIsStmt) { reset(DefaultIsStmt); } void DWARFDebugLine::Row::postAppend() { + Discriminator = 0; BasicBlock = false; PrologueEnd = false; EpilogueBegin = false; @@ -640,15 +641,14 @@ Error DWARFDebugLine::LineTable::parse( // Standard Opcodes case DW_LNS_copy: // Takes no arguments. Append a row to the matrix using the - // current values of the state-machine registers. Then set - // the basic_block register to false. - State.appendRowToMatrix(); + // current values of the state-machine registers. if (OS) { *OS << "\n"; OS->indent(12); State.Row.dump(*OS); *OS << "\n"; } + State.appendRowToMatrix(); break; case DW_LNS_advance_pc: @@ -828,8 +828,6 @@ Error DWARFDebugLine::LineTable::parse( } State.appendRowToMatrix(); - // Reset discriminator to 0. - State.Row.Discriminator = 0; } if(OS) *OS << "\n"; |