[llvm] r285812 - Inline getSectionStringTableIndex() into only caller. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 07:52:50 PDT 2016


Author: rafael
Date: Wed Nov  2 09:52:50 2016
New Revision: 285812

URL: http://llvm.org/viewvc/llvm-project?rev=285812&view=rev
Log:
Inline getSectionStringTableIndex() into only caller. NFC.

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=285812&r1=285811&r2=285812&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Wed Nov  2 09:52:50 2016
@@ -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;
@@ -297,15 +296,10 @@ typename ELFT::uint ELFFile<ELFT>::getNu
 }
 
 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);




More information about the llvm-commits mailing list