[commit: ghc] master: SymbolExtras: A bit of spring cleaning (55f6353)
git at git.haskell.org
git at git.haskell.org
Thu Mar 2 18:14:19 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/55f6353f7adc4d947aac8dfea227fdc4f54ac6d7/ghc
>---------------------------------------------------------------
commit 55f6353f7adc4d947aac8dfea227fdc4f54ac6d7
Author: Ben Gamari <ben at smart-cactus.org>
Date: Thu Mar 2 11:20:12 2017 -0500
SymbolExtras: A bit of spring cleaning
Const-hygiene and use bool when possible.
>---------------------------------------------------------------
55f6353f7adc4d947aac8dfea227fdc4f54ac6d7
rts/linker/SymbolExtras.c | 12 +++++-------
rts/linker/SymbolExtras.h | 8 ++++----
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/rts/linker/SymbolExtras.c b/rts/linker/SymbolExtras.c
index 468b3a9..73f219f 100644
--- a/rts/linker/SymbolExtras.c
+++ b/rts/linker/SymbolExtras.c
@@ -103,7 +103,7 @@ int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first )
#ifndef arm_HOST_ARCH
-SymbolExtra* makeSymbolExtra( ObjectCode* oc,
+SymbolExtra* makeSymbolExtra( ObjectCode const* oc,
unsigned long symbolNumber,
unsigned long target )
{
@@ -169,18 +169,16 @@ SymbolExtra* makeSymbolExtra( ObjectCode* oc,
*/
/* Produce a jump island for ARM/Thumb interworking */
-SymbolExtra* makeArmSymbolExtra( ObjectCode* oc,
+SymbolExtra* makeArmSymbolExtra( ObjectCode const* oc,
unsigned long symbolNumber,
unsigned long target,
- int fromThumb,
- int toThumb )
+ bool fromThumb,
+ bool toThumb )
{
- SymbolExtra *extra;
-
ASSERT( symbolNumber >= oc->first_symbol_extra
&& symbolNumber - oc->first_symbol_extra < oc->n_symbol_extras);
- extra = &oc->symbol_extras[symbolNumber - oc->first_symbol_extra];
+ SymbolExtra *extra = &oc->symbol_extras[symbolNumber - oc->first_symbol_extra];
// Make sure instruction mode bit is set properly
if (toThumb)
diff --git a/rts/linker/SymbolExtras.h b/rts/linker/SymbolExtras.h
index c897775..5e2a6d0 100644
--- a/rts/linker/SymbolExtras.h
+++ b/rts/linker/SymbolExtras.h
@@ -11,13 +11,13 @@
int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first );
#ifdef arm_HOST_ARCH
-SymbolExtra* makeArmSymbolExtra( ObjectCode* oc,
+SymbolExtra* makeArmSymbolExtra( ObjectCode const* oc,
unsigned long symbolNumber,
unsigned long target,
- int fromThumb,
- int toThumb );
+ bool fromThumb,
+ bool toThumb );
#else
-SymbolExtra* makeSymbolExtra( ObjectCode* oc,
+SymbolExtra* makeSymbolExtra( ObjectCode const* oc,
unsigned long symbolNumber,
unsigned long target );
More information about the ghc-commits
mailing list