diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-04-28 16:47:48 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-04-30 23:22:13 -0400 |
commit | c7ca3619e2544d7627c082b6e5bbe57a6b8abc05 (patch) | |
tree | 2e5cdf0b9a7f91123d9edff6c1c0749f69ae58d0 /compiler/GHC/Runtime/Eval.hs | |
parent | c0c0b4e0d3112a9ee294d1c3b7849b68b0bebfc8 (diff) | |
download | haskell-c7ca3619e2544d7627c082b6e5bbe57a6b8abc05.tar.gz |
Interpreter: replace DynFlags with EvalOpts/BCOOpts
Diffstat (limited to 'compiler/GHC/Runtime/Eval.hs')
-rw-r--r-- | compiler/GHC/Runtime/Eval.hs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/compiler/GHC/Runtime/Eval.hs b/compiler/GHC/Runtime/Eval.hs index 80868c1eea..6880c2fec7 100644 --- a/compiler/GHC/Runtime/Eval.hs +++ b/compiler/GHC/Runtime/Eval.hs @@ -54,6 +54,7 @@ import GHC.Driver.Errors.Types ( hoistTcRnMessage ) import GHC.Driver.Env import GHC.Driver.Session import GHC.Driver.Ppr +import GHC.Driver.Config import GHC.Runtime.Eval.Types import GHC.Runtime.Interpreter as GHCi @@ -228,8 +229,9 @@ execStmt' stmt stmt_text ExecOptions{..} = do status <- withVirtualCWD $ - liftIO $ - evalStmt interp idflags' (isStep execSingleStep) (execWrap hval) + liftIO $ do + let eval_opts = initEvalOpts idflags' (isStep execSingleStep) + evalStmt interp eval_opts (execWrap hval) let ic = hsc_IC hsc_env bindings = (ic_tythings ic, ic_rn_gbl_env ic) @@ -309,7 +311,7 @@ emptyHistory :: Int -> BoundedList History emptyHistory size = nilBL size handleRunStatus :: GhcMonad m - => SingleStep -> String-> ([TyThing],GlobalRdrEnv) -> [Id] + => SingleStep -> String -> ([TyThing],GlobalRdrEnv) -> [Id] -> EvalStatus_ [ForeignHValue] [HValueRef] -> BoundedList History -> m ExecResult @@ -343,7 +345,8 @@ handleRunStatus step expr bindings final_ids status history !history' = mkHistory hsc_env apStack_fhv bi `consBL` history -- history is strict, otherwise our BoundedList is pointless. fhv <- liftIO $ mkFinalizedHValue interp resume_ctxt - status <- liftIO $ GHCi.resumeStmt interp dflags True fhv + let eval_opts = initEvalOpts dflags True + status <- liftIO $ GHCi.resumeStmt interp eval_opts fhv handleRunStatus RunAndLogSteps expr bindings final_ids status history' | otherwise @@ -443,7 +446,8 @@ resumeExec canLogSpan step mbCnt setupBreakpoint hsc_env (fromJust mb_brkpt) (fromJust mbCnt) -- When the user specified a break ignore count, set it -- in the interpreter - status <- liftIO $ GHCi.resumeStmt interp dflags (isStep step) fhv + let eval_opts = initEvalOpts dflags (isStep step) + status <- liftIO $ GHCi.resumeStmt interp eval_opts fhv let prevHistoryLst = fromListBL 50 hist hist' = case mb_brkpt of Nothing -> prevHistoryLst @@ -1212,7 +1216,8 @@ compileParsedExprRemote expr@(L loc _) = withSession $ \hsc_env -> do _ -> panic "compileParsedExprRemote" updateFixityEnv fix_env - status <- liftIO $ evalStmt interp dflags False (EvalThis hvals_io) + let eval_opts = initEvalOpts dflags False + status <- liftIO $ evalStmt interp eval_opts (EvalThis hvals_io) case status of EvalComplete _ (EvalSuccess [hval]) -> return hval EvalComplete _ (EvalException e) -> |