@@ -391,29 +391,29 @@ bool UnwindPlan::Row::operator==(const UnwindPlan::Row &rhs) const {
391
391
}
392
392
393
393
void UnwindPlan::AppendRow (Row row) {
394
- if (m_row_list.empty () || m_row_list.back ()-> GetOffset () != row.GetOffset ())
395
- m_row_list.push_back (std::make_shared<Row>( std:: move (row) ));
394
+ if (m_row_list.empty () || m_row_list.back (). GetOffset () != row.GetOffset ())
395
+ m_row_list.push_back (std::move (row));
396
396
else
397
- * m_row_list.back () = std::move (row);
397
+ m_row_list.back () = std::move (row);
398
398
}
399
399
400
400
struct RowLess {
401
- bool operator ()(addr_t a, const UnwindPlan::RowSP &b) const {
402
- return a < b-> GetOffset ();
401
+ bool operator ()(addr_t a, const UnwindPlan::Row &b) const {
402
+ return a < b. GetOffset ();
403
403
}
404
- bool operator ()(const UnwindPlan::RowSP &a, addr_t b) const {
405
- return a-> GetOffset () < b;
404
+ bool operator ()(const UnwindPlan::Row &a, addr_t b) const {
405
+ return a. GetOffset () < b;
406
406
}
407
407
};
408
408
409
409
void UnwindPlan::InsertRow (Row row, bool replace_existing) {
410
410
auto it = llvm::lower_bound (m_row_list, row.GetOffset (), RowLess ());
411
- if (it == m_row_list.end () || it->get ()-> GetOffset () > row.GetOffset ())
412
- m_row_list.insert (it, std::make_shared<Row>( std:: move (row) ));
411
+ if (it == m_row_list.end () || it->GetOffset () > row.GetOffset ())
412
+ m_row_list.insert (it, std::move (row));
413
413
else {
414
- assert (it->get ()-> GetOffset () == row.GetOffset ());
414
+ assert (it->GetOffset () == row.GetOffset ());
415
415
if (replace_existing)
416
- ** it = std::move (row);
416
+ *it = std::move (row);
417
417
}
418
418
}
419
419
@@ -425,7 +425,7 @@ UnwindPlan::GetRowForFunctionOffset(std::optional<int> offset) const {
425
425
return nullptr ;
426
426
// upper_bound returns the row strictly greater than our desired offset, which
427
427
// means that the row before it is a match.
428
- return std::prev (it)-> get ( );
428
+ return &* std::prev (it);
429
429
}
430
430
431
431
bool UnwindPlan::IsValidRowIndex (uint32_t idx) const {
@@ -434,7 +434,7 @@ bool UnwindPlan::IsValidRowIndex(uint32_t idx) const {
434
434
435
435
const UnwindPlan::Row *UnwindPlan::GetRowAtIndex (uint32_t idx) const {
436
436
if (idx < m_row_list.size ())
437
- return m_row_list[idx]. get () ;
437
+ return & m_row_list[idx];
438
438
LLDB_LOG (GetLog (LLDBLog::Unwind),
439
439
" error: UnwindPlan::GetRowAtIndex(idx = {0}) invalid index "
440
440
" (number rows is {1})" ,
@@ -448,7 +448,7 @@ const UnwindPlan::Row *UnwindPlan::GetLastRow() const {
448
448
" UnwindPlan::GetLastRow() when rows are empty" );
449
449
return nullptr ;
450
450
}
451
- return m_row_list.back (). get ();
451
+ return & m_row_list.back ();
452
452
}
453
453
454
454
bool UnwindPlan::PlanValidAtAddress (Address addr) const {
@@ -567,9 +567,9 @@ void UnwindPlan::Dump(Stream &s, Thread *thread, lldb::addr_t base_addr) const {
567
567
range.Dump (&s, target_sp.get (), Address::DumpStyleSectionNameOffset);
568
568
s.EOL ();
569
569
}
570
- for (const auto &[index , row_sp ] : llvm::enumerate (m_row_list)) {
570
+ for (const auto &[index , row ] : llvm::enumerate (m_row_list)) {
571
571
s.Format (" row[{0}]: " , index );
572
- row_sp-> Dump (s, this , thread, base_addr);
572
+ row. Dump (s, this , thread, base_addr);
573
573
s << " \n " ;
574
574
}
575
575
}
0 commit comments