Skip to content

Commit

Permalink
Inline function into only use.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285928 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
espindola committed Nov 3, 2016
1 parent d59cd54 commit 93f2b8b
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions include/llvm/Object/ELF.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ class ELFFile {
}

ErrorOr<StringRef> getSectionStringTable(Elf_Shdr_Range Sections) const;
ErrorOr<uint32_t>
getExtendedSymbolTableIndex(const Elf_Sym *Sym, const Elf_Shdr *SymTab,
ArrayRef<Elf_Word> ShndxTable) const;
const Elf_Ehdr *getHeader() const { return Header; }
ErrorOr<uint32_t> getSectionIndex(const Elf_Sym *Sym, const Elf_Shdr *SymTab,
ArrayRef<Elf_Word> ShndxTable) const;
Expand Down Expand Up @@ -204,23 +201,17 @@ getExtendedSymbolTableIndex(const typename ELFT::Sym *Sym,
}

template <class ELFT>
ErrorOr<uint32_t> ELFFile<ELFT>::getExtendedSymbolTableIndex(
const Elf_Sym *Sym, const Elf_Shdr *SymTab,
ArrayRef<Elf_Word> ShndxTable) const {
ErrorOr<uint32_t>
ELFFile<ELFT>::getSectionIndex(const Elf_Sym *Sym, const Elf_Shdr *SymTab,
ArrayRef<Elf_Word> ShndxTable) const {
auto SymsOrErr = symbols(SymTab);
if (std::error_code EC = SymsOrErr.getError())
return EC;
return object::getExtendedSymbolTableIndex<ELFT>(Sym, SymsOrErr->begin(),
ShndxTable);
}

template <class ELFT>
ErrorOr<uint32_t>
ELFFile<ELFT>::getSectionIndex(const Elf_Sym *Sym, const Elf_Shdr *SymTab,
ArrayRef<Elf_Word> ShndxTable) const {
uint32_t Index = Sym->st_shndx;
if (Index == ELF::SHN_XINDEX) {
auto ErrorOrIndex = getExtendedSymbolTableIndex(Sym, SymTab, ShndxTable);
auto ErrorOrIndex = object::getExtendedSymbolTableIndex<ELFT>(
Sym, SymsOrErr->begin(), ShndxTable);
if (std::error_code EC = ErrorOrIndex.getError())
return EC;
return *ErrorOrIndex;
Expand Down

0 comments on commit 93f2b8b

Please sign in to comment.