@@ -171,9 +171,6 @@ class COFFDumper : public ObjDumper {
171
171
void printDelayImportedSymbols (
172
172
const DelayImportDirectoryEntryRef &I,
173
173
iterator_range<imported_symbol_iterator> Range);
174
- Expected<const coff_resource_dir_entry &>
175
- getResourceDirectoryTableEntry (const coff_resource_dir_table &Table,
176
- uint32_t Index);
177
174
178
175
typedef DenseMap<const coff_section*, std::vector<RelocationRef> > RelocMapTy;
179
176
@@ -1790,8 +1787,7 @@ COFFDumper::countTotalTableEntries(ResourceSectionRef RSF,
1790
1787
uint32_t TotalEntries = 0 ;
1791
1788
for (int i = 0 ; i < Table.NumberOfNameEntries + Table.NumberOfIDEntries ;
1792
1789
i++) {
1793
- auto Entry = unwrapOrError (Obj->getFileName (),
1794
- getResourceDirectoryTableEntry (Table, i));
1790
+ auto Entry = unwrapOrError (Obj->getFileName (), RSF.getTableEntry (Table, i));
1795
1791
if (Entry.Offset .isSubDir ()) {
1796
1792
StringRef NextLevel;
1797
1793
if (Level == " Name" )
@@ -1818,8 +1814,7 @@ void COFFDumper::printResourceDirectoryTable(
1818
1814
// Iterate through level in resource directory tree.
1819
1815
for (int i = 0 ; i < Table.NumberOfNameEntries + Table.NumberOfIDEntries ;
1820
1816
i++) {
1821
- auto Entry = unwrapOrError (Obj->getFileName (),
1822
- getResourceDirectoryTableEntry (Table, i));
1817
+ auto Entry = unwrapOrError (Obj->getFileName (), RSF.getTableEntry (Table, i));
1823
1818
StringRef Name;
1824
1819
SmallString<20 > IDStr;
1825
1820
raw_svector_ostream OS (IDStr);
@@ -1873,15 +1868,6 @@ void COFFDumper::printResourceDirectoryTable(
1873
1868
}
1874
1869
}
1875
1870
1876
- Expected<const coff_resource_dir_entry &>
1877
- COFFDumper::getResourceDirectoryTableEntry (const coff_resource_dir_table &Table,
1878
- uint32_t Index) {
1879
- if (Index >= (uint32_t )(Table.NumberOfNameEntries + Table.NumberOfIDEntries ))
1880
- return createError (" can't get resource directory table entry" );
1881
- auto TablePtr = reinterpret_cast <const coff_resource_dir_entry *>(&Table + 1 );
1882
- return TablePtr[Index];
1883
- }
1884
-
1885
1871
void COFFDumper::printStackMap () const {
1886
1872
object::SectionRef StackMapSection;
1887
1873
for (auto Sec : Obj->sections ()) {
0 commit comments