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/Unit/Module/ModSummary.hs | |
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/Unit/Module/ModSummary.hs')
-rw-r--r-- | compiler/GHC/Unit/Module/ModSummary.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/GHC/Unit/Module/ModSummary.hs b/compiler/GHC/Unit/Module/ModSummary.hs index ba59655033..c584385aef 100644 --- a/compiler/GHC/Unit/Module/ModSummary.hs +++ b/compiler/GHC/Unit/Module/ModSummary.hs @@ -1,4 +1,5 @@ {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE TupleSections #-} -- | A ModSummary is a node in the compilation manager's dependency graph -- (ModuleGraph) @@ -10,6 +11,7 @@ module GHC.Unit.Module.ModSummary , ms_installed_mod , ms_mod_name , ms_imps + , ms_plugin_imps , ms_mnwib , ms_home_srcimps , ms_home_imps @@ -114,11 +116,11 @@ ms_mod_name = moduleName . ms_mod -- | Textual imports, plus plugin imports but not SOURCE imports. ms_imps :: ModSummary -> [(Maybe FastString, Located ModuleName)] -ms_imps ms = - ms_textual_imps ms ++ - map mk_additional_import (dynFlagDependencies (ms_hspp_opts ms)) - where - mk_additional_import mod_nm = (Nothing, noLoc mod_nm) +ms_imps ms = ms_textual_imps ms ++ ms_plugin_imps ms + +-- | Plugin imports +ms_plugin_imps :: ModSummary -> [(Maybe FastString, Located ModuleName)] +ms_plugin_imps ms = map ((Nothing,) . noLoc) (pluginModNames (ms_hspp_opts ms)) home_imps :: [(Maybe FastString, Located ModuleName)] -> [Located ModuleName] home_imps imps = [ lmodname | (mb_pkg, lmodname) <- imps, |