summaryrefslogtreecommitdiff
path: root/compiler/GHC/HsToCore/Usage.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-02-04 23:20:25 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-26 19:00:07 -0400
commit599efd90d54a01802b1285c0e357738e4d0bdb3a (patch)
tree2f6468fe8caabebd85d4a84d805bf04f7de1cd77 /compiler/GHC/HsToCore/Usage.hs
parent872a9444df4d38cd5dc0fbb7a249d89596e73ea2 (diff)
downloadhaskell-599efd90d54a01802b1285c0e357738e4d0bdb3a.tar.gz
Refactor FinderCache
Diffstat (limited to 'compiler/GHC/HsToCore/Usage.hs')
-rw-r--r--compiler/GHC/HsToCore/Usage.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/compiler/GHC/HsToCore/Usage.hs b/compiler/GHC/HsToCore/Usage.hs
index 3a0c27faac..a0fadacb89 100644
--- a/compiler/GHC/HsToCore/Usage.hs
+++ b/compiler/GHC/HsToCore/Usage.hs
@@ -213,7 +213,11 @@ mkPluginUsage hsc_env pluginModule
(ppr pNm)
_ -> mapM hashFile (nub files)
_ -> do
- foundM <- findPluginModule hsc_env pNm
+ let fc = hsc_FC hsc_env
+ let units = hsc_units hsc_env
+ let home_unit = hsc_home_unit hsc_env
+ let dflags = hsc_dflags hsc_env
+ foundM <- findPluginModule fc units home_unit dflags pNm
case foundM of
-- The plugin was built locally: look up the object file containing
-- the `plugin` binder, and all object files belong to modules that are
@@ -225,6 +229,9 @@ mkPluginUsage hsc_env pluginModule
_ -> pprPanic "mkPluginUsage: no object file found" (ppr pNm)
where
dflags = hsc_dflags hsc_env
+ fc = hsc_FC hsc_env
+ home_unit = hsc_home_unit hsc_env
+ units = hsc_units hsc_env
platform = targetPlatform dflags
pkgs = hsc_units hsc_env
pNm = moduleName $ mi_module pluginModule
@@ -235,7 +242,7 @@ mkPluginUsage hsc_env pluginModule
-- Lookup object file for a plugin dependency,
-- from the same package as the plugin.
lookupObjectFile nm = do
- foundM <- findImportedModule hsc_env nm Nothing
+ foundM <- findImportedModule fc units home_unit dflags nm Nothing
case foundM of
Found ml m
| moduleUnit m == pPkg -> Just <$> hashFile (ml_obj_file ml)