summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2019-09-20 20:46:33 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2019-09-20 20:46:33 +0000
commit6a94361a8e8cb40c5ad5b17a7d6dcaf5cc862b60 (patch)
tree4e3ecb5a6cbbdf95882157a2a8d15d10b7b56f13
parentd715ca33528f88741f88bbf1994cff52d645562d (diff)
Unwind: avoid warning about unused typedef
Move the definition of Elf_Addr typedef to the only place it is used, to avoid: ``` llvm-project/libunwind/src/AddressSpace.hpp:501:28: warning: unused typedef 'Elf_Addr' [-Wunused-local-typedef] ``` when compiling for Android with _LIBUNWIND_ARM_EHABI defined and _LIBUNWIND_SUPPORT_DWARF_UNWIND not defined. Patch by Joel Klinghed! git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@372427 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--src/AddressSpace.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/AddressSpace.hpp b/src/AddressSpace.hpp
index 2c9a083..bf57fda 100644
--- a/src/AddressSpace.hpp
+++ b/src/AddressSpace.hpp
@@ -497,9 +497,6 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
#if !defined(Elf_Phdr)
typedef ElfW(Phdr) Elf_Phdr;
#endif
-#if !defined(Elf_Addr) && defined(__ANDROID__)
- typedef ElfW(Addr) Elf_Addr;
-#endif
#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
#if !defined(_LIBUNWIND_SUPPORT_DWARF_INDEX)
@@ -507,6 +504,9 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
#endif
size_t object_length;
#if defined(__ANDROID__)
+#if !defined(Elf_Addr)
+ typedef ElfW(Addr) Elf_Addr;
+#endif
Elf_Addr image_base =
pinfo->dlpi_phnum
? reinterpret_cast<Elf_Addr>(pinfo->dlpi_phdr) -