diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-09-08 11:17:38 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-17 09:45:36 -0400 |
commit | c662ac7e39a0a2fb85d4ab17ae71d54752d24f39 (patch) | |
tree | 01ec2534a67671f010fb985f00fce1a4cd492f99 /compiler/GHC/Rename | |
parent | da60e6276e4b71217e2e75dfa49f2d460b526af3 (diff) | |
download | haskell-c662ac7e39a0a2fb85d4ab17ae71d54752d24f39.tar.gz |
Refactor module dependencies code
* moved deps related code into GHC.Unit.Module.Deps
* refactored Deps module to not export Dependencies constructor to help
maintaining invariants
Diffstat (limited to 'compiler/GHC/Rename')
-rw-r--r-- | compiler/GHC/Rename/Names.hs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs index b7dd191aa0..9c9781aa9d 100644 --- a/compiler/GHC/Rename/Names.hs +++ b/compiler/GHC/Rename/Names.hs @@ -477,13 +477,16 @@ calculateAvails home_unit iface mod_safe' want_boot imported_by = -- 'imp_finsts' if it defines an orphan or instance family; thus the -- orph_iface/has_iface tests. - orphans | orph_iface = assertPpr (not (imp_sem_mod `elem` dep_orphs deps)) (ppr imp_sem_mod <+> ppr (dep_orphs deps)) $ - imp_sem_mod : dep_orphs deps - | otherwise = dep_orphs deps + deporphs = dep_orphs deps + depfinsts = dep_finsts deps - finsts | has_finsts = assertPpr (not (imp_sem_mod `elem` dep_finsts deps)) (ppr imp_sem_mod <+> ppr (dep_orphs deps)) $ - imp_sem_mod : dep_finsts deps - | otherwise = dep_finsts deps + orphans | orph_iface = assertPpr (not (imp_sem_mod `elem` deporphs)) (ppr imp_sem_mod <+> ppr deporphs) $ + imp_sem_mod : deporphs + | otherwise = deporphs + + finsts | has_finsts = assertPpr (not (imp_sem_mod `elem` depfinsts)) (ppr imp_sem_mod <+> ppr depfinsts) $ + imp_sem_mod : depfinsts + | otherwise = depfinsts -- Trusted packages are a lot like orphans. trusted_pkgs | mod_safe' = dep_trusted_pkgs deps |