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!
llvm-svn: 372427
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 0ae02fd71a3828209df37239910568ecde68912a
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 @@
#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 @@
#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) -