[llvm] r285817 - Inline a version of getSectionStringTable into the only use.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 08:23:32 PDT 2016


Author: rafael
Date: Wed Nov  2 10:23:32 2016
New Revision: 285817

URL: http://llvm.org/viewvc/llvm-project?rev=285817&view=rev
Log:
Inline a version of getSectionStringTable into the 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=285817&r1=285816&r2=285817&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Wed Nov  2 10:23:32 2016
@@ -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,
@@ -285,14 +284,6 @@ ELFFile<ELFT>::getRelocationSymbol(const
 }
 
 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 {
   uint32_t Index = Header->e_shstrndx;
@@ -453,7 +444,10 @@ ELFFile<ELFT>::getStringTableForSymtab(c
 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);




More information about the llvm-commits mailing list