summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Driver/Main.hs')
-rw-r--r--compiler/GHC/Driver/Main.hs34
1 files changed, 26 insertions, 8 deletions
diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs
index 7db9b62331..2936630db8 100644
--- a/compiler/GHC/Driver/Main.hs
+++ b/compiler/GHC/Driver/Main.hs
@@ -113,6 +113,7 @@ import GHC.Driver.Errors.Types
import GHC.Driver.CodeOutput
import GHC.Driver.Config.Cmm.Parser (initCmmParserConfig)
import GHC.Driver.Config.Core.Lint ( endPassHscEnvIO, lintInteractiveExpr )
+import GHC.Driver.Config.CoreToStg.Prep
import GHC.Driver.Config.Logger (initLogFlags)
import GHC.Driver.Config.Parser (initParserOpts)
import GHC.Driver.Config.Stg.Ppr (initStgPprOpts)
@@ -1689,9 +1690,13 @@ hscGenHardCode hsc_env cgguts location output_filename = do
-------------------
-- PREPARE FOR CODE GENERATION
-- Do saturation and convert to A-normal form
- (prepd_binds) <- {-# SCC "CorePrep" #-}
- corePrepPgm hsc_env this_mod location
- core_binds data_tycons
+ (prepd_binds) <- {-# SCC "CorePrep" #-} do
+ cp_cfg <- initCorePrepConfig hsc_env
+ corePrepPgm
+ (hsc_logger hsc_env)
+ cp_cfg
+ (initCorePrepPgmConfig (hsc_IC hsc_env) (hsc_dflags hsc_env))
+ this_mod location core_binds data_tycons
----------------- Convert to STG ------------------
(stg_binds, denv, (caf_ccs, caf_cc_stacks))
@@ -1768,8 +1773,13 @@ hscInteractive hsc_env cgguts location = do
-------------------
-- PREPARE FOR CODE GENERATION
-- Do saturation and convert to A-normal form
- prepd_binds <- {-# SCC "CorePrep" #-}
- corePrepPgm hsc_env this_mod location core_binds data_tycons
+ prepd_binds <- {-# SCC "CorePrep" #-} do
+ cp_cfg <- initCorePrepConfig hsc_env
+ corePrepPgm
+ (hsc_logger hsc_env)
+ cp_cfg
+ (initCorePrepPgmConfig (hsc_IC hsc_env) (hsc_dflags hsc_env))
+ this_mod location core_binds data_tycons
(stg_binds, _infotable_prov, _caf_ccs__caf_cc_stacks)
<- {-# SCC "CoreToStg" #-}
@@ -2110,8 +2120,13 @@ hscParsedDecls hsc_env decls = runInteractiveHsc hsc_env $ do
{- Prepare For Code Generation -}
-- Do saturation and convert to A-normal form
- prepd_binds <- {-# SCC "CorePrep" #-}
- liftIO $ corePrepPgm hsc_env this_mod iNTERACTIVELoc core_binds data_tycons
+ prepd_binds <- {-# SCC "CorePrep" #-} liftIO $ do
+ cp_cfg <- initCorePrepConfig hsc_env
+ corePrepPgm
+ (hsc_logger hsc_env)
+ cp_cfg
+ (initCorePrepPgmConfig (hsc_IC hsc_env) (hsc_dflags hsc_env))
+ this_mod iNTERACTIVELoc core_binds data_tycons
(stg_binds, _infotable_prov, _caf_ccs__caf_cc_stacks)
<- {-# SCC "CoreToStg" #-}
@@ -2327,7 +2342,10 @@ hscCompileCoreExpr' hsc_env srcspan ds_expr
; let tidy_expr = tidyExpr emptyTidyEnv simpl_expr
{- Prepare for codegen -}
- ; prepd_expr <- corePrepExpr hsc_env tidy_expr
+ ; cp_cfg <- initCorePrepConfig hsc_env
+ ; prepd_expr <- corePrepExpr
+ (hsc_logger hsc_env) cp_cfg
+ tidy_expr
{- Lint if necessary -}
; lintInteractiveExpr (text "hscCompileExpr") hsc_env prepd_expr