summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/Main.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-02-11 09:41:44 +0100
committerBen Gamari <ben@smart-cactus.org>2020-06-17 16:22:03 -0400
commit96aa57878fd6e6a7b92e841a0df8b5255a559c97 (patch)
treeda1dabadf29c6b681682a4577b4ca08e29bc44a5 /compiler/GHC/Driver/Main.hs
parent9f96bc127d6231b5e76bbab442244eb303b08867 (diff)
downloadhaskell-96aa57878fd6e6a7b92e841a0df8b5255a559c97.tar.gz
Update compiler
Thanks to ghc-bignum, the compiler can be simplified: * Types and constructors of Integer and Natural can be wired-in. It means that we don't have to query them from interfaces. It also means that numeric literals don't have to carry their type with them. * The same code is used whatever ghc-bignum backend is enabled. In particular, conversion of bignum literals into final Core expressions is now much more straightforward. Bignum closure inspection too. * GHC itself doesn't depend on any integer-* package anymore * The `integerLibrary` setting is gone.
Diffstat (limited to 'compiler/GHC/Driver/Main.hs')
-rw-r--r--compiler/GHC/Driver/Main.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs
index eff29cdcd7..85c68bb8e6 100644
--- a/compiler/GHC/Driver/Main.hs
+++ b/compiler/GHC/Driver/Main.hs
@@ -193,7 +193,7 @@ import GHC.Iface.Ext.Debug ( diffFile, validateScopes )
newHscEnv :: DynFlags -> IO HscEnv
newHscEnv dflags = do
- eps_var <- newIORef initExternalPackageState
+ eps_var <- newIORef (initExternalPackageState dflags)
us <- mkSplitUniqSupply 'r'
nc_var <- newIORef (initNameCache us knownKeyNames)
fc_var <- newIORef emptyInstalledModuleEnv
@@ -1888,16 +1888,14 @@ hscCompileCoreExpr hsc_env =
hscCompileCoreExpr' :: HscEnv -> SrcSpan -> CoreExpr -> IO ForeignHValue
hscCompileCoreExpr' hsc_env srcspan ds_expr
- = do { let dflags = hsc_dflags hsc_env
-
- {- Simplify it -}
- ; simpl_expr <- simplifyExpr hsc_env ds_expr
+ = do { {- Simplify it -}
+ simpl_expr <- simplifyExpr hsc_env ds_expr
{- Tidy it (temporary, until coreSat does cloning) -}
; let tidy_expr = tidyExpr emptyTidyEnv simpl_expr
{- Prepare for codegen -}
- ; prepd_expr <- corePrepExpr dflags hsc_env tidy_expr
+ ; prepd_expr <- corePrepExpr hsc_env tidy_expr
{- Lint if necessary -}
; lintInteractiveExpr "hscCompileExpr" hsc_env prepd_expr