Skip to content

Commit 055492d

Browse files
author
Amirhossein Pashaeehir
committed
Remove UnwindTable dependency on CIE, and FDE (transitively on llvm/Object)
For creating new UnwindTable, two static methods was implemented inside it, to create an instance of it from a CIE or FDE. This static methods are moved out of the class as a library functions.
1 parent 57828fe commit 055492d

File tree

3 files changed

+71
-64
lines changed

3 files changed

+71
-64
lines changed

llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,6 @@ class UnwindRow {
311311

312312
LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, const UnwindRow &Row);
313313

314-
class CIE;
315-
class FDE;
316-
317314
/// A class that contains all UnwindRow objects for an FDE or a single unwind
318315
/// row for a CIE. To unwind an address the rows, which are sorted by start
319316
/// address, can be searched to find the UnwindRow with the lowest starting
@@ -334,6 +331,12 @@ class UnwindTable {
334331
assert(Index < size());
335332
return Rows[Index];
336333
}
334+
void insertRow(const UnwindRow &Row) { Rows.push_back(Row); }
335+
336+
/// Set the last address that this unwinding table refers to.
337+
///
338+
/// This is used when this table is created based on a FDE.
339+
void setEndAddress(uint64_t Addr) { EndAddress = Addr; }
337340

338341
/// Dump the UnwindTable to the stream.
339342
///
@@ -352,32 +355,6 @@ class UnwindTable {
352355
LLVM_ABI void dump(raw_ostream &OS, DIDumpOptions DumpOpts,
353356
unsigned IndentLevel = 0) const;
354357

355-
/// Create an UnwindTable from a Common Information Entry (CIE).
356-
///
357-
/// \param Cie The Common Information Entry to extract the table from. The
358-
/// CFIProgram is retrieved from the \a Cie object and used to create the
359-
/// UnwindTable.
360-
///
361-
/// \returns An error if the DWARF Call Frame Information opcodes have state
362-
/// machine errors, or a valid UnwindTable otherwise.
363-
LLVM_ABI static Expected<UnwindTable> create(const CIE *Cie);
364-
365-
/// Create an UnwindTable from a Frame Descriptor Entry (FDE).
366-
///
367-
/// \param Fde The Frame Descriptor Entry to extract the table from. The
368-
/// CFIProgram is retrieved from the \a Fde object and used to create the
369-
/// UnwindTable.
370-
///
371-
/// \returns An error if the DWARF Call Frame Information opcodes have state
372-
/// machine errors, or a valid UnwindTable otherwise.
373-
LLVM_ABI static Expected<UnwindTable> create(const FDE *Fde);
374-
375-
private:
376-
RowContainer Rows;
377-
/// The end address when data is extracted from a FDE. This value will be
378-
/// invalid when a UnwindTable is extracted from a CIE.
379-
std::optional<uint64_t> EndAddress;
380-
381358
/// Parse the information in the CFIProgram and update the CurrRow object
382359
/// that the state machine describes.
383360
///
@@ -395,10 +372,40 @@ class UnwindTable {
395372
/// DW_CFA_restore and DW_CFA_restore_extended opcodes.
396373
Error parseRows(const CFIProgram &CFIP, UnwindRow &CurrRow,
397374
const RegisterLocations *InitialLocs);
375+
376+
private:
377+
RowContainer Rows;
378+
/// The end address when data is extracted from a FDE. This value will be
379+
/// invalid when a UnwindTable is extracted from a CIE.
380+
std::optional<uint64_t> EndAddress;
398381
};
399382

400383
LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, const UnwindTable &Rows);
401384

385+
class CIE;
386+
387+
/// Create an UnwindTable from a Common Information Entry (CIE).
388+
///
389+
/// \param Cie The Common Information Entry to extract the table from. The
390+
/// CFIProgram is retrieved from the \a Cie object and used to create the
391+
/// UnwindTable.
392+
///
393+
/// \returns An error if the DWARF Call Frame Information opcodes have state
394+
/// machine errors, or a valid UnwindTable otherwise.
395+
Expected<UnwindTable> createUnwindTable(const CIE *Cie);
396+
397+
class FDE;
398+
399+
/// Create an UnwindTable from a Frame Descriptor Entry (FDE).
400+
///
401+
/// \param Fde The Frame Descriptor Entry to extract the table from. The
402+
/// CFIProgram is retrieved from the \a Fde object and used to create the
403+
/// UnwindTable.
404+
///
405+
/// \returns An error if the DWARF Call Frame Information opcodes have state
406+
/// machine errors, or a valid UnwindTable otherwise.
407+
Expected<UnwindTable> createUnwindTable(const FDE *Fde);
408+
402409
/// An entry in either debug_frame or eh_frame. This entry can be a CIE or an
403410
/// FDE.
404411
class FrameEntry {

llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ raw_ostream &llvm::dwarf::operator<<(raw_ostream &OS, const UnwindTable &Rows) {
203203
return OS;
204204
}
205205

206-
Expected<UnwindTable> UnwindTable::create(const FDE *Fde) {
206+
Expected<UnwindTable> llvm::dwarf::createUnwindTable(const FDE *Fde) {
207207
const CIE *Cie = Fde->getLinkedCIE();
208208
if (Cie == nullptr)
209209
return createStringError(errc::invalid_argument,
@@ -217,7 +217,7 @@ Expected<UnwindTable> UnwindTable::create(const FDE *Fde) {
217217
UnwindTable UT;
218218
UnwindRow Row;
219219
Row.setAddress(Fde->getInitialLocation());
220-
UT.EndAddress = Fde->getInitialLocation() + Fde->getAddressRange();
220+
UT.setEndAddress(Fde->getInitialLocation() + Fde->getAddressRange());
221221
if (Error CieError = UT.parseRows(Cie->cfis(), Row, nullptr))
222222
return std::move(CieError);
223223
// We need to save the initial locations of registers from the CIE parsing
@@ -229,11 +229,11 @@ Expected<UnwindTable> UnwindTable::create(const FDE *Fde) {
229229
// Do not add that to the unwind table.
230230
if (Row.getRegisterLocations().hasLocations() ||
231231
Row.getCFAValue().getLocation() != UnwindLocation::Unspecified)
232-
UT.Rows.push_back(Row);
232+
UT.insertRow(Row);
233233
return UT;
234234
}
235235

236-
Expected<UnwindTable> UnwindTable::create(const CIE *Cie) {
236+
Expected<UnwindTable> llvm::dwarf::createUnwindTable(const CIE *Cie) {
237237
// Rows will be empty if there are no CFI instructions.
238238
if (Cie->cfis().empty())
239239
return UnwindTable();
@@ -246,7 +246,7 @@ Expected<UnwindTable> UnwindTable::create(const CIE *Cie) {
246246
// Do not add that to the unwind table.
247247
if (Row.getRegisterLocations().hasLocations() ||
248248
Row.getCFAValue().getLocation() != UnwindLocation::Unspecified)
249-
UT.Rows.push_back(Row);
249+
UT.insertRow(Row);
250250
return UT;
251251
}
252252

@@ -605,7 +605,7 @@ void CIE::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const {
605605
CFIs.dump(OS, DumpOpts, /*IndentLevel=*/1, /*InitialLocation=*/{});
606606
OS << "\n";
607607

608-
if (Expected<UnwindTable> RowsOrErr = UnwindTable::create(this))
608+
if (Expected<UnwindTable> RowsOrErr = createUnwindTable(this))
609609
RowsOrErr->dump(OS, DumpOpts, 1);
610610
else {
611611
DumpOpts.RecoverableErrorHandler(joinErrors(
@@ -633,7 +633,7 @@ void FDE::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const {
633633
CFIs.dump(OS, DumpOpts, /*IndentLevel=*/1, InitialLocation);
634634
OS << "\n";
635635

636-
if (Expected<UnwindTable> RowsOrErr = UnwindTable::create(this))
636+
if (Expected<UnwindTable> RowsOrErr = createUnwindTable(this))
637637
RowsOrErr->dump(OS, DumpOpts, 1);
638638
else {
639639
DumpOpts.RecoverableErrorHandler(joinErrors(

llvm/unittests/DebugInfo/DWARF/DWARFDebugFrameTest.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,9 @@ TEST(DWARFDebugFrame, UnwindTableEmptyRows) {
465465
EXPECT_THAT_ERROR(parseCFI(TestCIE, {}), Succeeded());
466466
EXPECT_TRUE(TestCIE.cfis().empty());
467467

468-
// Verify dwarf::UnwindTable::create() won't result in errors and
468+
// Verify dwarf::createUnwindTable() won't result in errors and
469469
// and empty rows are not added to CIE UnwindTable.
470-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestCIE);
470+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestCIE);
471471
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
472472
const size_t ExpectedNumOfRows = 0;
473473
EXPECT_EQ(RowsOrErr->size(), ExpectedNumOfRows);
@@ -486,9 +486,9 @@ TEST(DWARFDebugFrame, UnwindTableEmptyRows) {
486486
EXPECT_THAT_ERROR(parseCFI(TestFDE, {}), Succeeded());
487487
EXPECT_TRUE(TestFDE.cfis().empty());
488488

489-
// Verify dwarf::UnwindTable::create() won't result in errors and
489+
// Verify dwarf::createUnwindTable() won't result in errors and
490490
// and empty rows are not added to FDE UnwindTable.
491-
RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
491+
RowsOrErr = dwarf::createUnwindTable(&TestFDE);
492492
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
493493
EXPECT_EQ(RowsOrErr->size(), ExpectedNumOfRows);
494494
}
@@ -504,9 +504,9 @@ TEST(DWARFDebugFrame, UnwindTableEmptyRows_NOPs) {
504504
EXPECT_THAT_ERROR(parseCFI(TestCIE, {dwarf::DW_CFA_nop}), Succeeded());
505505
EXPECT_TRUE(!TestCIE.cfis().empty());
506506

507-
// Verify dwarf::UnwindTable::create() won't result in errors and
507+
// Verify dwarf::createUnwindTable() won't result in errors and
508508
// and empty rows are not added to CIE UnwindTable.
509-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestCIE);
509+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestCIE);
510510
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
511511
const size_t ExpectedNumOfRows = 0;
512512
EXPECT_EQ(RowsOrErr->size(), ExpectedNumOfRows);
@@ -525,9 +525,9 @@ TEST(DWARFDebugFrame, UnwindTableEmptyRows_NOPs) {
525525
EXPECT_THAT_ERROR(parseCFI(TestFDE, {dwarf::DW_CFA_nop}), Succeeded());
526526
EXPECT_TRUE(!TestFDE.cfis().empty());
527527

528-
// Verify dwarf::UnwindTable::create() won't result in errors and
528+
// Verify dwarf::createUnwindTable() won't result in errors and
529529
// and empty rows are not added to FDE UnwindTable.
530-
RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
530+
RowsOrErr = dwarf::createUnwindTable(&TestFDE);
531531
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
532532
EXPECT_EQ(RowsOrErr->size(), ExpectedNumOfRows);
533533
}
@@ -567,7 +567,7 @@ TEST(DWARFDebugFrame, UnwindTableErrorNonAscendingFDERows) {
567567
Succeeded());
568568

569569
// Verify we catch state machine error.
570-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
570+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
571571
EXPECT_THAT_ERROR(RowsOrErr.takeError(),
572572
FailedWithMessage("DW_CFA_set_loc with adrress 0x1000 which"
573573
" must be greater than the current row "
@@ -603,7 +603,7 @@ TEST(DWARFDebugFrame, UnwindTableError_DW_CFA_restore_state) {
603603
Succeeded());
604604

605605
// Verify we catch state machine error.
606-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
606+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
607607
EXPECT_THAT_ERROR(RowsOrErr.takeError(),
608608
FailedWithMessage("DW_CFA_restore_state without a matching "
609609
"previous DW_CFA_remember_state"));
@@ -639,7 +639,7 @@ TEST(DWARFDebugFrame, UnwindTableError_DW_CFA_GNU_window_save) {
639639
Succeeded());
640640

641641
// Verify we catch state machine error.
642-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
642+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
643643
EXPECT_THAT_ERROR(RowsOrErr.takeError(),
644644
FailedWithMessage("DW_CFA opcode 0x2d is not supported for "
645645
"architecture x86_64"));
@@ -674,7 +674,7 @@ TEST(DWARFDebugFrame, UnwindTableError_DW_CFA_def_cfa_offset) {
674674
Succeeded());
675675

676676
// Verify we catch state machine error.
677-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
677+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
678678
EXPECT_THAT_ERROR(RowsOrErr.takeError(),
679679
FailedWithMessage("DW_CFA_def_cfa_offset found when CFA "
680680
"rule was not RegPlusOffset"));
@@ -709,7 +709,7 @@ TEST(DWARFDebugFrame, UnwindTableDefCFAOffsetSFCFAError) {
709709
Succeeded());
710710

711711
// Verify we catch state machine error.
712-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
712+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
713713
EXPECT_THAT_ERROR(RowsOrErr.takeError(),
714714
FailedWithMessage("DW_CFA_def_cfa_offset_sf found when CFA "
715715
"rule was not RegPlusOffset"));
@@ -745,7 +745,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_def_cfa_register) {
745745
EXPECT_THAT_ERROR(parseCFI(TestFDE, {}), Succeeded());
746746

747747
// Verify we catch state machine error.
748-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
748+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
749749
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
750750
const dwarf::UnwindTable &Rows = RowsOrErr.get();
751751
EXPECT_EQ(Rows.size(), 1u);
@@ -817,7 +817,7 @@ TEST(DWARFDebugFrame, UnwindTableRowPushingOpcodes) {
817817
Reg, dwarf::UnwindLocation::createIsRegisterPlusOffset(InReg, 0));
818818

819819
// Verify we catch state machine error.
820-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
820+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
821821
ASSERT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
822822
const dwarf::UnwindTable &Rows = RowsOrErr.get();
823823
EXPECT_EQ(Rows.size(), 6u);
@@ -892,7 +892,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_restore) {
892892
Reg, dwarf::UnwindLocation::createIsRegisterPlusOffset(InReg, 0));
893893

894894
// Verify we catch state machine error.
895-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
895+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
896896
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
897897
const dwarf::UnwindTable &Rows = RowsOrErr.get();
898898
EXPECT_EQ(Rows.size(), 2u);
@@ -955,7 +955,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_restore_extended) {
955955
Reg, dwarf::UnwindLocation::createIsRegisterPlusOffset(InReg, 0));
956956

957957
// Verify we catch state machine error.
958-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
958+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
959959
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
960960
const dwarf::UnwindTable &Rows = RowsOrErr.get();
961961
EXPECT_EQ(Rows.size(), 2u);
@@ -1016,7 +1016,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_offset) {
10161016
Reg3, dwarf::UnwindLocation::createAtCFAPlusOffset(8));
10171017

10181018
// Verify we catch state machine error.
1019-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
1019+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
10201020
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
10211021
const dwarf::UnwindTable &Rows = RowsOrErr.get();
10221022
EXPECT_EQ(Rows.size(), 1u);
@@ -1068,7 +1068,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_val_offset) {
10681068
Reg2, dwarf::UnwindLocation::createIsCFAPlusOffset(8));
10691069

10701070
// Verify we catch state machine error.
1071-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
1071+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
10721072
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
10731073
const dwarf::UnwindTable &Rows = RowsOrErr.get();
10741074
EXPECT_EQ(Rows.size(), 1u);
@@ -1113,7 +1113,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_nop) {
11131113
Reg1, dwarf::UnwindLocation::createAtCFAPlusOffset(-8));
11141114

11151115
// Verify we catch state machine error.
1116-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
1116+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
11171117
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
11181118
const dwarf::UnwindTable &Rows = RowsOrErr.get();
11191119
EXPECT_EQ(Rows.size(), 1u);
@@ -1203,7 +1203,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_remember_state) {
12031203
Reg3, dwarf::UnwindLocation::createAtCFAPlusOffset(-24));
12041204

12051205
// Verify we catch state machine error.
1206-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
1206+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
12071207
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
12081208
const dwarf::UnwindTable &Rows = RowsOrErr.get();
12091209
EXPECT_EQ(Rows.size(), 5u);
@@ -1270,7 +1270,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_undefined) {
12701270
dwarf::UnwindLocation::createUndefined());
12711271

12721272
// Verify we catch state machine error.
1273-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
1273+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
12741274
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
12751275
const dwarf::UnwindTable &Rows = RowsOrErr.get();
12761276
EXPECT_EQ(Rows.size(), 1u);
@@ -1314,7 +1314,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_same_value) {
13141314
VerifyLocs.setRegisterLocation(Reg1, dwarf::UnwindLocation::createSame());
13151315

13161316
// Verify we catch state machine error.
1317-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
1317+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
13181318
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
13191319
const dwarf::UnwindTable &Rows = RowsOrErr.get();
13201320
EXPECT_EQ(Rows.size(), 1u);
@@ -1360,7 +1360,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_register) {
13601360
Reg, dwarf::UnwindLocation::createIsRegisterPlusOffset(InReg, 0));
13611361

13621362
// Verify we catch state machine error.
1363-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
1363+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
13641364
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
13651365
const dwarf::UnwindTable &Rows = RowsOrErr.get();
13661366
EXPECT_EQ(Rows.size(), 1u);
@@ -1412,7 +1412,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_expression) {
14121412
Reg, dwarf::UnwindLocation::createAtDWARFExpression(Expr));
14131413

14141414
// Verify we catch state machine error.
1415-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
1415+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
14161416
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
14171417
const dwarf::UnwindTable &Rows = RowsOrErr.get();
14181418
EXPECT_EQ(Rows.size(), 1u);
@@ -1464,7 +1464,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_val_expression) {
14641464
Reg, dwarf::UnwindLocation::createIsDWARFExpression(Expr));
14651465

14661466
// Verify we catch state machine error.
1467-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
1467+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
14681468
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
14691469
const dwarf::UnwindTable &Rows = RowsOrErr.get();
14701470
EXPECT_EQ(Rows.size(), 1u);
@@ -1527,7 +1527,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_def_cfa) {
15271527
Reg, dwarf::UnwindLocation::createIsRegisterPlusOffset(InReg, 0));
15281528

15291529
// Verify we catch state machine error.
1530-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
1530+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
15311531
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
15321532
const dwarf::UnwindTable &Rows = RowsOrErr.get();
15331533
EXPECT_EQ(Rows.size(), 5u);
@@ -1625,7 +1625,7 @@ TEST(DWARFDebugFrame, UnwindTable_DW_CFA_LLVM_def_aspace_cfa) {
16251625
Reg, dwarf::UnwindLocation::createIsRegisterPlusOffset(InReg, 0));
16261626

16271627
// Verify we catch state machine error.
1628-
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::UnwindTable::create(&TestFDE);
1628+
Expected<dwarf::UnwindTable> RowsOrErr = dwarf::createUnwindTable(&TestFDE);
16291629
EXPECT_THAT_ERROR(RowsOrErr.takeError(), Succeeded());
16301630
const dwarf::UnwindTable &Rows = RowsOrErr.get();
16311631
EXPECT_EQ(Rows.size(), 5u);

0 commit comments

Comments
 (0)