summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToCmm/Utils.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/Utils.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/Utils.hs')
-rw-r--r--compiler/GHC/StgToCmm/Utils.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/GHC/StgToCmm/Utils.hs b/compiler/GHC/StgToCmm/Utils.hs
index f212022822..178572eb64 100644
--- a/compiler/GHC/StgToCmm/Utils.hs
+++ b/compiler/GHC/StgToCmm/Utils.hs
@@ -520,7 +520,6 @@ emitCmmLitSwitch scrut branches deflt = do
deflt_lbl <- label_code join_lbl deflt
branches_lbls <- label_branches join_lbl branches
- dflags <- getDynFlags
platform <- getPlatform
let cmm_ty = cmmExprType platform scrut
rep = typeWidth cmm_ty
@@ -530,8 +529,8 @@ emitCmmLitSwitch scrut branches deflt = do
(LitNumber nt _ _, _) -> litNumIsSigned nt
_ -> False
- let range | signed = (tARGET_MIN_INT dflags, tARGET_MAX_INT dflags)
- | otherwise = (0, tARGET_MAX_WORD dflags)
+ let range | signed = (platformMinInt platform, platformMaxInt platform)
+ | otherwise = (0, platformMaxWord platform)
if isFloatType cmm_ty
then emit =<< mk_float_switch rep scrut' deflt_lbl noBound branches_lbls