summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-04-28 11:22:34 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-04-28 11:22:34 +0100
commit9affeec7c7ab251cf6d24b09499e31b706715847 (patch)
tree1d47d5d617e04244fbbc377154c628830e1fb643
parent53e0f3d3be01e6a9402e189f85ead411b3741f1c (diff)
downloadhaskell-9affeec7c7ab251cf6d24b09499e31b706715847.tar.gz
Compute transitive closure in follow_deps
-rw-r--r--compiler/GHC/Linker/Loader.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/GHC/Linker/Loader.hs b/compiler/GHC/Linker/Loader.hs
index 735f6ceb16..0ba21e8369 100644
--- a/compiler/GHC/Linker/Loader.hs
+++ b/compiler/GHC/Linker/Loader.hs
@@ -691,19 +691,20 @@ getLinkDeps hsc_env hpt pls replace_osuf span mods
home_unit = hsc_home_unit hsc_env
pkg_deps = dep_pkgs deps
- (boot_deps, mod_deps) = flip partitionWith (dep_mods deps) $
+ (boot_deps, mod_deps) = flip partitionWith (dep_direct_mods deps) $
\ (GWIB { gwib_mod = m, gwib_isBoot = is_boot }) ->
m & case is_boot of
IsBoot -> Left
NotBoot -> Right
- boot_deps' = filter (not . (`elementOfUniqDSet` acc_mods)) boot_deps
+ --
+ mod_deps' = filter (not . (`elementOfUniqDSet` acc_mods)) (boot_deps ++ mod_deps)
acc_mods' = addListToUniqDSet acc_mods (moduleName mod : mod_deps)
acc_pkgs' = addListToUniqDSet acc_pkgs $ map fst pkg_deps
--
if not (isHomeUnit home_unit pkg)
then follow_deps mods acc_mods (addOneToUniqDSet acc_pkgs' (toUnitId pkg))
- else follow_deps (map (mkHomeModule home_unit) boot_deps' ++ mods)
+ else follow_deps (map (mkHomeModule home_unit) mod_deps' ++ mods)
acc_mods' acc_pkgs'
where
msg = text "need to link module" <+> ppr mod <+>