summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-08-09 11:29:45 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-13 07:54:32 -0400
commitc367b39e5236b86b4923d826ab0395b33211d30a (patch)
tree658e595a18356bcda04f3f72b168eb86bc51bf99 /compiler/GHC/Rename
parent7ad813a480c9ed383fe1fea11a57f90d4f6f9b71 (diff)
downloadhaskell-c367b39e5236b86b4923d826ab0395b33211d30a.tar.gz
Refactoring module dependencies
* Make mkDependencies pure * Use Sets instead of sorted lists Notable perf changes: MultiLayerModules(normal) ghc/alloc 4130851520.0 2981473072.0 -27.8% T13719(normal) ghc/alloc 4313296052.0 4151647512.0 -3.7% Metric Decrease: MultiLayerModules T13719
Diffstat (limited to 'compiler/GHC/Rename')
-rw-r--r--compiler/GHC/Rename/Names.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs
index 2a27773647..b7dd191aa0 100644
--- a/compiler/GHC/Rename/Names.hs
+++ b/compiler/GHC/Rename/Names.hs
@@ -486,7 +486,7 @@ calculateAvails home_unit iface mod_safe' want_boot imported_by =
| otherwise = dep_finsts deps
-- Trusted packages are a lot like orphans.
- trusted_pkgs | mod_safe' = S.fromList (dep_trusted_pkgs deps)
+ trusted_pkgs | mod_safe' = dep_trusted_pkgs deps
| otherwise = S.empty
@@ -502,11 +502,11 @@ calculateAvails home_unit iface mod_safe' want_boot imported_by =
dependent_pkgs = if isHomeUnit home_unit pkg
then S.empty
- else S.fromList [ipkg]
+ else S.singleton ipkg
direct_mods = mkModDeps $ if isHomeUnit home_unit pkg
- then [GWIB (moduleName imp_mod) want_boot]
- else []
+ then S.singleton (GWIB (moduleName imp_mod) want_boot)
+ else S.empty
dep_boot_mods_map = mkModDeps (dep_boot_mods deps)