diff options
author | Asiri Rathnayake <asiri.rathnayake@arm.com> | 2016-05-26 21:45:54 +0000 |
---|---|---|
committer | Asiri Rathnayake <asiri.rathnayake@arm.com> | 2016-05-26 21:45:54 +0000 |
commit | c6a4ab0ce3bb3d4cb3533d3581d8ae6abb230494 (patch) | |
tree | 045622ae06e816a5241200e4d618cee03a9291e2 /libunwind | |
parent | 1ecdedad8d839f5522aabbbdf6dd17541f9cf501 (diff) | |
download | bcm5719-llvm-c6a4ab0ce3bb3d4cb3533d3581d8ae6abb230494.tar.gz bcm5719-llvm-c6a4ab0ce3bb3d4cb3533d3581d8ae6abb230494.zip |
Fix gcc libunwind build.
r270692 seems to have broken gcc builds of libunwind. This is because
statements like:
static_assert(check_fit<Registers_or1k, unw_context_t>::does_fit,
"or1k registers do not fit into unw_context_t");
Do not work when static_assert is a macro taking two parameters, the
extra comma separating the template parameters confuses the pre-processor.
The fix is to change those statements to:
static_assert((check_fit<Registers_or1k, unw_context_t>::does_fit),
"or1k registers do not fit into unw_context_t");
Also fixed a gcc warning about a trivial un-intended narrowing.
Differential revision: http://reviews.llvm.org/D20119
llvm-svn: 270925
Diffstat (limited to 'libunwind')
-rw-r--r-- | libunwind/src/Registers.hpp | 12 | ||||
-rw-r--r-- | libunwind/src/UnwindCursor.hpp | 2 | ||||
-rw-r--r-- | libunwind/src/config.h | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/libunwind/src/Registers.hpp b/libunwind/src/Registers.hpp index 51759bdd318..ab874284000 100644 --- a/libunwind/src/Registers.hpp +++ b/libunwind/src/Registers.hpp @@ -87,7 +87,7 @@ private: }; inline Registers_x86::Registers_x86(const void *registers) { - static_assert(check_fit<Registers_x86, unw_context_t>::does_fit, + static_assert((check_fit<Registers_x86, unw_context_t>::does_fit), "x86 registers do not fit into unw_context_t"); memcpy(&_registers, registers, sizeof(_registers)); } @@ -281,7 +281,7 @@ private: }; inline Registers_x86_64::Registers_x86_64(const void *registers) { - static_assert(check_fit<Registers_x86_64, unw_context_t>::does_fit, + static_assert((check_fit<Registers_x86_64, unw_context_t>::does_fit), "x86_64 registers do not fit into unw_context_t"); memcpy(&_registers, registers, sizeof(_registers)); } @@ -548,7 +548,7 @@ private: }; inline Registers_ppc::Registers_ppc(const void *registers) { - static_assert(check_fit<Registers_ppc, unw_context_t>::does_fit, + static_assert((check_fit<Registers_ppc, unw_context_t>::does_fit), "ppc registers do not fit into unw_context_t"); memcpy(&_registers, static_cast<const uint8_t *>(registers), sizeof(_registers)); @@ -1078,7 +1078,7 @@ private: }; inline Registers_arm64::Registers_arm64(const void *registers) { - static_assert(check_fit<Registers_arm64, unw_context_t>::does_fit, + static_assert((check_fit<Registers_arm64, unw_context_t>::does_fit), "arm64 registers do not fit into unw_context_t"); memcpy(&_registers, registers, sizeof(_registers)); static_assert(sizeof(GPRs) == 0x110, @@ -1404,7 +1404,7 @@ inline Registers_arm::Registers_arm(const void *registers) _saved_vfp_d16_d31(false), _saved_iwmmx(false), _saved_iwmmx_control(false) { - static_assert(check_fit<Registers_arm, unw_context_t>::does_fit, + static_assert((check_fit<Registers_arm, unw_context_t>::does_fit), "arm registers do not fit into unw_context_t"); // See unw_getcontext() note about data. memcpy(&_registers, registers, sizeof(_registers)); @@ -1758,7 +1758,7 @@ private: }; inline Registers_or1k::Registers_or1k(const void *registers) { - static_assert(check_fit<Registers_or1k, unw_context_t>::does_fit, + static_assert((check_fit<Registers_or1k, unw_context_t>::does_fit), "or1k registers do not fit into unw_context_t"); memcpy(&_registers, static_cast<const uint8_t *>(registers), sizeof(_registers)); diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp index 661ef4a264c..18a780919b1 100644 --- a/libunwind/src/UnwindCursor.hpp +++ b/libunwind/src/UnwindCursor.hpp @@ -603,7 +603,7 @@ template <typename A, typename R> UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as) : _addressSpace(as), _registers(context), _unwindInfoMissing(false), _isSignalFrame(false) { - static_assert(check_fit<UnwindCursor<A, R>, unw_cursor_t>::does_fit, + static_assert((check_fit<UnwindCursor<A, R>, unw_cursor_t>::does_fit), "UnwindCursor<> does not fit in unw_cursor_t"); memset(&_info, 0, sizeof(_info)); } diff --git a/libunwind/src/config.h b/libunwind/src/config.h index 151030cad13..7aedb347a2b 100644 --- a/libunwind/src/config.h +++ b/libunwind/src/config.h @@ -131,7 +131,7 @@ template <typename _Type, typename _Mem> struct check_fit { template <typename T> struct blk_count { - static const uint32_t count = + static const uint64_t count = (sizeof(T) + sizeof(uint64_t) - 1) / sizeof(uint64_t); }; static const bool does_fit = |