@@ -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
@@ -424,7 +424,7 @@ const UnwindPlan::Row *UnwindPlan::GetRowForFunctionOffset(int offset) const {
424
424
return nullptr ;
425
425
// upper_bound returns the row strictly greater than our desired offset, which
426
426
// means that the row before it is a match.
427
- return std::prev (it)-> get ( );
427
+ return &* std::prev (it);
428
428
}
429
429
430
430
bool UnwindPlan::IsValidRowIndex (uint32_t idx) const {
@@ -433,7 +433,7 @@ bool UnwindPlan::IsValidRowIndex(uint32_t idx) const {
433
433
434
434
const UnwindPlan::Row *UnwindPlan::GetRowAtIndex (uint32_t idx) const {
435
435
if (idx < m_row_list.size ())
436
- return m_row_list[idx]. get () ;
436
+ return & m_row_list[idx];
437
437
LLDB_LOG (GetLog (LLDBLog::Unwind),
438
438
" error: UnwindPlan::GetRowAtIndex(idx = {0}) invalid index "
439
439
" (number rows is {1})" ,
@@ -447,7 +447,7 @@ const UnwindPlan::Row *UnwindPlan::GetLastRow() const {
447
447
" UnwindPlan::GetLastRow() when rows are empty" );
448
448
return nullptr ;
449
449
}
450
- return m_row_list.back (). get ();
450
+ return & m_row_list.back ();
451
451
}
452
452
453
453
bool UnwindPlan::PlanValidAtAddress (Address addr) {
@@ -566,9 +566,9 @@ void UnwindPlan::Dump(Stream &s, Thread *thread, lldb::addr_t base_addr) const {
566
566
range.Dump (&s, target_sp.get (), Address::DumpStyleSectionNameOffset);
567
567
s.EOL ();
568
568
}
569
- for (const auto &[index, row_sp ] : llvm::enumerate (m_row_list)) {
569
+ for (const auto &[index, row ] : llvm::enumerate (m_row_list)) {
570
570
s.Format (" row[{0}]: " , index);
571
- row_sp-> Dump (s, this , thread, base_addr);
571
+ row. Dump (s, this , thread, base_addr);
572
572
s << " \n " ;
573
573
}
574
574
}
0 commit comments