]> granicus.if.org Git - llvm/commitdiff
Inline getSectionStringTableIndex() into only caller. NFC.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 2 Nov 2016 14:52:50 +0000 (14:52 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 2 Nov 2016 14:52:50 +0000 (14:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285812 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Object/ELF.h

index 11239061bc65bb18c93c9c75c3b35339ac4e02f1..649cada7528db186c65303974a65a0c1fb71bcc3 100644 (file)
@@ -149,7 +149,6 @@ public:
 
   uintX_t getNumSections() const;
   ErrorOr<StringRef> getSectionStringTable() const;
-  uint32_t getSectionStringTableIndex() const;
   uint32_t getExtendedSymbolTableIndex(const Elf_Sym *Sym,
                                        const Elf_Shdr *SymTab,
                                        ArrayRef<Elf_Word> ShndxTable) const;
@@ -296,16 +295,11 @@ typename ELFT::uint ELFFile<ELFT>::getNumSections() const {
   return Header->e_shnum;
 }
 
-template <class ELFT>
-uint32_t ELFFile<ELFT>::getSectionStringTableIndex() const {
-  if (Header->e_shstrndx == ELF::SHN_XINDEX)
-    return SectionHeaderTable->sh_link;
-  return Header->e_shstrndx;
-}
-
 template <class ELFT>
 ErrorOr<StringRef> ELFFile<ELFT>::getSectionStringTable() const {
-  uint32_t Index = getSectionStringTableIndex();
+  uint32_t Index = Header->e_shstrndx;
+  if (Index == ELF::SHN_XINDEX)
+    Index = SectionHeaderTable->sh_link;
   if (!Index) // no section string table.
     return "";
   ErrorOr<const Elf_Shdr *> StrTabSecOrErr = getSection(Index);