summaryrefslogtreecommitdiff
path: root/ghc/Main.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-11-03 12:04:53 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-11-21 01:14:09 -0500
commitecfd0278cb811c93853c176fe5df60222d1a8fb5 (patch)
tree7fc212d973a0d9e5e67e13011bf30907b1458228 /ghc/Main.hs
parent53ad67eacacde8fde452f1a323d5886183375182 (diff)
downloadhaskell-ecfd0278cb811c93853c176fe5df60222d1a8fb5.tar.gz
Move Plugins into HscEnv (#17957)
Loaded plugins have nothing to do in DynFlags so this patch moves them into HscEnv (session state). "DynFlags plugins" become "Driver plugins" to still be able to register static plugins. Bump haddock submodule
Diffstat (limited to 'ghc/Main.hs')
-rw-r--r--ghc/Main.hs16
1 files changed, 5 insertions, 11 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs
index b7992b10b8..db926fb85f 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -36,7 +36,6 @@ import GHC.Platform.Host
#if defined(HAVE_INTERNAL_INTERPRETER)
import GHCi.UI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings )
-import GHC.Runtime.Loader ( initializePlugins )
#endif
import GHC.Runtime.Loader ( loadFrontendPlugin )
@@ -247,9 +246,8 @@ main' postLoadMode dflags0 args flagWarnings = do
DoMake -> doMake srcs
DoMkDependHS -> doMkDependHS (map fst srcs)
StopBefore p -> liftIO (oneShot hsc_env p srcs)
- DoInteractive -> ghciUI hsc_env dflags6 srcs Nothing
- DoEval exprs -> ghciUI hsc_env dflags6 srcs $ Just $
- reverse exprs
+ DoInteractive -> ghciUI srcs Nothing
+ DoEval exprs -> ghciUI srcs $ Just $ reverse exprs
DoAbiHash -> abiHash (map fst srcs)
ShowPackages -> liftIO $ showUnits dflags6
DoFrontend f -> doFrontend f srcs
@@ -257,16 +255,12 @@ main' postLoadMode dflags0 args flagWarnings = do
liftIO $ dumpFinalStats dflags6
-ghciUI :: HscEnv -> DynFlags -> [(FilePath, Maybe Phase)] -> Maybe [String]
- -> Ghc ()
+ghciUI :: [(FilePath, Maybe Phase)] -> Maybe [String] -> Ghc ()
#if !defined(HAVE_INTERNAL_INTERPRETER)
-ghciUI _ _ _ _ =
+ghciUI _ _ =
throwGhcException (CmdLineError "not built for interactive use")
#else
-ghciUI hsc_env dflags0 srcs maybe_expr = do
- dflags1 <- liftIO (initializePlugins hsc_env dflags0)
- _ <- GHC.setSessionDynFlags dflags1
- interactiveUI defaultGhciSettings srcs maybe_expr
+ghciUI srcs maybe_expr = interactiveUI defaultGhciSettings srcs maybe_expr
#endif