diff options
Diffstat (limited to 'compiler/GHC/Unit/Module/Deps.hs')
-rw-r--r-- | compiler/GHC/Unit/Module/Deps.hs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/compiler/GHC/Unit/Module/Deps.hs b/compiler/GHC/Unit/Module/Deps.hs index 9832383d8a..ebdd4b351f 100644 --- a/compiler/GHC/Unit/Module/Deps.hs +++ b/compiler/GHC/Unit/Module/Deps.hs @@ -16,6 +16,9 @@ import GHC.Unit.Module import GHC.Utils.Fingerprint import GHC.Utils.Binary +import Data.Set (Set) +import qualified Data.Set as Set + -- | Dependency information about ALL modules and packages below this one -- in the import hierarchy. This is the serialisable version of `ImportAvails`. -- @@ -25,10 +28,10 @@ import GHC.Utils.Binary -- -- See Note [Transitive Information in Dependencies] data Dependencies = Deps - { dep_direct_mods :: [ModuleNameWithIsBoot] + { dep_direct_mods :: Set ModuleNameWithIsBoot -- ^ All home-package modules which are directly imported by this one. - , dep_direct_pkgs :: [UnitId] + , dep_direct_pkgs :: Set UnitId -- ^ All packages directly imported by this module -- I.e. packages to which this module's direct imports belong. -- @@ -38,12 +41,12 @@ data Dependencies = Deps -- ^ Transitive closure of hsig files in the home package - , dep_trusted_pkgs :: [UnitId] + , dep_trusted_pkgs :: Set UnitId -- Packages which we are required to trust -- when the module is imported as a safe import -- (Safe Haskell). See Note [Tracking Trust Transitively] in GHC.Rename.Names - , dep_boot_mods :: [ModuleNameWithIsBoot] + , dep_boot_mods :: Set ModuleNameWithIsBoot -- ^ All modules which have boot files below this one, and whether we -- should use the boot file or not. -- This information is only used to populate the eps_is_boot field. @@ -96,7 +99,15 @@ instance Binary Dependencies where dep_finsts = fis }) noDependencies :: Dependencies -noDependencies = Deps [] [] [] [] [] [] [] +noDependencies = Deps + { dep_direct_mods = Set.empty + , dep_direct_pkgs = Set.empty + , dep_sig_mods = [] + , dep_boot_mods = Set.empty + , dep_trusted_pkgs = Set.empty + , dep_orphs = [] + , dep_finsts = [] + } -- | Records modules for which changes may force recompilation of this module -- See wiki: https://gitlab.haskell.org/ghc/ghc/wikis/commentary/compiler/recompilation-avoidance |