summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-05-20 18:29:14 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-13 02:13:03 -0400
commitbfd0a78cdd0287c26998a4d9419174e4dc305c6f (patch)
tree7f864f90f4561782929acee2141385c328ab0aa9 /ghc
parentac964c8350ba41082e9dca9cf1b7ff02aea2a636 (diff)
downloadhaskell-bfd0a78cdd0287c26998a4d9419174e4dc305c6f.tar.gz
Don't return preload units when we set DyNFlags
Preload units can be retrieved in UnitState when needed (i.e. in GHCi)
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index dc02f68544..363d959598 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -58,7 +58,7 @@ import GHC.Driver.Types ( tyThingParent_maybe, handleFlagWarnings, getSafeMode,
import GHC.Unit.Module
import GHC.Types.Name
import GHC.Unit.State ( unitIsTrusted, unsafeLookupUnit, unsafeLookupUnitId,
- listVisibleModuleNames, pprFlag )
+ listVisibleModuleNames, pprFlag, preloadUnits )
import GHC.Iface.Syntax ( showToHeader )
import GHC.Core.Ppr.TyThing
import GHC.Builtin.Names
@@ -2934,7 +2934,7 @@ newDynFlags interactive_only minus_opts = do
when (not interactive_only) $ do
(dflags1, _, _) <- liftIO $ GHC.parseDynamicFlags dflags0 lopts
- new_pkgs <- GHC.setProgramDynFlags dflags1
+ must_reload <- GHC.setProgramDynFlags dflags1
-- if the package flags changed, reset the context and link
-- the new packages.
@@ -2946,7 +2946,9 @@ newDynFlags interactive_only minus_opts = do
"package flags have changed, resetting and loading new packages..."
-- delete targets and all eventually defined breakpoints. (#1620)
clearAllTargets
- liftIO $ linkPackages hsc_env new_pkgs
+ when must_reload $ do
+ let units = preloadUnits (unitState dflags2)
+ liftIO $ linkPackages hsc_env units
-- package flags changed, we can't re-use any of the old context
setContextAfterLoad False []
-- and copy the package state to the interactive DynFlags