summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToCmm/Layout.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-11 19:14:11 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-25 22:42:02 -0400
commit0de03cd78729dc58a846c64b645e71057ec5d24e (patch)
tree4d893f44db3fa94094376cf4fcad9a1a832ee261 /compiler/GHC/StgToCmm/Layout.hs
parent262e42aa34c4d5705c8d011907c351497dd4e862 (diff)
downloadhaskell-0de03cd78729dc58a846c64b645e71057ec5d24e.tar.gz
DynFlags refactoring III
Use Platform instead of DynFlags when possible: * `tARGET_MIN_INT` et al. replaced with `platformMinInt` et al. * no more DynFlags in PreRules: added a new `RuleOpts` datatype * don't use `wORD_SIZE` in the compiler * make `wordAlignment` use `Platform` * make `dOUBLE_SIZE` a constant Metric Decrease: T13035 T1969
Diffstat (limited to 'compiler/GHC/StgToCmm/Layout.hs')
-rw-r--r--compiler/GHC/StgToCmm/Layout.hs18
1 files changed, 9 insertions, 9 deletions
diff --git a/compiler/GHC/StgToCmm/Layout.hs b/compiler/GHC/StgToCmm/Layout.hs
index 93aeabb8a9..08e83b84d3 100644
--- a/compiler/GHC/StgToCmm/Layout.hs
+++ b/compiler/GHC/StgToCmm/Layout.hs
@@ -463,7 +463,7 @@ mkVirtHeapOffsetsWithPadding dflags header things =
(rep, thing) = fromNonVoid nv_thing
-- Size of the field in bytes.
- !sizeB = primRepSizeB dflags rep
+ !sizeB = primRepSizeB platform rep
-- Align the start offset (eg, 2-byte value should be 2-byte aligned).
-- But not more than to a word.
@@ -532,20 +532,20 @@ mkVirtConstrSizes dflags field_reps
-- bring in ARG_P, ARG_N, etc.
#include "../includes/rts/storage/FunTypes.h"
-mkArgDescr :: DynFlags -> [Id] -> ArgDescr
-mkArgDescr dflags args
- = let arg_bits = argBits dflags arg_reps
+mkArgDescr :: Platform -> [Id] -> ArgDescr
+mkArgDescr platform args
+ = let arg_bits = argBits platform arg_reps
arg_reps = filter isNonV (map idArgRep args)
-- Getting rid of voids eases matching of standard patterns
in case stdPattern arg_reps of
Just spec_id -> ArgSpec spec_id
Nothing -> ArgGen arg_bits
-argBits :: DynFlags -> [ArgRep] -> [Bool] -- True for non-ptr, False for ptr
-argBits _ [] = []
-argBits dflags (P : args) = False : argBits dflags args
-argBits dflags (arg : args) = take (argRepSizeW dflags arg) (repeat True)
- ++ argBits dflags args
+argBits :: Platform -> [ArgRep] -> [Bool] -- True for non-ptr, False for ptr
+argBits _ [] = []
+argBits platform (P : args) = False : argBits platform args
+argBits platform (arg : args) = take (argRepSizeW platform arg) (repeat True)
+ ++ argBits platform args
----------------------
stdPattern :: [ArgRep] -> Maybe Int