[llvm] r367833 - [llvm/Object] - Remove ELFFile<ELFT>::getSection(const StringRef SectionName). NFC.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 5 04:19:28 PDT 2019
Author: grimar
Date: Mon Aug 5 04:19:28 2019
New Revision: 367833
URL: http://llvm.org/viewvc/llvm-project?rev=367833&view=rev
Log:
[llvm/Object] - Remove ELFFile<ELFT>::getSection(const StringRef SectionName). NFC.
This method is dead. It was introduced in D47989,
but now the logic from D63475 is used in llvm-readobj instead.
Also it has a problem: it returns the first matching section,
even if there are multiple sections with the same name.
Differential revision: https://reviews.llvm.org/D65393
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=367833&r1=367832&r2=367833&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Mon Aug 5 04:19:28 2019
@@ -271,7 +271,6 @@ public:
Elf_Sym_Range Symtab,
ArrayRef<Elf_Word> ShndxTable) const;
Expected<const Elf_Shdr *> getSection(uint32_t Index) const;
- Expected<const Elf_Shdr *> getSection(const StringRef SectionName) const;
Expected<const Elf_Sym *> getSymbol(const Elf_Shdr *Sec,
uint32_t Index) const;
@@ -569,23 +568,6 @@ ELFFile<ELFT>::getSection(uint32_t Index
}
template <class ELFT>
-Expected<const typename ELFT::Shdr *>
-ELFFile<ELFT>::getSection(const StringRef SectionName) const {
- auto TableOrErr = sections();
- if (!TableOrErr)
- return TableOrErr.takeError();
- for (auto &Sec : *TableOrErr) {
- auto SecNameOrErr = getSectionName(&Sec);
- if (!SecNameOrErr)
- return SecNameOrErr.takeError();
- if (*SecNameOrErr == SectionName)
- return &Sec;
- }
- // TODO: this error is untested.
- return createError("invalid section name");
-}
-
-template <class ELFT>
Expected<StringRef>
ELFFile<ELFT>::getStringTable(const Elf_Shdr *Section) const {
if (Section->sh_type != ELF::SHT_STRTAB)
More information about the llvm-commits
mailing list