From b39cacf2a9d46299f77040937a0d62def0b8c537 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 2 Nov 2016 14:52:50 +0000 Subject: [PATCH] Inline getSectionStringTableIndex() into only caller. NFC. llvm-svn: 285812 --- llvm/include/llvm/Object/ELF.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h index 11239061bc65..649cada7528d 100644 --- a/llvm/include/llvm/Object/ELF.h +++ b/llvm/include/llvm/Object/ELF.h @@ -149,7 +149,6 @@ public: uintX_t getNumSections() const; ErrorOr getSectionStringTable() const; - uint32_t getSectionStringTableIndex() const; uint32_t getExtendedSymbolTableIndex(const Elf_Sym *Sym, const Elf_Shdr *SymTab, ArrayRef ShndxTable) const; @@ -296,16 +295,11 @@ typename ELFT::uint ELFFile::getNumSections() const { return Header->e_shnum; } -template -uint32_t ELFFile::getSectionStringTableIndex() const { - if (Header->e_shstrndx == ELF::SHN_XINDEX) - return SectionHeaderTable->sh_link; - return Header->e_shstrndx; -} - template ErrorOr ELFFile::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 StrTabSecOrErr = getSection(Index);