From 0de03cd78729dc58a846c64b645e71057ec5d24e Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Wed, 11 Mar 2020 19:14:11 +0100 Subject: 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 --- compiler/GHC/StgToCmm/Layout.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'compiler/GHC/StgToCmm/Layout.hs') 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 -- cgit v1.2.1