summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorFendor <power.walross@gmail.com>2021-07-20 15:00:49 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-23 21:08:42 -0400
commit6c79981e646a9983e959ccbf67f6c11b86bdbc6f (patch)
tree1cc2dea0845c20331a5cf68b03eb211c0319554b /ghc
parent509445b5947ce85499672399f5e88b6196af4c5a (diff)
downloadhaskell-6c79981e646a9983e959ccbf67f6c11b86bdbc6f.tar.gz
Introduce FinderLocations for decoupling Finder from DynFlags
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs4
-rw-r--r--ghc/Main.hs4
2 files changed, 6 insertions, 2 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index f861c9b82a..d1e49dadd3 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -51,6 +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.Config.Finder (initFinderOpts)
import GHC.Driver.Config.Parser (initParserOpts)
import GHC.Driver.Config.Diagnostic
import qualified GHC
@@ -2035,8 +2036,9 @@ addModule files = do
let home_unit = hsc_home_unit hsc_env
let units = hsc_units hsc_env
let dflags = hsc_dflags hsc_env
+ let fopts = initFinderOpts dflags
result <- liftIO $
- Finder.findImportedModule fc units home_unit dflags m (Just (fsLit "this"))
+ Finder.findImportedModule fc fopts units home_unit m (Just (fsLit "this"))
case result of
Found _ _ -> return True
_ -> (liftIO $ putStrLn $
diff --git a/ghc/Main.hs b/ghc/Main.hs
index ad975d1840..9c4c012247 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -29,6 +29,7 @@ import GHC.Driver.Pipeline ( oneShot, compileFile )
import GHC.Driver.MakeFile ( doMkDependHS )
import GHC.Driver.Backpack ( doBackpack )
import GHC.Driver.Plugins
+import GHC.Driver.Config.Finder (initFinderOpts)
import GHC.Driver.Config.Logger (initLogFlags)
import GHC.Driver.Config.Diagnostic
@@ -851,12 +852,13 @@ abiHash strs = do
let home_unit = hsc_home_unit hsc_env
let units = hsc_units hsc_env
let dflags = hsc_dflags hsc_env
+ let fopts = initFinderOpts dflags
liftIO $ do
let find_it str = do
let modname = mkModuleName str
- r <- findImportedModule fc units home_unit dflags modname Nothing
+ r <- findImportedModule fc fopts units home_unit modname Nothing
case r of
Found _ m -> return m
_error -> throwGhcException $ CmdLineError $ showSDoc dflags $