Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 98bc676

Browse files
author
Asiri Rathnayake
committed
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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@270925 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d2d1ea9 commit 98bc676

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Registers.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class _LIBUNWIND_HIDDEN Registers_x86 {
8787
};
8888

8989
inline Registers_x86::Registers_x86(const void *registers) {
90-
static_assert(check_fit<Registers_x86, unw_context_t>::does_fit,
90+
static_assert((check_fit<Registers_x86, unw_context_t>::does_fit),
9191
"x86 registers do not fit into unw_context_t");
9292
memcpy(&_registers, registers, sizeof(_registers));
9393
}
@@ -281,7 +281,7 @@ class _LIBUNWIND_HIDDEN Registers_x86_64 {
281281
};
282282

283283
inline Registers_x86_64::Registers_x86_64(const void *registers) {
284-
static_assert(check_fit<Registers_x86_64, unw_context_t>::does_fit,
284+
static_assert((check_fit<Registers_x86_64, unw_context_t>::does_fit),
285285
"x86_64 registers do not fit into unw_context_t");
286286
memcpy(&_registers, registers, sizeof(_registers));
287287
}
@@ -548,7 +548,7 @@ class _LIBUNWIND_HIDDEN Registers_ppc {
548548
};
549549

550550
inline Registers_ppc::Registers_ppc(const void *registers) {
551-
static_assert(check_fit<Registers_ppc, unw_context_t>::does_fit,
551+
static_assert((check_fit<Registers_ppc, unw_context_t>::does_fit),
552552
"ppc registers do not fit into unw_context_t");
553553
memcpy(&_registers, static_cast<const uint8_t *>(registers),
554554
sizeof(_registers));
@@ -1078,7 +1078,7 @@ class _LIBUNWIND_HIDDEN Registers_arm64 {
10781078
};
10791079

10801080
inline Registers_arm64::Registers_arm64(const void *registers) {
1081-
static_assert(check_fit<Registers_arm64, unw_context_t>::does_fit,
1081+
static_assert((check_fit<Registers_arm64, unw_context_t>::does_fit),
10821082
"arm64 registers do not fit into unw_context_t");
10831083
memcpy(&_registers, registers, sizeof(_registers));
10841084
static_assert(sizeof(GPRs) == 0x110,
@@ -1404,7 +1404,7 @@ inline Registers_arm::Registers_arm(const void *registers)
14041404
_saved_vfp_d16_d31(false),
14051405
_saved_iwmmx(false),
14061406
_saved_iwmmx_control(false) {
1407-
static_assert(check_fit<Registers_arm, unw_context_t>::does_fit,
1407+
static_assert((check_fit<Registers_arm, unw_context_t>::does_fit),
14081408
"arm registers do not fit into unw_context_t");
14091409
// See unw_getcontext() note about data.
14101410
memcpy(&_registers, registers, sizeof(_registers));
@@ -1758,7 +1758,7 @@ class _LIBUNWIND_HIDDEN Registers_or1k {
17581758
};
17591759

17601760
inline Registers_or1k::Registers_or1k(const void *registers) {
1761-
static_assert(check_fit<Registers_or1k, unw_context_t>::does_fit,
1761+
static_assert((check_fit<Registers_or1k, unw_context_t>::does_fit),
17621762
"or1k registers do not fit into unw_context_t");
17631763
memcpy(&_registers, static_cast<const uint8_t *>(registers),
17641764
sizeof(_registers));

src/UnwindCursor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ template <typename A, typename R>
603603
UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)
604604
: _addressSpace(as), _registers(context), _unwindInfoMissing(false),
605605
_isSignalFrame(false) {
606-
static_assert(check_fit<UnwindCursor<A, R>, unw_cursor_t>::does_fit,
606+
static_assert((check_fit<UnwindCursor<A, R>, unw_cursor_t>::does_fit),
607607
"UnwindCursor<> does not fit in unw_cursor_t");
608608
memset(&_info, 0, sizeof(_info));
609609
}

src/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ template <typename _Type, typename _Mem>
131131
struct check_fit {
132132
template <typename T>
133133
struct blk_count {
134-
static const uint32_t count =
134+
static const uint64_t count =
135135
(sizeof(T) + sizeof(uint64_t) - 1) / sizeof(uint64_t);
136136
};
137137
static const bool does_fit =

0 commit comments

Comments
 (0)