diff options
author | Ben Gamari <ben@smart-cactus.org> | 2016-01-04 16:36:33 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-01-04 16:38:49 +0100 |
commit | 7e599f53e12e97a7e043919cd0d8b96f11bb18c0 (patch) | |
tree | 631f98d619aaa0d36bfa2a8015deefd3c848db92 /rts | |
parent | c7d84d2603c1988125feaab54e0d776974e46f75 (diff) | |
download | haskell-7e599f53e12e97a7e043919cd0d8b96f11bb18c0.tar.gz |
Linker: Move helpers to #ifdef
Otherwise Clang seems to complain about unused static definitions.
Diffstat (limited to 'rts')
-rw-r--r-- | rts/Linker.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/rts/Linker.c b/rts/Linker.c index 6561e05654..d298179596 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -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 |