[llvm] r322346 - Instead of ELFFile<ELFT>::Type, use ELFT::Type. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 11 18:28:31 PST 2018
Author: ruiu
Date: Thu Jan 11 18:28:31 2018
New Revision: 322346
URL: http://llvm.org/viewvc/llvm-project?rev=322346&view=rev
Log:
Instead of ELFFile<ELFT>::Type, use ELFT::Type. NFC.
Modified:
llvm/trunk/include/llvm/Object/ELFObjectFile.h
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
llvm/trunk/tools/llvm-readobj/ARMEHABIPrinter.h
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
llvm/trunk/tools/obj2yaml/elf2yaml.cpp
llvm/trunk/tools/yaml2obj/yaml2elf.cpp
Modified: llvm/trunk/include/llvm/Object/ELFObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFObjectFile.h?rev=322346&r1=322345&r2=322346&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELFObjectFile.h (original)
+++ llvm/trunk/include/llvm/Object/ELFObjectFile.h Thu Jan 11 18:28:31 2018
@@ -200,14 +200,14 @@ template <class ELFT> class ELFObjectFil
public:
LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
- using uintX_t = typename ELFFile<ELFT>::uintX_t;
+ using uintX_t = typename ELFT::uint;
- using Elf_Sym = typename ELFFile<ELFT>::Elf_Sym;
- using Elf_Shdr = typename ELFFile<ELFT>::Elf_Shdr;
- using Elf_Ehdr = typename ELFFile<ELFT>::Elf_Ehdr;
- using Elf_Rel = typename ELFFile<ELFT>::Elf_Rel;
- using Elf_Rela = typename ELFFile<ELFT>::Elf_Rela;
- using Elf_Dyn = typename ELFFile<ELFT>::Elf_Dyn;
+ using Elf_Sym = typename ELFT::Sym;
+ using Elf_Shdr = typename ELFT::Shdr;
+ using Elf_Ehdr = typename ELFT::Ehdr;
+ using Elf_Rel = typename ELFT::Rel;
+ using Elf_Rela = typename ELFT::Rela;
+ using Elf_Dyn = typename ELFT::Dyn;
private:
ELFObjectFile(MemoryBufferRef Object, ELFFile<ELFT> EF,
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp?rev=322346&r1=322345&r2=322346&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp Thu Jan 11 18:28:31 2018
@@ -148,7 +148,7 @@ template <typename ELFT>
static Expected<std::unique_ptr<DyldELFObject<ELFT>>>
createRTDyldELFObject(MemoryBufferRef Buffer, const ObjectFile &SourceObject,
const LoadedELFObjectInfo &L) {
- typedef typename ELFFile<ELFT>::Elf_Shdr Elf_Shdr;
+ typedef typename ELFT::Shdr Elf_Shdr;
typedef typename ELFDataTypeTypedefHelper<ELFT>::value_type addr_type;
Expected<std::unique_ptr<DyldELFObject<ELFT>>> ObjOrErr =
Modified: llvm/trunk/tools/llvm-readobj/ARMEHABIPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ARMEHABIPrinter.h?rev=322346&r1=322345&r2=322346&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ARMEHABIPrinter.h (original)
+++ llvm/trunk/tools/llvm-readobj/ARMEHABIPrinter.h Thu Jan 11 18:28:31 2018
@@ -323,10 +323,10 @@ inline void OpcodeDecoder::Decode(const
template <typename ET>
class PrinterContext {
- typedef typename object::ELFFile<ET>::Elf_Sym Elf_Sym;
- typedef typename object::ELFFile<ET>::Elf_Shdr Elf_Shdr;
- typedef typename object::ELFFile<ET>::Elf_Rel Elf_Rel;
- typedef typename object::ELFFile<ET>::Elf_Word Elf_Word;
+ typedef typename ET::Sym Elf_Sym;
+ typedef typename ET::Shdr Elf_Shdr;
+ typedef typename ET::Rel Elf_Rel;
+ typedef typename ET::Word Elf_Word;
ScopedPrinter &SW;
const object::ELFFile<ET> *ELF;
@@ -386,7 +386,7 @@ PrinterContext<ET>::FunctionAtAddress(un
}
template <typename ET>
-const typename object::ELFFile<ET>::Elf_Shdr *
+const typename ET::Shdr *
PrinterContext<ET>::FindExceptionTable(unsigned IndexSectionIndex,
off_t IndexTableOffset) const {
/// Iterate through the sections, searching for the relocation section
@@ -410,7 +410,7 @@ PrinterContext<ET>::FindExceptionTable(u
if (R.r_offset != static_cast<unsigned>(IndexTableOffset))
continue;
- typename object::ELFFile<ET>::Elf_Rela RelA;
+ typename ET::Rela RelA;
RelA.r_offset = R.r_offset;
RelA.r_info = R.r_info;
RelA.r_addend = 0;
@@ -586,4 +586,3 @@ void PrinterContext<ET>::PrintUnwindInfo
}
#endif
-
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=322346&r1=322345&r2=322346&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Thu Jan 11 18:28:31 2018
@@ -77,28 +77,28 @@ using namespace ELF;
#define TYPEDEF_ELF_TYPES(ELFT) \
using ELFO = ELFFile<ELFT>; \
- using Elf_Addr = typename ELFO::Elf_Addr; \
- using Elf_Shdr = typename ELFO::Elf_Shdr; \
- using Elf_Sym = typename ELFO::Elf_Sym; \
- using Elf_Dyn = typename ELFO::Elf_Dyn; \
- using Elf_Dyn_Range = typename ELFO::Elf_Dyn_Range; \
- using Elf_Rel = typename ELFO::Elf_Rel; \
- using Elf_Rela = typename ELFO::Elf_Rela; \
- using Elf_Rel_Range = typename ELFO::Elf_Rel_Range; \
- using Elf_Rela_Range = typename ELFO::Elf_Rela_Range; \
- using Elf_Phdr = typename ELFO::Elf_Phdr; \
- using Elf_Half = typename ELFO::Elf_Half; \
- using Elf_Ehdr = typename ELFO::Elf_Ehdr; \
- using Elf_Word = typename ELFO::Elf_Word; \
- using Elf_Hash = typename ELFO::Elf_Hash; \
- using Elf_GnuHash = typename ELFO::Elf_GnuHash; \
- using Elf_Sym_Range = typename ELFO::Elf_Sym_Range; \
- using Elf_Versym = typename ELFO::Elf_Versym; \
- using Elf_Verneed = typename ELFO::Elf_Verneed; \
- using Elf_Vernaux = typename ELFO::Elf_Vernaux; \
- using Elf_Verdef = typename ELFO::Elf_Verdef; \
- using Elf_Verdaux = typename ELFO::Elf_Verdaux; \
- using uintX_t = typename ELFO::uintX_t;
+ using Elf_Addr = typename ELFT::Addr; \
+ using Elf_Shdr = typename ELFT::Shdr; \
+ using Elf_Sym = typename ELFT::Sym; \
+ using Elf_Dyn = typename ELFT::Dyn; \
+ using Elf_Dyn_Range = typename ELFT::DynRange; \
+ using Elf_Rel = typename ELFT::Rel; \
+ using Elf_Rela = typename ELFT::Rela; \
+ using Elf_Rel_Range = typename ELFT::RelRange; \
+ using Elf_Rela_Range = typename ELFT::RelaRange; \
+ using Elf_Phdr = typename ELFT::Phdr; \
+ using Elf_Half = typename ELFT::Half; \
+ using Elf_Ehdr = typename ELFT::Ehdr; \
+ using Elf_Word = typename ELFT::Word; \
+ using Elf_Hash = typename ELFT::Hash; \
+ using Elf_GnuHash = typename ELFT::GnuHash; \
+ using Elf_Sym_Range = typename ELFT::SymRange; \
+ using Elf_Versym = typename ELFT::Versym; \
+ using Elf_Verneed = typename ELFT::Verneed; \
+ using Elf_Vernaux = typename ELFT::Vernaux; \
+ using Elf_Verdef = typename ELFT::Verdef; \
+ using Elf_Verdaux = typename ELFT::Verdaux; \
+ using uintX_t = typename ELFT::uint;
namespace {
@@ -295,8 +295,8 @@ template <class ELFT> class MipsGOTParse
template <typename ELFT> class DumpStyle {
public:
- using Elf_Shdr = typename ELFFile<ELFT>::Elf_Shdr;
- using Elf_Sym = typename ELFFile<ELFT>::Elf_Sym;
+ using Elf_Shdr = typename ELFT::Shdr;
+ using Elf_Sym = typename ELFT::Sym;
DumpStyle(ELFDumper<ELFT> *Dumper) : Dumper(Dumper) {}
virtual ~DumpStyle() = default;
@@ -2444,9 +2444,9 @@ struct GroupSection {
template <class ELFT>
std::vector<GroupSection> getGroups(const ELFFile<ELFT> *Obj) {
- using Elf_Shdr = typename ELFFile<ELFT>::Elf_Shdr;
- using Elf_Sym = typename ELFFile<ELFT>::Elf_Sym;
- using Elf_Word = typename ELFFile<ELFT>::Elf_Word;
+ using Elf_Shdr = typename ELFT::Shdr;
+ using Elf_Sym = typename ELFT::Sym;
+ using Elf_Word = typename ELFT::Word;
std::vector<GroupSection> Ret;
uint64_t I = 0;
@@ -3421,8 +3421,7 @@ static std::string getAMDGPUNoteTypeName
template <typename ELFT>
static void printGNUNote(raw_ostream &OS, uint32_t NoteType,
- ArrayRef<typename ELFFile<ELFT>::Elf_Word> Words,
- size_t Size) {
+ ArrayRef<typename ELFT::Word> Words, size_t Size) {
switch (NoteType) {
default:
return;
@@ -3461,8 +3460,7 @@ static void printGNUNote(raw_ostream &OS
template <typename ELFT>
static void printAMDGPUNote(raw_ostream &OS, uint32_t NoteType,
- ArrayRef<typename ELFFile<ELFT>::Elf_Word> Words,
- size_t Size) {
+ ArrayRef<typename ELFT::Word> Words, size_t Size) {
switch (NoteType) {
default:
return;
@@ -3497,8 +3495,8 @@ void GNUStyle<ELFT>::printNotes(const EL
const Elf_Ehdr *e = Obj->getHeader();
bool IsCore = e->e_type == ELF::ET_CORE;
- auto process = [&](const typename ELFFile<ELFT>::Elf_Off Offset,
- const typename ELFFile<ELFT>::Elf_Addr Size) {
+ auto process = [&](const typename ELFT::Off Offset,
+ const typename ELFT::Addr Size) {
if (Size <= 0)
return;
Modified: llvm/trunk/tools/obj2yaml/elf2yaml.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/obj2yaml/elf2yaml.cpp?rev=322346&r1=322345&r2=322346&view=diff
==============================================================================
--- llvm/trunk/tools/obj2yaml/elf2yaml.cpp (original)
+++ llvm/trunk/tools/obj2yaml/elf2yaml.cpp Thu Jan 11 18:28:31 2018
@@ -22,10 +22,10 @@ namespace {
template <class ELFT>
class ELFDumper {
typedef object::Elf_Sym_Impl<ELFT> Elf_Sym;
- typedef typename object::ELFFile<ELFT>::Elf_Shdr Elf_Shdr;
- typedef typename object::ELFFile<ELFT>::Elf_Word Elf_Word;
- typedef typename object::ELFFile<ELFT>::Elf_Rel Elf_Rel;
- typedef typename object::ELFFile<ELFT>::Elf_Rela Elf_Rela;
+ typedef typename ELFT::Shdr Elf_Shdr;
+ typedef typename ELFT::Word Elf_Word;
+ typedef typename ELFT::Rel Elf_Rel;
+ typedef typename ELFT::Rela Elf_Rela;
ArrayRef<Elf_Shdr> Sections;
Modified: llvm/trunk/tools/yaml2obj/yaml2elf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=322346&r1=322345&r2=322346&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2elf.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp Thu Jan 11 18:28:31 2018
@@ -107,12 +107,12 @@ namespace {
/// point of truth".
template <class ELFT>
class ELFState {
- typedef typename object::ELFFile<ELFT>::Elf_Ehdr Elf_Ehdr;
- typedef typename object::ELFFile<ELFT>::Elf_Phdr Elf_Phdr;
- typedef typename object::ELFFile<ELFT>::Elf_Shdr Elf_Shdr;
- typedef typename object::ELFFile<ELFT>::Elf_Sym Elf_Sym;
- typedef typename object::ELFFile<ELFT>::Elf_Rel Elf_Rel;
- typedef typename object::ELFFile<ELFT>::Elf_Rela Elf_Rela;
+ typedef typename ELFT::Ehdr Elf_Ehdr;
+ typedef typename ELFT::Phdr Elf_Phdr;
+ typedef typename ELFT::Shdr Elf_Shdr;
+ typedef typename ELFT::Sym Elf_Sym;
+ typedef typename ELFT::Rel Elf_Rel;
+ typedef typename ELFT::Rela Elf_Rela;
enum class SymtabType { Static, Dynamic };
@@ -513,7 +513,7 @@ template <class ELFT>
bool ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader,
const ELFYAML::Group &Section,
ContiguousBlobAccumulator &CBA) {
- typedef typename object::ELFFile<ELFT>::Elf_Word Elf_Word;
+ typedef typename ELFT::Word Elf_Word;
assert(Section.Type == llvm::ELF::SHT_GROUP &&
"Section type is not SHT_GROUP");
More information about the llvm-commits
mailing list