From 1b814753ec4e4ab479d260e57958fa5e9307b6b9 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 3 Nov 2016 16:10:39 +0000 Subject: [PATCH] Inline function into only use. llvm-svn: 285928 --- llvm/include/llvm/Object/ELF.h | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h index 855fe776c836..ef01735f13d2 100644 --- a/llvm/include/llvm/Object/ELF.h +++ b/llvm/include/llvm/Object/ELF.h @@ -147,9 +147,6 @@ public: } ErrorOr getSectionStringTable(Elf_Shdr_Range Sections) const; - ErrorOr - getExtendedSymbolTableIndex(const Elf_Sym *Sym, const Elf_Shdr *SymTab, - ArrayRef ShndxTable) const; const Elf_Ehdr *getHeader() const { return Header; } ErrorOr getSectionIndex(const Elf_Sym *Sym, const Elf_Shdr *SymTab, ArrayRef ShndxTable) const; @@ -203,24 +200,18 @@ getExtendedSymbolTableIndex(const typename ELFT::Sym *Sym, return ShndxTable[Index]; } -template -ErrorOr ELFFile::getExtendedSymbolTableIndex( - const Elf_Sym *Sym, const Elf_Shdr *SymTab, - ArrayRef ShndxTable) const { - auto SymsOrErr = symbols(SymTab); - if (std::error_code EC = SymsOrErr.getError()) - return EC; - return object::getExtendedSymbolTableIndex(Sym, SymsOrErr->begin(), - ShndxTable); -} - template ErrorOr ELFFile::getSectionIndex(const Elf_Sym *Sym, const Elf_Shdr *SymTab, ArrayRef ShndxTable) const { + auto SymsOrErr = symbols(SymTab); + if (std::error_code EC = SymsOrErr.getError()) + return EC; + uint32_t Index = Sym->st_shndx; if (Index == ELF::SHN_XINDEX) { - auto ErrorOrIndex = getExtendedSymbolTableIndex(Sym, SymTab, ShndxTable); + auto ErrorOrIndex = object::getExtendedSymbolTableIndex( + Sym, SymsOrErr->begin(), ShndxTable); if (std::error_code EC = ErrorOrIndex.getError()) return EC; return *ErrorOrIndex;