diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-11 19:14:11 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-03-25 22:42:02 -0400 |
commit | 0de03cd78729dc58a846c64b645e71057ec5d24e (patch) | |
tree | 4d893f44db3fa94094376cf4fcad9a1a832ee261 /compiler/GHC/HsToCore/Expr.hs | |
parent | 262e42aa34c4d5705c8d011907c351497dd4e862 (diff) | |
download | haskell-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/HsToCore/Expr.hs')
-rw-r--r-- | compiler/GHC/HsToCore/Expr.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/GHC/HsToCore/Expr.hs b/compiler/GHC/HsToCore/Expr.hs index 1a52bcc966..147da687d0 100644 --- a/compiler/GHC/HsToCore/Expr.hs +++ b/compiler/GHC/HsToCore/Expr.hs @@ -488,6 +488,7 @@ dsExpr (HsStatic _ expr@(L loc _)) = do makeStaticId <- dsLookupGlobalId makeStaticName dflags <- getDynFlags + let platform = targetPlatform dflags let (line, col) = case loc of RealSrcSpan r _ -> ( srcLocLine $ realSrcSpanStart r @@ -496,7 +497,7 @@ dsExpr (HsStatic _ expr@(L loc _)) = do _ -> (0, 0) srcLoc = mkCoreConApps (tupleDataCon Boxed 2) [ Type intTy , Type intTy - , mkIntExprInt dflags line, mkIntExprInt dflags col + , mkIntExprInt platform line, mkIntExprInt platform col ] putSrcSpanDs loc $ return $ @@ -890,7 +891,8 @@ dsExplicitList elt_ty Nothing xs dsExplicitList elt_ty (Just fln) xs = do { list <- dsExplicitList elt_ty Nothing xs ; dflags <- getDynFlags - ; dsSyntaxExpr fln [mkIntExprInt dflags (length xs), list] } + ; let platform = targetPlatform dflags + ; dsSyntaxExpr fln [mkIntExprInt platform (length xs), list] } dsArithSeq :: PostTcExpr -> (ArithSeqInfo GhcTc) -> DsM CoreExpr dsArithSeq expr (From from) |