Commit 7e599f53 authored by Ben Gamari's avatar Ben Gamari 🐢

Linker: Move helpers to #ifdef

Otherwise Clang seems to complain about unused static definitions.
parent c7d84d26
......@@ -2750,17 +2750,6 @@ static int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first )
#endif
#endif // NEED_SYMBOL_EXTRAS
// Signed extend a number to a 32-bit int.
static inline StgInt32 sign_extend32(nat bits, StgWord32 x) {
return ((StgInt32) (x << (32 - bits))) >> (32 - bits);
}
// Does the given signed integer fit into the given bit width?
static inline StgBool is_int(nat bits, StgInt32 x) {
return bits > 32 || (-(1 << (bits-1)) <= x
&& x < (1 << (bits-1)));
}
#if defined(arm_HOST_ARCH)
static void
......@@ -4990,6 +4979,21 @@ end:
return result;
}
#ifdef arm_HOST_ARCH
// TODO: These likely belong in a library somewhere
// Signed extend a number to a 32-bit int.
static inline StgInt32 sign_extend32(nat bits, StgWord32 x) {
return ((StgInt32) (x << (32 - bits))) >> (32 - bits);
}
// Does the given signed integer fit into the given bit width?
static inline StgBool is_int(nat bits, StgInt32 x) {
return bits > 32 || (-(1 << (bits-1)) <= x
&& x < (1 << (bits-1)));
}
#endif
/* Do ELF relocations which lack an explicit addend. All x86-linux
and arm-linux relocations appear to be of this form. */
static int
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment