Use more strict types. NFC.

On 32 bit ELF these are 32 bit values.

llvm-svn: 249022
This commit is contained in:
Rafael Espindola 2015-10-01 15:22:42 +00:00
parent 2ee26ee37b
commit 812f57e6dc
1 changed files with 8 additions and 4 deletions

View File

@ -306,14 +306,18 @@ struct Elf_Dyn_Base<ELFType<TargetEndianness, true>> {
} d_un; } d_un;
}; };
/// Elf_Dyn_Impl: This inherits from Elf_Dyn_Base, adding getters and setters. /// Elf_Dyn_Impl: This inherits from Elf_Dyn_Base, adding getters.
template <class ELFT> template <class ELFT>
struct Elf_Dyn_Impl : Elf_Dyn_Base<ELFT> { struct Elf_Dyn_Impl : Elf_Dyn_Base<ELFT> {
using Elf_Dyn_Base<ELFT>::d_tag; using Elf_Dyn_Base<ELFT>::d_tag;
using Elf_Dyn_Base<ELFT>::d_un; using Elf_Dyn_Base<ELFT>::d_un;
int64_t getTag() const { return d_tag; } typedef typename std::conditional<ELFT::Is64Bits,
uint64_t getVal() const { return d_un.d_val; } int64_t, int32_t>::type intX_t;
uint64_t getPtr() const { return d_un.d_ptr; } typedef typename std::conditional<ELFT::Is64Bits,
uint64_t, uint32_t>::type uintX_t;
intX_t getTag() const { return d_tag; }
uintX_t getVal() const { return d_un.d_val; }
uintX_t getPtr() const { return d_un.d_ptr; }
}; };
// Elf_Rel: Elf Relocation // Elf_Rel: Elf Relocation