summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2019-10-21 09:15:41 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-29 03:47:44 -0400
commita56433a912c8d666a113ca56aa5f19dec202cdb6 (patch)
tree375016af741c78e31acdf18f5043815a0ba85b52
parentbbdd54aab2f727bd90efe237eeb72e5e014b0cb2 (diff)
downloadhaskell-a56433a912c8d666a113ca56aa5f19dec202cdb6.tar.gz
Remove unused DynFlags arg of lookupIfaceByModule
-rw-r--r--compiler/deSugar/DsUsage.hs2
-rw-r--r--compiler/iface/LoadIface.hs9
-rw-r--r--compiler/iface/MkIface.hs5
-rw-r--r--compiler/main/HscMain.hs3
-rw-r--r--compiler/main/HscTypes.hs5
-rw-r--r--compiler/typecheck/FamInst.hs5
6 files changed, 12 insertions, 17 deletions
diff --git a/compiler/deSugar/DsUsage.hs b/compiler/deSugar/DsUsage.hs
index f5f63934a3..ed9f4cd371 100644
--- a/compiler/deSugar/DsUsage.hs
+++ b/compiler/deSugar/DsUsage.hs
@@ -314,7 +314,7 @@ mk_mod_usage_info pit hsc_env this_mod direct_imports used_names
usg_entities = Map.toList ent_hashs,
usg_safe = imp_safe }
where
- maybe_iface = lookupIfaceByModule dflags hpt pit mod
+ maybe_iface = lookupIfaceByModule hpt pit mod
-- In one-shot mode, the interfaces for home-package
-- modules accumulate in the PIT not HPT. Sigh.
diff --git a/compiler/iface/LoadIface.hs b/compiler/iface/LoadIface.hs
index 6da6565219..2485f07df2 100644
--- a/compiler/iface/LoadIface.hs
+++ b/compiler/iface/LoadIface.hs
@@ -409,7 +409,7 @@ loadInterface doc_str mod from
-- Check whether we have the interface already
; dflags <- getDynFlags
- ; case lookupIfaceByModule dflags hpt (eps_PIT eps) mod of {
+ ; case lookupIfaceByModule hpt (eps_PIT eps) mod of {
Just iface
-> return (Succeeded iface) ; -- Already loaded
-- The (src_imp == mi_boot iface) test checks that the already-loaded
@@ -675,14 +675,13 @@ moduleFreeHolesPrecise doc_str mod
traceIf (text "Considering whether to load" <+> ppr mod <+>
text "to compute precise free module holes")
(eps, hpt) <- getEpsAndHpt
- dflags <- getDynFlags
- case tryEpsAndHpt dflags eps hpt `firstJust` tryDepsCache eps imod insts of
+ case tryEpsAndHpt eps hpt `firstJust` tryDepsCache eps imod insts of
Just r -> return (Succeeded r)
Nothing -> readAndCache imod insts
(_, Nothing) -> return (Succeeded emptyUniqDSet)
where
- tryEpsAndHpt dflags eps hpt =
- fmap mi_free_holes (lookupIfaceByModule dflags hpt (eps_PIT eps) mod)
+ tryEpsAndHpt eps hpt =
+ fmap mi_free_holes (lookupIfaceByModule hpt (eps_PIT eps) mod)
tryDepsCache eps imod insts =
case lookupInstalledModuleEnv (eps_free_holes eps) imod of
Just ifhs -> Just (renameFreeHoles ifhs insts)
diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs
index 296e72a814..313fdc0eaa 100644
--- a/compiler/iface/MkIface.hs
+++ b/compiler/iface/MkIface.hs
@@ -365,7 +365,7 @@ mkHashFun hsc_env eps name
orig_mod = nameModule name
lookup mod = do
MASSERT2( isExternalName name, ppr name )
- iface <- case lookupIfaceByModule dflags hpt pit mod of
+ iface <- case lookupIfaceByModule hpt pit mod of
Just iface -> return iface
Nothing -> do
-- This can occur when we're writing out ifaces for
@@ -751,9 +751,8 @@ getOrphanHashes hsc_env mods = do
let
hpt = hsc_HPT hsc_env
pit = eps_PIT eps
- dflags = hsc_dflags hsc_env
get_orph_hash mod =
- case lookupIfaceByModule dflags hpt pit mod of
+ case lookupIfaceByModule hpt pit mod of
Just iface -> return (mi_orphan_hash (mi_final_exts iface))
Nothing -> do -- similar to 'mkHashFun'
iface <- initIfaceLoad hsc_env . withException
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index 16f50f11e9..83e3145306 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -1217,12 +1217,11 @@ hscCheckSafe' m l = do
lookup' :: Module -> Hsc (Maybe ModIface)
lookup' m = do
- dflags <- getDynFlags
hsc_env <- getHscEnv
hsc_eps <- liftIO $ hscEPS hsc_env
let pkgIfaceT = eps_PIT hsc_eps
homePkgT = hsc_HPT hsc_env
- iface = lookupIfaceByModule dflags homePkgT pkgIfaceT m
+ iface = lookupIfaceByModule homePkgT pkgIfaceT m
-- the 'lookupIfaceByModule' method will always fail when calling from GHCi
-- as the compiler hasn't filled in the various module tables
-- so we need to call 'getModuleInterface' to load from disk
diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs
index ca321d6405..afc3e725c0 100644
--- a/compiler/main/HscTypes.hs
+++ b/compiler/main/HscTypes.hs
@@ -684,12 +684,11 @@ data HomeModInfo
-- | Find the 'ModIface' for a 'Module', searching in both the loaded home
-- and external package module information
lookupIfaceByModule
- :: DynFlags
- -> HomePackageTable
+ :: HomePackageTable
-> PackageIfaceTable
-> Module
-> Maybe ModIface
-lookupIfaceByModule _dflags hpt pit mod
+lookupIfaceByModule hpt pit mod
= case lookupHptByModule hpt mod of
Just hm -> Just (hm_iface hm)
Nothing -> lookupModuleEnv pit mod
diff --git a/compiler/typecheck/FamInst.hs b/compiler/typecheck/FamInst.hs
index 67178d6f1d..5ec8681623 100644
--- a/compiler/typecheck/FamInst.hs
+++ b/compiler/typecheck/FamInst.hs
@@ -304,13 +304,12 @@ This is basically the idea from #13092, comment:14.
-- See Note [The type family instance consistency story].
checkFamInstConsistency :: [Module] -> TcM ()
checkFamInstConsistency directlyImpMods
- = do { dflags <- getDynFlags
- ; (eps, hpt) <- getEpsAndHpt
+ = do { (eps, hpt) <- getEpsAndHpt
; traceTc "checkFamInstConsistency" (ppr directlyImpMods)
; let { -- Fetch the iface of a given module. Must succeed as
-- all directly imported modules must already have been loaded.
modIface mod =
- case lookupIfaceByModule dflags hpt (eps_PIT eps) mod of
+ case lookupIfaceByModule hpt (eps_PIT eps) mod of
Nothing -> panicDoc "FamInst.checkFamInstConsistency"
(ppr mod $$ pprHPT hpt)
Just iface -> iface