Inline a version of getSectionStringTable into the only use.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 2 Nov 2016 15:23:32 +0000 (15:23 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 2 Nov 2016 15:23:32 +0000 (15:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285817 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Object/ELF.h

index 045e79198f782594a7db2de0bc8b187cb559a5f8..b36e1975ecf9d7a9b2503464a32bbcfb6922ce2f 100644 (file)
@@ -146,7 +146,6 @@ public:
     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,
@@ -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 {
@@ -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);