[llvm] r285928 - Inline function into only use.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 09:10:39 PDT 2016


Author: rafael
Date: Thu Nov  3 11:10:39 2016
New Revision: 285928

URL: http://llvm.org/viewvc/llvm-project?rev=285928&view=rev
Log:
Inline function into only use.

Modified:
    llvm/trunk/include/llvm/Object/ELF.h

Modified: llvm/trunk/include/llvm/Object/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELF.h?rev=285928&r1=285927&r2=285928&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Thu Nov  3 11:10:39 2016
@@ -147,9 +147,6 @@ public:
   }
 
   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;
@@ -204,23 +201,17 @@ getExtendedSymbolTableIndex(const typena
 }
 
 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;




More information about the llvm-commits mailing list