Skip to content

Commit b3b5527

Browse files
authored
[lldb] Use UnwindPlan::Row as values, part 2 (llvm#132008)
This is the mechanical part of llvm#131150. I'm also removing the interfaces taking a RowSP.
1 parent 14006c8 commit b3b5527

25 files changed

+208
-224
lines changed

lldb/include/lldb/Symbol/UnwindPlan.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,13 +462,9 @@ class UnwindPlan {
462462

463463
void Dump(Stream &s, Thread *thread, lldb::addr_t base_addr) const;
464464

465-
void AppendRow(const RowSP &row_sp);
466-
void AppendRow(Row row) { AppendRow(std::make_shared<Row>(std::move(row))); }
465+
void AppendRow(Row row);
467466

468-
void InsertRow(const RowSP &row_sp, bool replace_existing = false);
469-
void InsertRow(Row row, bool replace_existing = false) {
470-
InsertRow(std::make_shared<Row>(std::move(row)), replace_existing);
471-
}
467+
void InsertRow(Row row, bool replace_existing = false);
472468

473469
// Returns a pointer to the best row for the given offset into the function's
474470
// instructions. If offset is -1 it indicates that the function start is

lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -349,16 +349,16 @@ UnwindPlanSP ABIMacOSX_arm64::CreateFunctionEntryUnwindPlan() {
349349
uint32_t sp_reg_num = arm64_dwarf::sp;
350350
uint32_t pc_reg_num = arm64_dwarf::pc;
351351

352-
UnwindPlan::RowSP row(new UnwindPlan::Row);
352+
UnwindPlan::Row row;
353353

354354
// Our previous Call Frame Address is the stack pointer
355-
row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
355+
row.GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
356356

357357
// Our previous PC is in the LR, all other registers are the same.
358-
row->SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
358+
row.SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
359359

360360
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
361-
plan_sp->AppendRow(row);
361+
plan_sp->AppendRow(std::move(row));
362362
plan_sp->SetSourceName("arm64 at-func-entry default");
363363
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
364364
return plan_sp;
@@ -368,18 +368,17 @@ UnwindPlanSP ABIMacOSX_arm64::CreateDefaultUnwindPlan() {
368368
uint32_t fp_reg_num = arm64_dwarf::fp;
369369
uint32_t pc_reg_num = arm64_dwarf::pc;
370370

371-
UnwindPlan::RowSP row(new UnwindPlan::Row);
371+
UnwindPlan::Row row;
372372
const int32_t ptr_size = 8;
373373

374-
row->GetCFAValue().SetIsRegisterPlusOffset(fp_reg_num, 2 * ptr_size);
375-
row->SetOffset(0);
376-
row->SetUnspecifiedRegistersAreUndefined(true);
374+
row.GetCFAValue().SetIsRegisterPlusOffset(fp_reg_num, 2 * ptr_size);
375+
row.SetUnspecifiedRegistersAreUndefined(true);
377376

378-
row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
379-
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
377+
row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
378+
row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
380379

381380
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
382-
plan_sp->AppendRow(row);
381+
plan_sp->AppendRow(std::move(row));
383382
plan_sp->SetSourceName("arm64-apple-darwin default unwind plan");
384383
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
385384
plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);

lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,14 @@ UnwindPlanSP ABISysV_arm64::CreateFunctionEntryUnwindPlan() {
389389
uint32_t lr_reg_num = arm64_dwarf::lr;
390390
uint32_t sp_reg_num = arm64_dwarf::sp;
391391

392-
UnwindPlan::RowSP row(new UnwindPlan::Row);
392+
UnwindPlan::Row row;
393393

394394
// Our previous Call Frame Address is the stack pointer, all other registers
395395
// are the same.
396-
row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
396+
row.GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
397397

398398
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
399-
plan_sp->AppendRow(row);
399+
plan_sp->AppendRow(std::move(row));
400400
plan_sp->SetReturnAddressRegister(lr_reg_num);
401401
plan_sp->SetSourceName("arm64 at-func-entry default");
402402
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
@@ -409,18 +409,17 @@ UnwindPlanSP ABISysV_arm64::CreateDefaultUnwindPlan() {
409409
uint32_t fp_reg_num = arm64_dwarf::fp;
410410
uint32_t pc_reg_num = arm64_dwarf::pc;
411411

412-
UnwindPlan::RowSP row(new UnwindPlan::Row);
412+
UnwindPlan::Row row;
413413
const int32_t ptr_size = 8;
414414

415-
row->GetCFAValue().SetIsRegisterPlusOffset(fp_reg_num, 2 * ptr_size);
416-
row->SetOffset(0);
417-
row->SetUnspecifiedRegistersAreUndefined(true);
415+
row.GetCFAValue().SetIsRegisterPlusOffset(fp_reg_num, 2 * ptr_size);
416+
row.SetUnspecifiedRegistersAreUndefined(true);
418417

419-
row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
420-
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
418+
row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
419+
row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
421420

422421
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
423-
plan_sp->AppendRow(row);
422+
plan_sp->AppendRow(std::move(row));
424423
plan_sp->SetSourceName("arm64 default unwind plan");
425424
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
426425
plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);

lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,16 +560,16 @@ ValueObjectSP ABISysV_arc::GetReturnValueObjectImpl(Thread &thread,
560560
}
561561

562562
UnwindPlanSP ABISysV_arc::CreateFunctionEntryUnwindPlan() {
563-
UnwindPlan::RowSP row(new UnwindPlan::Row);
563+
UnwindPlan::Row row;
564564

565565
// Our Call Frame Address is the stack pointer value.
566-
row->GetCFAValue().SetIsRegisterPlusOffset(dwarf::sp, 0);
566+
row.GetCFAValue().SetIsRegisterPlusOffset(dwarf::sp, 0);
567567

568568
// The previous PC is in the BLINK, all other registers are the same.
569-
row->SetRegisterLocationToRegister(dwarf::pc, dwarf::blink, true);
569+
row.SetRegisterLocationToRegister(dwarf::pc, dwarf::blink, true);
570570

571571
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
572-
plan_sp->AppendRow(row);
572+
plan_sp->AppendRow(std::move(row));
573573
plan_sp->SetSourceName("arc at-func-entry default");
574574
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
575575
return plan_sp;

lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,16 +1788,16 @@ UnwindPlanSP ABIMacOSX_arm::CreateFunctionEntryUnwindPlan() {
17881788
uint32_t sp_reg_num = dwarf_sp;
17891789
uint32_t pc_reg_num = dwarf_pc;
17901790

1791-
UnwindPlan::RowSP row(new UnwindPlan::Row);
1791+
UnwindPlan::Row row;
17921792

17931793
// Our Call Frame Address is the stack pointer value
1794-
row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
1794+
row.GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
17951795

17961796
// The previous PC is in the LR, all other registers are the same.
1797-
row->SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
1797+
row.SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
17981798

17991799
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
1800-
plan_sp->AppendRow(row);
1800+
plan_sp->AppendRow(std::move(row));
18011801
plan_sp->SetSourceName("arm at-func-entry default");
18021802
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
18031803
return plan_sp;
@@ -1808,18 +1808,17 @@ UnwindPlanSP ABIMacOSX_arm::CreateDefaultUnwindPlan() {
18081808
dwarf_r7; // apple uses r7 for all frames. Normal arm uses r11
18091809
uint32_t pc_reg_num = dwarf_pc;
18101810

1811-
UnwindPlan::RowSP row(new UnwindPlan::Row);
1811+
UnwindPlan::Row row;
18121812
const int32_t ptr_size = 4;
18131813

1814-
row->GetCFAValue().SetIsRegisterPlusOffset(fp_reg_num, 2 * ptr_size);
1815-
row->SetOffset(0);
1816-
row->SetUnspecifiedRegistersAreUndefined(true);
1814+
row.GetCFAValue().SetIsRegisterPlusOffset(fp_reg_num, 2 * ptr_size);
1815+
row.SetUnspecifiedRegistersAreUndefined(true);
18171816

1818-
row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
1819-
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
1817+
row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
1818+
row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
18201819

18211820
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
1822-
plan_sp->AppendRow(row);
1821+
plan_sp->AppendRow(std::move(row));
18231822
plan_sp->SetSourceName("arm-apple-ios default unwind plan");
18241823
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
18251824
plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);

lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,15 +1905,15 @@ UnwindPlanSP ABISysV_arm::CreateFunctionEntryUnwindPlan() {
19051905
uint32_t sp_reg_num = dwarf_sp;
19061906
uint32_t pc_reg_num = dwarf_pc;
19071907

1908-
UnwindPlan::RowSP row(new UnwindPlan::Row);
1908+
UnwindPlan::Row row;
19091909

19101910
// Our Call Frame Address is the stack pointer value
1911-
row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
1911+
row.GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
19121912

19131913
// The previous PC is in the LR, all other registers are the same.
1914-
row->SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
1914+
row.SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
19151915
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
1916-
plan_sp->AppendRow(row);
1916+
plan_sp->AppendRow(std::move(row));
19171917
plan_sp->SetSourceName("arm at-func-entry default");
19181918
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
19191919
return plan_sp;
@@ -1924,18 +1924,17 @@ UnwindPlanSP ABISysV_arm::CreateDefaultUnwindPlan() {
19241924
uint32_t fp_reg_num = dwarf_r11;
19251925
uint32_t pc_reg_num = dwarf_pc;
19261926

1927-
UnwindPlan::RowSP row(new UnwindPlan::Row);
1927+
UnwindPlan::Row row;
19281928
const int32_t ptr_size = 4;
19291929

1930-
row->GetCFAValue().SetIsRegisterPlusOffset(fp_reg_num, 2 * ptr_size);
1931-
row->SetOffset(0);
1932-
row->SetUnspecifiedRegistersAreUndefined(true);
1930+
row.GetCFAValue().SetIsRegisterPlusOffset(fp_reg_num, 2 * ptr_size);
1931+
row.SetUnspecifiedRegistersAreUndefined(true);
19331932

1934-
row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
1935-
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
1933+
row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
1934+
row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
19361935

19371936
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
1938-
plan_sp->AppendRow(row);
1937+
plan_sp->AppendRow(std::move(row));
19391938
plan_sp->SetSourceName("arm default unwind plan");
19401939
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
19411940
plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);

lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,18 +1196,17 @@ ValueObjectSP ABISysV_hexagon::GetReturnValueObjectImpl(
11961196
// called when we are on the first instruction of a new function for hexagon
11971197
// the return address is in RA (R31)
11981198
UnwindPlanSP ABISysV_hexagon::CreateFunctionEntryUnwindPlan() {
1199-
UnwindPlan::RowSP row(new UnwindPlan::Row);
1199+
UnwindPlan::Row row;
12001200

12011201
// Our Call Frame Address is the stack pointer value
1202-
row->GetCFAValue().SetIsRegisterPlusOffset(LLDB_REGNUM_GENERIC_SP, 4);
1203-
row->SetOffset(0);
1202+
row.GetCFAValue().SetIsRegisterPlusOffset(LLDB_REGNUM_GENERIC_SP, 4);
12041203

12051204
// The previous PC is in the LR
1206-
row->SetRegisterLocationToRegister(LLDB_REGNUM_GENERIC_PC,
1207-
LLDB_REGNUM_GENERIC_RA, true);
1205+
row.SetRegisterLocationToRegister(LLDB_REGNUM_GENERIC_PC,
1206+
LLDB_REGNUM_GENERIC_RA, true);
12081207

12091208
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindGeneric);
1210-
plan_sp->AppendRow(row);
1209+
plan_sp->AppendRow(std::move(row));
12111210
plan_sp->SetReturnAddressRegister(LLDB_REGNUM_GENERIC_RA);
12121211
plan_sp->SetSourceName("hexagon at-func-entry default");
12131212
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
@@ -1219,17 +1218,17 @@ UnwindPlanSP ABISysV_hexagon::CreateDefaultUnwindPlan() {
12191218
uint32_t sp_reg_num = LLDB_REGNUM_GENERIC_SP;
12201219
uint32_t pc_reg_num = LLDB_REGNUM_GENERIC_PC;
12211220

1222-
UnwindPlan::RowSP row(new UnwindPlan::Row);
1221+
UnwindPlan::Row row;
12231222

1224-
row->SetUnspecifiedRegistersAreUndefined(true);
1225-
row->GetCFAValue().SetIsRegisterPlusOffset(LLDB_REGNUM_GENERIC_FP, 8);
1223+
row.SetUnspecifiedRegistersAreUndefined(true);
1224+
row.GetCFAValue().SetIsRegisterPlusOffset(LLDB_REGNUM_GENERIC_FP, 8);
12261225

1227-
row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, -8, true);
1228-
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -4, true);
1229-
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
1226+
row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, -8, true);
1227+
row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -4, true);
1228+
row.SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
12301229

12311230
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindGeneric);
1232-
plan_sp->AppendRow(row);
1231+
plan_sp->AppendRow(std::move(row));
12331232
plan_sp->SetSourceName("hexagon default unwind plan");
12341233
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
12351234
plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);

lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -539,16 +539,16 @@ UnwindPlanSP ABISysV_loongarch::CreateFunctionEntryUnwindPlan() {
539539
uint32_t sp_reg_num = loongarch_dwarf::dwarf_gpr_sp;
540540
uint32_t ra_reg_num = loongarch_dwarf::dwarf_gpr_ra;
541541

542-
UnwindPlan::RowSP row(new UnwindPlan::Row);
542+
UnwindPlan::Row row;
543543

544544
// Define CFA as the stack pointer
545-
row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
545+
row.GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
546546

547547
// Previous frame's pc is in ra
548-
row->SetRegisterLocationToRegister(pc_reg_num, ra_reg_num, true);
548+
row.SetRegisterLocationToRegister(pc_reg_num, ra_reg_num, true);
549549

550550
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
551-
plan_sp->AppendRow(row);
551+
plan_sp->AppendRow(std::move(row));
552552
plan_sp->SetSourceName("loongarch function-entry unwind plan");
553553
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
554554
return plan_sp;
@@ -558,23 +558,22 @@ UnwindPlanSP ABISysV_loongarch::CreateDefaultUnwindPlan() {
558558
uint32_t pc_reg_num = LLDB_REGNUM_GENERIC_PC;
559559
uint32_t fp_reg_num = LLDB_REGNUM_GENERIC_FP;
560560

561-
UnwindPlan::RowSP row(new UnwindPlan::Row);
561+
UnwindPlan::Row row;
562562

563563
// Define the CFA as the current frame pointer value.
564-
row->GetCFAValue().SetIsRegisterPlusOffset(fp_reg_num, 0);
565-
row->SetOffset(0);
564+
row.GetCFAValue().SetIsRegisterPlusOffset(fp_reg_num, 0);
566565

567566
int reg_size = 4;
568567
if (m_is_la64)
569568
reg_size = 8;
570569

571570
// Assume the ra reg (return pc) and caller's frame pointer
572571
// have been spilled to stack already.
573-
row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, reg_size * -2, true);
574-
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, reg_size * -1, true);
572+
row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, reg_size * -2, true);
573+
row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, reg_size * -1, true);
575574

576575
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindGeneric);
577-
plan_sp->AppendRow(row);
576+
plan_sp->AppendRow(std::move(row));
578577
plan_sp->SetSourceName("loongarch default unwind plan");
579578
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
580579
plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);

lldb/source/Plugins/ABI/MSP430/ABISysV_msp430.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,13 @@ UnwindPlanSP ABISysV_msp430::CreateFunctionEntryUnwindPlan() {
309309
uint32_t sp_reg_num = dwarf_sp;
310310
uint32_t pc_reg_num = dwarf_pc;
311311

312-
UnwindPlan::RowSP row(new UnwindPlan::Row);
313-
row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 2);
314-
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -2, true);
315-
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
312+
UnwindPlan::Row row;
313+
row.GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 2);
314+
row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -2, true);
315+
row.SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
316316

317317
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
318-
plan_sp->AppendRow(row);
318+
plan_sp->AppendRow(std::move(row));
319319
plan_sp->SetSourceName("msp430 at-func-entry default");
320320
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
321321
return plan_sp;
@@ -326,14 +326,14 @@ UnwindPlanSP ABISysV_msp430::CreateDefaultUnwindPlan() {
326326
uint32_t sp_reg_num = dwarf_sp;
327327
uint32_t pc_reg_num = dwarf_pc;
328328

329-
UnwindPlan::RowSP row(new UnwindPlan::Row);
330-
row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 2);
331-
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -2, true);
332-
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
333-
row->SetRegisterLocationToUnspecified(fp_reg_num, true);
329+
UnwindPlan::Row row;
330+
row.GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 2);
331+
row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -2, true);
332+
row.SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
333+
row.SetRegisterLocationToUnspecified(fp_reg_num, true);
334334

335335
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
336-
plan_sp->AppendRow(row);
336+
plan_sp->AppendRow(std::move(row));
337337
plan_sp->SetSourceName("msp430 default unwind plan");
338338
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
339339
plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);

lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -956,32 +956,32 @@ ValueObjectSP ABISysV_mips::GetReturnValueObjectImpl(
956956
}
957957

958958
UnwindPlanSP ABISysV_mips::CreateFunctionEntryUnwindPlan() {
959-
UnwindPlan::RowSP row(new UnwindPlan::Row);
959+
UnwindPlan::Row row;
960960

961961
// Our Call Frame Address is the stack pointer value
962-
row->GetCFAValue().SetIsRegisterPlusOffset(dwarf_r29, 0);
962+
row.GetCFAValue().SetIsRegisterPlusOffset(dwarf_r29, 0);
963963

964964
// The previous PC is in the RA, all other registers are the same.
965-
row->SetRegisterLocationToRegister(dwarf_pc, dwarf_r31, true);
965+
row.SetRegisterLocationToRegister(dwarf_pc, dwarf_r31, true);
966966

967967
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
968-
plan_sp->AppendRow(row);
968+
plan_sp->AppendRow(std::move(row));
969969
plan_sp->SetSourceName("mips at-func-entry default");
970970
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
971971
plan_sp->SetReturnAddressRegister(dwarf_r31);
972972
return plan_sp;
973973
}
974974

975975
UnwindPlanSP ABISysV_mips::CreateDefaultUnwindPlan() {
976-
UnwindPlan::RowSP row(new UnwindPlan::Row);
976+
UnwindPlan::Row row;
977977

978-
row->SetUnspecifiedRegistersAreUndefined(true);
979-
row->GetCFAValue().SetIsRegisterPlusOffset(dwarf_r29, 0);
978+
row.SetUnspecifiedRegistersAreUndefined(true);
979+
row.GetCFAValue().SetIsRegisterPlusOffset(dwarf_r29, 0);
980980

981-
row->SetRegisterLocationToRegister(dwarf_pc, dwarf_r31, true);
981+
row.SetRegisterLocationToRegister(dwarf_pc, dwarf_r31, true);
982982

983983
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
984-
plan_sp->AppendRow(row);
984+
plan_sp->AppendRow(std::move(row));
985985
plan_sp->SetSourceName("mips default unwind plan");
986986
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
987987
plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);

0 commit comments

Comments
 (0)