[llvm] r265399 - Centralize the definition of a few types. NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 5 07:10:18 PDT 2016
Author: rafael
Date: Tue Apr 5 09:10:18 2016
New Revision: 265399
URL: http://llvm.org/viewvc/llvm-project?rev=265399&view=rev
Log:
Centralize the definition of a few types. NFC.
Modified:
llvm/trunk/include/llvm/Object/ELF.h
llvm/trunk/include/llvm/Object/ELFTypes.h
Modified: llvm/trunk/include/llvm/Object/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELF.h?rev=265399&r1=265398&r2=265399&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Tue Apr 5 09:10:18 2016
@@ -54,9 +54,12 @@ public:
typedef Elf_Versym_Impl<ELFT> Elf_Versym;
typedef Elf_Hash_Impl<ELFT> Elf_Hash;
typedef Elf_GnuHash_Impl<ELFT> Elf_GnuHash;
- typedef iterator_range<const Elf_Dyn *> Elf_Dyn_Range;
- typedef iterator_range<const Elf_Shdr *> Elf_Shdr_Range;
- typedef iterator_range<const Elf_Sym *> Elf_Sym_Range;
+ typedef typename ELFT::DynRange Elf_Dyn_Range;
+ typedef typename ELFT::ShdrRange Elf_Shdr_Range;
+ typedef typename ELFT::SymRange Elf_Sym_Range;
+ typedef typename ELFT::RelRange Elf_Rel_Range;
+ typedef typename ELFT::RelaRange Elf_Rela_Range;
+ typedef typename ELFT::PhdrRange Elf_Phdr_Range;
const uint8_t *base() const {
return reinterpret_cast<const uint8_t *>(Buf.data());
@@ -131,8 +134,6 @@ public:
return make_range(symbol_begin(Sec), symbol_end(Sec));
}
- typedef iterator_range<const Elf_Rela *> Elf_Rela_Range;
-
const Elf_Rela *rela_begin(const Elf_Shdr *sec) const {
if (sec->sh_entsize != sizeof(Elf_Rela))
report_fatal_error("Invalid relocation entry size");
@@ -163,7 +164,6 @@ public:
return rel_begin(sec) + Size / sizeof(Elf_Rel);
}
- typedef iterator_range<const Elf_Rel *> Elf_Rel_Range;
Elf_Rel_Range rels(const Elf_Shdr *Sec) const {
return make_range(rel_begin(Sec), rel_end(Sec));
}
@@ -179,8 +179,6 @@ public:
return program_header_begin() + Header->e_phnum;
}
- typedef iterator_range<const Elf_Phdr *> Elf_Phdr_Range;
-
const Elf_Phdr_Range program_headers() const {
return make_range(program_header_begin(), program_header_end());
}
Modified: llvm/trunk/include/llvm/Object/ELFTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFTypes.h?rev=265399&r1=265398&r2=265399&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELFTypes.h (original)
+++ llvm/trunk/include/llvm/Object/ELFTypes.h Tue Apr 5 09:10:18 2016
@@ -62,6 +62,9 @@ public:
typedef iterator_range<const Dyn *> DynRange;
typedef iterator_range<const Shdr *> ShdrRange;
typedef iterator_range<const Sym *> SymRange;
+ typedef iterator_range<const Rel *> RelRange;
+ typedef iterator_range<const Rela *> RelaRange;
+ typedef iterator_range<const Phdr *> PhdrRange;
typedef packed<uint16_t> Half;
typedef packed<uint32_t> Word;
More information about the llvm-commits
mailing list