Skip to content

Commit 85697b4

Browse files
committed
resolve comment
1 parent 94774f0 commit 85697b4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/DWARFLinker/Classic/DWARFLinker.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,16 +414,14 @@ static bool isTlsAddressCode(uint8_t DW_OP_Code) {
414414
}
415415

416416
static void constructSeqOffsettoOrigRowMapping(
417-
CompileUnit &Unit, const DWARFDebugLine::LineTable *LT,
417+
CompileUnit &Unit, const DWARFDebugLine::LineTable &LT,
418418
DenseMap<size_t, unsigned> &SeqOffToOrigRow) {
419419

420-
assert(LT && "Line table is null");
421-
422420
// Use std::map for ordered iteration.
423421
std::map<uint64_t, unsigned> LineTableMapping;
424422

425423
// First, trust the sequences that the DWARF parser did identify.
426-
for (const DWARFDebugLine::Sequence &Seq : LT->Sequences)
424+
for (const DWARFDebugLine::Sequence &Seq : LT.Sequences)
427425
LineTableMapping[Seq.StmtSeqOffset] = Seq.FirstRowIndex;
428426

429427
// Second, manually find sequence boundaries and match them to the
@@ -435,7 +433,7 @@ static void constructSeqOffsettoOrigRowMapping(
435433

436434
std::vector<size_t> SeqStartRows;
437435
SeqStartRows.push_back(0);
438-
for (auto [I, Row] : llvm::enumerate(ArrayRef(LT->Rows).drop_back()))
436+
for (auto [I, Row] : llvm::enumerate(ArrayRef(LT.Rows).drop_back()))
439437
if (Row.EndSequence)
440438
SeqStartRows.push_back(I + 1);
441439

@@ -2414,7 +2412,7 @@ void DWARFLinker::DIECloner::generateLineTableForUnit(CompileUnit &Unit) {
24142412
// build a map from both the parser's results and a manual
24152413
// reconstruction.
24162414
if (!LT->Rows.empty())
2417-
constructSeqOffsettoOrigRowMapping(Unit, LT, SeqOffToOrigRow);
2415+
constructSeqOffsettoOrigRowMapping(Unit, *LT, SeqOffToOrigRow);
24182416

24192417
// Create a map of original row indices to new row indices.
24202418
DenseMap<size_t, size_t> OrigRowToNewRow;

0 commit comments

Comments
 (0)