summaryrefslogtreecommitdiff
path: root/compiler/main/StaticPtrTable.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/main/StaticPtrTable.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/main/StaticPtrTable.hs')
-rw-r--r--compiler/main/StaticPtrTable.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/main/StaticPtrTable.hs b/compiler/main/StaticPtrTable.hs
index ecc937665a..81a72230f3 100644
--- a/compiler/main/StaticPtrTable.hs
+++ b/compiler/main/StaticPtrTable.hs
@@ -178,6 +178,7 @@ sptCreateStaticBinds hsc_env this_mod binds
go (reverse fps' ++ fps) (bnd' : bs) xs'
dflags = hsc_dflags hsc_env
+ platform = targetPlatform dflags
-- Generates keys and replaces 'makeStatic' with 'StaticPtr'.
--
@@ -219,8 +220,8 @@ sptCreateStaticBinds hsc_env this_mod binds
staticPtrDataCon <- lift $ lookupDataConHscEnv staticPtrDataConName
return (fp, mkConApp staticPtrDataCon
[ Type t
- , mkWord64LitWordRep dflags w0
- , mkWord64LitWordRep dflags w1
+ , mkWord64LitWordRep platform w0
+ , mkWord64LitWordRep platform w1
, info
, e ])
@@ -233,10 +234,10 @@ sptCreateStaticBinds hsc_env this_mod binds
-- Choose either 'Word64#' or 'Word#' to represent the arguments of the
-- 'Fingerprint' data constructor.
- mkWord64LitWordRep dflags =
- case platformWordSize (targetPlatform dflags) of
+ mkWord64LitWordRep platform =
+ case platformWordSize platform of
PW4 -> mkWord64LitWord64
- PW8 -> mkWordLit dflags . toInteger
+ PW8 -> mkWordLit platform . toInteger
lookupIdHscEnv :: Name -> IO Id
lookupIdHscEnv n = lookupTypeHscEnv hsc_env n >>=