From cb1d96138586a033238496e6ec1fb06140a57dd7 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Sun, 13 Mar 2016 04:55:44 +0000 Subject: [PATCH] Define IsRela static const member to Elf_Rel type. So that we can write RelTy::IsRela to query its type. llvm-svn: 263367 --- llvm/include/llvm/Object/ELFTypes.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/include/llvm/Object/ELFTypes.h b/llvm/include/llvm/Object/ELFTypes.h index 07b312a7..3d7f0c1 100644 --- a/llvm/include/llvm/Object/ELFTypes.h +++ b/llvm/include/llvm/Object/ELFTypes.h @@ -326,6 +326,7 @@ template struct Elf_Rel_Impl; template struct Elf_Rel_Impl, false> { LLVM_ELF_IMPORT_TYPES(TargetEndianness, false) + static const bool IsRela = false; Elf_Addr r_offset; // Location (file byte offset, or program virtual addr) Elf_Word r_info; // Symbol table index and type of relocation to apply @@ -361,12 +362,14 @@ template struct Elf_Rel_Impl, true> : public Elf_Rel_Impl, false> { LLVM_ELF_IMPORT_TYPES(TargetEndianness, false) + static const bool IsRela = true; Elf_Sword r_addend; // Compute value for relocatable field by adding this }; template struct Elf_Rel_Impl, false> { LLVM_ELF_IMPORT_TYPES(TargetEndianness, true) + static const bool IsRela = false; Elf_Addr r_offset; // Location (file byte offset, or program virtual addr) Elf_Xword r_info; // Symbol table index and type of relocation to apply @@ -411,6 +414,7 @@ template struct Elf_Rel_Impl, true> : public Elf_Rel_Impl, false> { LLVM_ELF_IMPORT_TYPES(TargetEndianness, true) + static const bool IsRela = true; Elf_Sxword r_addend; // Compute value for relocatable field by adding this. }; -- 2.7.4