Skip to content

Commit

Permalink
Inline a version of getSectionStringTable into the only use.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285817 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
espindola committed Nov 2, 2016
1 parent 5d4f1c4 commit dbce068
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions include/llvm/Object/ELF.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ class ELFFile {
return makeArrayRef(program_header_begin(), program_header_end());
}

ErrorOr<StringRef> getSectionStringTable() const;
ErrorOr<StringRef> getSectionStringTable(Elf_Shdr_Range Sections) const;
uint32_t getExtendedSymbolTableIndex(const Elf_Sym *Sym,
const Elf_Shdr *SymTab,
Expand Down Expand Up @@ -284,14 +283,6 @@ ELFFile<ELFT>::getRelocationSymbol(const Elf_Rel *Rel,
return getEntry<Elf_Sym>(SymTab, Index);
}

template <class ELFT>
ErrorOr<StringRef> ELFFile<ELFT>::getSectionStringTable() const {
auto SectionsOrErr = sections();
if (std::error_code EC = SectionsOrErr.getError())
return EC;
return getSectionStringTable(*SectionsOrErr);
}

template <class ELFT>
ErrorOr<StringRef>
ELFFile<ELFT>::getSectionStringTable(Elf_Shdr_Range Sections) const {
Expand Down Expand Up @@ -453,7 +444,10 @@ ELFFile<ELFT>::getStringTableForSymtab(const Elf_Shdr &Sec) const {
template <class ELFT>
ErrorOr<StringRef>
ELFFile<ELFT>::getSectionName(const Elf_Shdr *Section) const {
ErrorOr<StringRef> Table = getSectionStringTable();
auto SectionsOrErr = sections();
if (std::error_code EC = SectionsOrErr.getError())
return EC;
ErrorOr<StringRef> Table = getSectionStringTable(*SectionsOrErr);
if (std::error_code EC = Table.getError())
return EC;
return getSectionName(Section, *Table);
Expand Down

0 comments on commit dbce068

Please sign in to comment.