Skip to content

Commit

Permalink
Unwind: avoid warning about unused typedef
Browse files Browse the repository at this point in the history
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
  • Loading branch information
compnerd committed Sep 20, 2019
1 parent 216be99 commit 0ae02fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libunwind/src/AddressSpace.hpp
Expand Up @@ -497,16 +497,16 @@ 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)
#error "_LIBUNWIND_SUPPORT_DWARF_UNWIND requires _LIBUNWIND_SUPPORT_DWARF_INDEX on this platform."
#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) -
Expand Down

0 comments on commit 0ae02fd

Please sign in to comment.