@@ -52,6 +52,7 @@ template <endianness E, bool Is64> struct ELFType {
5252
5353public:
5454 static const endianness TargetEndianness = E;
55+ static const endianness Endianness = E;
5556 static const bool Is64Bits = Is64;
5657
5758 using uint = std::conditional_t <Is64, uint64_t , uint32_t >;
@@ -145,9 +146,9 @@ using ELF64BE = ELFType<llvm::endianness::big, true>;
145146// Section header.
146147template <class ELFT > struct Elf_Shdr_Base ;
147148
148- template <endianness TargetEndianness >
149- struct Elf_Shdr_Base <ELFType<TargetEndianness , false >> {
150- LLVM_ELF_IMPORT_TYPES (TargetEndianness , false )
149+ template <endianness Endianness >
150+ struct Elf_Shdr_Base <ELFType<Endianness , false >> {
151+ LLVM_ELF_IMPORT_TYPES (Endianness , false )
151152 Elf_Word sh_name; // Section name (index into string table)
152153 Elf_Word sh_type; // Section type (SHT_*)
153154 Elf_Word sh_flags; // Section flags (SHF_*)
@@ -160,9 +161,9 @@ struct Elf_Shdr_Base<ELFType<TargetEndianness, false>> {
160161 Elf_Word sh_entsize; // Size of records contained within the section
161162};
162163
163- template <endianness TargetEndianness >
164- struct Elf_Shdr_Base <ELFType<TargetEndianness , true >> {
165- LLVM_ELF_IMPORT_TYPES (TargetEndianness , true )
164+ template <endianness Endianness >
165+ struct Elf_Shdr_Base <ELFType<Endianness , true >> {
166+ LLVM_ELF_IMPORT_TYPES (Endianness , true )
166167 Elf_Word sh_name; // Section name (index into string table)
167168 Elf_Word sh_type; // Section type (SHT_*)
168169 Elf_Xword sh_flags; // Section flags (SHF_*)
@@ -190,9 +191,9 @@ struct Elf_Shdr_Impl : Elf_Shdr_Base<ELFT> {
190191
191192template <class ELFT > struct Elf_Sym_Base ;
192193
193- template <endianness TargetEndianness >
194- struct Elf_Sym_Base <ELFType<TargetEndianness , false >> {
195- LLVM_ELF_IMPORT_TYPES (TargetEndianness , false )
194+ template <endianness Endianness >
195+ struct Elf_Sym_Base <ELFType<Endianness , false >> {
196+ LLVM_ELF_IMPORT_TYPES (Endianness , false )
196197 Elf_Word st_name; // Symbol name (index into string table)
197198 Elf_Addr st_value; // Value or address associated with the symbol
198199 Elf_Word st_size; // Size of the symbol
@@ -201,9 +202,9 @@ struct Elf_Sym_Base<ELFType<TargetEndianness, false>> {
201202 Elf_Half st_shndx; // Which section (header table index) it's defined in
202203};
203204
204- template <endianness TargetEndianness >
205- struct Elf_Sym_Base <ELFType<TargetEndianness , true >> {
206- LLVM_ELF_IMPORT_TYPES (TargetEndianness , true )
205+ template <endianness Endianness >
206+ struct Elf_Sym_Base <ELFType<Endianness , true >> {
207+ LLVM_ELF_IMPORT_TYPES (Endianness , true )
207208 Elf_Word st_name; // Symbol name (index into string table)
208209 unsigned char st_info; // Symbol's type and binding attributes
209210 unsigned char st_other; // Must be zero; reserved
@@ -349,19 +350,19 @@ struct Elf_Vernaux_Impl {
349350// / table section (.dynamic) look like.
350351template <class ELFT > struct Elf_Dyn_Base ;
351352
352- template <endianness TargetEndianness >
353- struct Elf_Dyn_Base <ELFType<TargetEndianness , false >> {
354- LLVM_ELF_IMPORT_TYPES (TargetEndianness , false )
353+ template <endianness Endianness >
354+ struct Elf_Dyn_Base <ELFType<Endianness , false >> {
355+ LLVM_ELF_IMPORT_TYPES (Endianness , false )
355356 Elf_Sword d_tag;
356357 union {
357358 Elf_Word d_val;
358359 Elf_Addr d_ptr;
359360 } d_un;
360361};
361362
362- template <endianness TargetEndianness >
363- struct Elf_Dyn_Base <ELFType<TargetEndianness , true >> {
364- LLVM_ELF_IMPORT_TYPES (TargetEndianness , true )
363+ template <endianness Endianness >
364+ struct Elf_Dyn_Base <ELFType<Endianness , true >> {
365+ LLVM_ELF_IMPORT_TYPES (Endianness , true )
365366 Elf_Sxword d_tag;
366367 union {
367368 Elf_Xword d_val;
@@ -381,9 +382,9 @@ struct Elf_Dyn_Impl : Elf_Dyn_Base<ELFT> {
381382 uintX_t getPtr () const { return d_un.d_ptr ; }
382383};
383384
384- template <endianness TargetEndianness >
385- struct Elf_Rel_Impl <ELFType<TargetEndianness , false >, false > {
386- LLVM_ELF_IMPORT_TYPES (TargetEndianness , false )
385+ template <endianness Endianness >
386+ struct Elf_Rel_Impl <ELFType<Endianness , false >, false > {
387+ LLVM_ELF_IMPORT_TYPES (Endianness , false )
387388 static const bool IsRela = false ;
388389 Elf_Addr r_offset; // Location (file byte offset, or program virtual addr)
389390 Elf_Word r_info; // Symbol table index and type of relocation to apply
@@ -416,17 +417,17 @@ struct Elf_Rel_Impl<ELFType<TargetEndianness, false>, false> {
416417 }
417418};
418419
419- template <endianness TargetEndianness >
420- struct Elf_Rel_Impl <ELFType<TargetEndianness , false >, true >
421- : public Elf_Rel_Impl<ELFType<TargetEndianness , false >, false > {
422- LLVM_ELF_IMPORT_TYPES (TargetEndianness , false )
420+ template <endianness Endianness >
421+ struct Elf_Rel_Impl <ELFType<Endianness , false >, true >
422+ : public Elf_Rel_Impl<ELFType<Endianness , false >, false > {
423+ LLVM_ELF_IMPORT_TYPES (Endianness , false )
423424 static const bool IsRela = true ;
424425 Elf_Sword r_addend; // Compute value for relocatable field by adding this
425426};
426427
427- template <endianness TargetEndianness >
428- struct Elf_Rel_Impl <ELFType<TargetEndianness , true >, false > {
429- LLVM_ELF_IMPORT_TYPES (TargetEndianness , true )
428+ template <endianness Endianness >
429+ struct Elf_Rel_Impl <ELFType<Endianness , true >, false > {
430+ LLVM_ELF_IMPORT_TYPES (Endianness , true )
430431 static const bool IsRela = false ;
431432 Elf_Addr r_offset; // Location (file byte offset, or program virtual addr)
432433 Elf_Xword r_info; // Symbol table index and type of relocation to apply
@@ -469,10 +470,10 @@ struct Elf_Rel_Impl<ELFType<TargetEndianness, true>, false> {
469470 }
470471};
471472
472- template <endianness TargetEndianness >
473- struct Elf_Rel_Impl <ELFType<TargetEndianness , true >, true >
474- : public Elf_Rel_Impl<ELFType<TargetEndianness , true >, false > {
475- LLVM_ELF_IMPORT_TYPES (TargetEndianness , true )
473+ template <endianness Endianness >
474+ struct Elf_Rel_Impl <ELFType<Endianness , true >, true >
475+ : public Elf_Rel_Impl<ELFType<Endianness , true >, false > {
476+ LLVM_ELF_IMPORT_TYPES (Endianness , true )
476477 static const bool IsRela = true ;
477478 Elf_Sxword r_addend; // Compute value for relocatable field by adding this.
478479};
@@ -504,9 +505,9 @@ struct Elf_Ehdr_Impl {
504505 unsigned char getDataEncoding () const { return e_ident[ELF::EI_DATA]; }
505506};
506507
507- template <endianness TargetEndianness >
508- struct Elf_Phdr_Impl <ELFType<TargetEndianness , false >> {
509- LLVM_ELF_IMPORT_TYPES (TargetEndianness , false )
508+ template <endianness Endianness >
509+ struct Elf_Phdr_Impl <ELFType<Endianness , false >> {
510+ LLVM_ELF_IMPORT_TYPES (Endianness , false )
510511 Elf_Word p_type; // Type of segment
511512 Elf_Off p_offset; // FileOffset where segment is located, in bytes
512513 Elf_Addr p_vaddr; // Virtual Address of beginning of segment
@@ -517,9 +518,9 @@ struct Elf_Phdr_Impl<ELFType<TargetEndianness, false>> {
517518 Elf_Word p_align; // Segment alignment constraint
518519};
519520
520- template <endianness TargetEndianness >
521- struct Elf_Phdr_Impl <ELFType<TargetEndianness , true >> {
522- LLVM_ELF_IMPORT_TYPES (TargetEndianness , true )
521+ template <endianness Endianness >
522+ struct Elf_Phdr_Impl <ELFType<Endianness , true >> {
523+ LLVM_ELF_IMPORT_TYPES (Endianness , true )
523524 Elf_Word p_type; // Type of segment
524525 Elf_Word p_flags; // Segment flags
525526 Elf_Off p_offset; // FileOffset where segment is located, in bytes
@@ -574,17 +575,17 @@ struct Elf_GnuHash_Impl {
574575
575576// Compressed section headers.
576577// http://www.sco.com/developers/gabi/latest/ch4.sheader.html#compression_header
577- template <endianness TargetEndianness >
578- struct Elf_Chdr_Impl <ELFType<TargetEndianness , false >> {
579- LLVM_ELF_IMPORT_TYPES (TargetEndianness , false )
578+ template <endianness Endianness >
579+ struct Elf_Chdr_Impl <ELFType<Endianness , false >> {
580+ LLVM_ELF_IMPORT_TYPES (Endianness , false )
580581 Elf_Word ch_type;
581582 Elf_Word ch_size;
582583 Elf_Word ch_addralign;
583584};
584585
585- template <endianness TargetEndianness >
586- struct Elf_Chdr_Impl <ELFType<TargetEndianness , true >> {
587- LLVM_ELF_IMPORT_TYPES (TargetEndianness , true )
586+ template <endianness Endianness >
587+ struct Elf_Chdr_Impl <ELFType<Endianness , true >> {
588+ LLVM_ELF_IMPORT_TYPES (Endianness , true )
588589 Elf_Word ch_type;
589590 Elf_Word ch_reserved;
590591 Elf_Xword ch_size;
@@ -742,17 +743,17 @@ template <class ELFT> struct Elf_CGProfile_Impl {
742743template <class ELFT >
743744struct Elf_Mips_RegInfo ;
744745
745- template <llvm::endianness TargetEndianness >
746- struct Elf_Mips_RegInfo <ELFType<TargetEndianness , false >> {
747- LLVM_ELF_IMPORT_TYPES (TargetEndianness , false )
746+ template <llvm::endianness Endianness >
747+ struct Elf_Mips_RegInfo <ELFType<Endianness , false >> {
748+ LLVM_ELF_IMPORT_TYPES (Endianness , false )
748749 Elf_Word ri_gprmask; // bit-mask of used general registers
749750 Elf_Word ri_cprmask[4 ]; // bit-mask of used co-processor registers
750751 Elf_Addr ri_gp_value; // gp register value
751752};
752753
753- template <llvm::endianness TargetEndianness >
754- struct Elf_Mips_RegInfo <ELFType<TargetEndianness , true >> {
755- LLVM_ELF_IMPORT_TYPES (TargetEndianness , true )
754+ template <llvm::endianness Endianness >
755+ struct Elf_Mips_RegInfo <ELFType<Endianness , true >> {
756+ LLVM_ELF_IMPORT_TYPES (Endianness , true )
756757 Elf_Word ri_gprmask; // bit-mask of used general registers
757758 Elf_Word ri_pad; // unused padding field
758759 Elf_Word ri_cprmask[4 ]; // bit-mask of used co-processor registers
0 commit comments