Skip to content

Commit b671dd9

Browse files
committed
Merge commit '40fe7cd62165' from apple/stable/20200108 into swift/release/5.3
2 parents 7f26c1f + 40fe7cd commit b671dd9

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

lldb/include/lldb/Symbol/LineTable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class LineTable {
6868

6969
// Append an entry to a caller-provided collection that will later be
7070
// inserted in this line table.
71-
void AppendLineEntryToSequence(LineSequence *sequence, lldb::addr_t file_addr,
71+
static void AppendLineEntryToSequence(LineSequence *sequence, lldb::addr_t file_addr,
7272
uint32_t line, uint16_t column,
7373
uint16_t file_idx, bool is_start_of_statement,
7474
bool is_start_of_basic_block,

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,20 +1045,23 @@ bool SymbolFileDWARF::ParseLineTable(CompileUnit &comp_unit) {
10451045
// FIXME: Rather than parsing the whole line table and then copying it over
10461046
// into LLDB, we should explore using a callback to populate the line table
10471047
// while we parse to reduce memory usage.
1048-
std::unique_ptr<LineTable> line_table_up =
1049-
std::make_unique<LineTable>(&comp_unit);
1050-
LineSequence *sequence = line_table_up->CreateLineSequenceContainer();
1048+
std::unique_ptr<LineSequence> sequence =
1049+
LineTable::CreateLineSequenceContainer();
1050+
std::vector<std::unique_ptr<LineSequence>> sequences;
10511051
for (auto &row : line_table->Rows) {
1052-
line_table_up->AppendLineEntryToSequence(
1053-
sequence, row.Address.Address, row.Line, row.Column, row.File,
1052+
LineTable::AppendLineEntryToSequence(
1053+
sequence.get(), row.Address.Address, row.Line, row.Column, row.File,
10541054
row.IsStmt, row.BasicBlock, row.PrologueEnd, row.EpilogueBegin,
10551055
row.EndSequence);
10561056
if (row.EndSequence) {
1057-
line_table_up->InsertSequence(sequence);
1058-
sequence = line_table_up->CreateLineSequenceContainer();
1057+
sequences.push_back(std::move(sequence));
1058+
sequence = LineTable::CreateLineSequenceContainer();
10591059
}
10601060
}
10611061

1062+
std::unique_ptr<LineTable> line_table_up =
1063+
std::make_unique<LineTable>(&comp_unit, std::move(sequences));
1064+
10621065
if (SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile()) {
10631066
// We have an object file that has a line table with addresses that are not
10641067
// linked. We need to link the line table and convert the addresses that

0 commit comments

Comments
 (0)