diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-07-26 11:20:39 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-08-04 13:58:01 -0400 |
commit | 1d94a59fbadd56efec78680c89946eb425eef418 (patch) | |
tree | 5d0642dd42e46950b15e50879ae1c2a0e99a0bf7 /ghc | |
parent | 0b1f5fd1ba67d04c534625740344a3c9ad525148 (diff) | |
download | haskell-1d94a59fbadd56efec78680c89946eb425eef418.tar.gz |
Store interfaces in ModIfaceCache more directly
I realised hydration was completely irrelavant for this cache because
the ModDetails are pruned from the result. So now it simplifies things a
lot to just store the ModIface and Linkable, which we can put into the
cache straight away rather than wait for the final version of a
HomeModInfo to appear.
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GHCi/UI.hs | 10 | ||||
-rw-r--r-- | ghc/GHCi/UI/Monad.hs | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 3de05f707d..b19939e9ac 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -51,7 +51,7 @@ import GHC.Driver.Session as DynFlags import GHC.Driver.Ppr hiding (printForUser) import GHC.Utils.Error hiding (traceCmd) import GHC.Driver.Monad ( modifySession ) -import GHC.Driver.Make ( newHomeModInfoCache, HomeModInfoCache(..) ) +import GHC.Driver.Make ( newIfaceCache, ModIfaceCache(..) ) import GHC.Driver.Config.Parser (initParserOpts) import GHC.Driver.Config.Diagnostic import qualified GHC @@ -542,7 +542,7 @@ interactiveUI config srcs maybe_exprs = do let prelude_import = simpleImportDecl preludeModuleName hsc_env <- GHC.getSession let in_multi = length (hsc_all_home_unit_ids hsc_env) > 1 - empty_cache <- liftIO newHomeModInfoCache + empty_cache <- liftIO newIfaceCache startGHCi (runGHCi srcs maybe_exprs) GHCiState{ progname = default_progname, args = default_args, @@ -577,7 +577,7 @@ interactiveUI config srcs maybe_exprs = do mod_infos = M.empty, flushStdHandles = flush, noBuffering = nobuffering, - hmiCache = empty_cache + ifaceCache = empty_cache } return () @@ -2150,7 +2150,7 @@ doLoad retain_context howmuch = do (\_ -> liftIO $ do hSetBuffering stdout NoBuffering hSetBuffering stderr NoBuffering) $ \_ -> do - hmis <- hmiCache <$> getGHCiState + hmis <- ifaceCache <$> getGHCiState ok <- trySuccess $ GHC.loadWithCache (Just hmis) howmuch afterLoad ok retain_context return ok @@ -4447,7 +4447,7 @@ discardActiveBreakPoints = do discardInterfaceCache :: GhciMonad m => m () discardInterfaceCache = - void (liftIO . hmi_clearCache . hmiCache =<< getGHCiState) + void (liftIO . iface_clearCache . ifaceCache =<< getGHCiState) clearHPTs :: GhciMonad m => m () clearHPTs = do diff --git a/ghc/GHCi/UI/Monad.hs b/ghc/GHCi/UI/Monad.hs index ee0edb1837..01f8f65831 100644 --- a/ghc/GHCi/UI/Monad.hs +++ b/ghc/GHCi/UI/Monad.hs @@ -47,7 +47,7 @@ import GHC.Data.FastString import GHC.Driver.Env import GHC.Types.SrcLoc import GHC.Types.SafeHaskell -import GHC.Driver.Make (HomeModInfoCache(..)) +import GHC.Driver.Make (ModIfaceCache(..)) import GHC.Unit import GHC.Types.Name.Reader as RdrName (mkOrig) import GHC.Builtin.Names (gHC_GHCI_HELPERS) @@ -164,7 +164,7 @@ data GHCiState = GHCiState -- ^ @hFlush stdout; hFlush stderr@ in the interpreter noBuffering :: ForeignHValue, -- ^ @hSetBuffering NoBuffering@ for stdin/stdout/stderr - hmiCache :: HomeModInfoCache + ifaceCache :: ModIfaceCache } type TickArray = Array Int [(GHC.BreakIndex,RealSrcSpan)] |