diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-02-04 23:20:25 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-26 19:00:07 -0400 |
commit | 599efd90d54a01802b1285c0e357738e4d0bdb3a (patch) | |
tree | 2f6468fe8caabebd85d4a84d805bf04f7de1cd77 /ghc | |
parent | 872a9444df4d38cd5dc0fbb7a249d89596e73ea2 (diff) | |
download | haskell-599efd90d54a01802b1285c0e357738e4d0bdb3a.tar.gz |
Refactor FinderCache
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GHCi/UI.hs | 6 | ||||
-rw-r--r-- | ghc/Main.hs | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 494ab29021..f698b5abed 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -1998,8 +1998,12 @@ addModule files = do checkTargetModule :: GHC.GhcMonad m => ModuleName -> m Bool checkTargetModule m = do hsc_env <- GHC.getSession + let fc = hsc_FC hsc_env + let home_unit = hsc_home_unit hsc_env + let units = hsc_units hsc_env + let dflags = hsc_dflags hsc_env result <- liftIO $ - Finder.findImportedModule hsc_env m (Just (fsLit "this")) + Finder.findImportedModule fc units home_unit dflags m (Just (fsLit "this")) case result of Found _ _ -> return True _ -> (liftIO $ putStrLn $ diff --git a/ghc/Main.hs b/ghc/Main.hs index 1ea72d0b1c..00aeaf5028 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -244,7 +244,8 @@ main' postLoadMode dflags0 args flagWarnings = do GHC.printException e liftIO $ exitWith (ExitFailure 1)) $ do case postLoadMode of - ShowInterface f -> liftIO $ showIface (hsc_dflags hsc_env) + ShowInterface f -> liftIO $ showIface (hsc_logger hsc_env) + (hsc_dflags hsc_env) (hsc_units hsc_env) (hsc_NC hsc_env) f @@ -836,13 +837,16 @@ abiHash :: [String] -- ^ List of module names -> Ghc () abiHash strs = do hsc_env <- getSession - let dflags = hsc_dflags hsc_env + let fc = hsc_FC hsc_env + let home_unit = hsc_home_unit hsc_env + let units = hsc_units hsc_env + let dflags = hsc_dflags hsc_env liftIO $ do let find_it str = do let modname = mkModuleName str - r <- findImportedModule hsc_env modname Nothing + r <- findImportedModule fc units home_unit dflags modname Nothing case r of Found _ m -> return m _error -> throwGhcException $ CmdLineError $ showSDoc dflags $ |