diff options
Diffstat (limited to 'compiler/GHC/Unit/Module/Deps.hs')
-rw-r--r-- | compiler/GHC/Unit/Module/Deps.hs | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/compiler/GHC/Unit/Module/Deps.hs b/compiler/GHC/Unit/Module/Deps.hs index 2de3fe710d..2cafbbdcd4 100644 --- a/compiler/GHC/Unit/Module/Deps.hs +++ b/compiler/GHC/Unit/Module/Deps.hs @@ -32,9 +32,6 @@ data Dependencies = Deps -- ^ All packages directly imported by this module -- I.e. packages to which this module's direct imports belong. -- - , dep_plgins :: [ModuleName] - -- ^ All the plugins used while compiling this module. - -- Transitive information below here , dep_sig_mods :: ![ModuleName] @@ -82,7 +79,6 @@ instance Binary Dependencies where put_ bh (dep_boot_mods deps) put_ bh (dep_orphs deps) put_ bh (dep_finsts deps) - put_ bh (dep_plgins deps) get bh = do dms <- get bh dps <- get bh @@ -91,17 +87,16 @@ instance Binary Dependencies where sms <- get bh os <- get bh fis <- get bh - pl <- get bh return (Deps { dep_direct_mods = dms , dep_direct_pkgs = dps , dep_sig_mods = hsigms , dep_boot_mods = sms , dep_trusted_pkgs = tps , dep_orphs = os, - dep_finsts = fis, dep_plgins = pl }) + dep_finsts = fis }) noDependencies :: Dependencies -noDependencies = Deps [] [] [] [] [] [] [] [] +noDependencies = Deps [] [] [] [] [] [] [] -- | Records modules for which changes may force recompilation of this module -- See wiki: https://gitlab.haskell.org/ghc/ghc/wikis/commentary/compiler/recompilation-avoidance @@ -141,14 +136,31 @@ data Usage usg_file_path :: FilePath, -- ^ External file dependency. From a CPP #include or TH -- addDependentFile. Should be absolute. - usg_file_hash :: Fingerprint + usg_file_hash :: Fingerprint, -- ^ 'Fingerprint' of the file contents. + usg_file_label :: Maybe String + -- ^ An optional string which is used in recompilation messages if + -- file in question has changed. + -- Note: We don't consider things like modification timestamps -- here, because there's no reason to recompile if the actual -- contents don't change. This previously lead to odd -- recompilation behaviors; see #8114 } + | UsageHomeModuleInterface { + usg_mod_name :: ModuleName + -- ^ Name of the module + , usg_iface_hash :: Fingerprint + -- ^ The *interface* hash of the module, not the ABI hash. + -- This changes when anything about the interface (and hence the + -- module) has changed. + + -- UsageHomeModuleInterface is *only* used for recompilation + -- checking when using TemplateHaskell in the interpreter (where + -- some modules are loaded as BCOs). + + } -- | A requirement which was merged into this one. | UsageMergedRequirement { usg_mod :: Module, @@ -187,12 +199,18 @@ instance Binary Usage where putByte bh 2 put_ bh (usg_file_path usg) put_ bh (usg_file_hash usg) + put_ bh (usg_file_label usg) put_ bh usg@UsageMergedRequirement{} = do putByte bh 3 put_ bh (usg_mod usg) put_ bh (usg_mod_hash usg) + put_ bh usg@UsageHomeModuleInterface{} = do + putByte bh 4 + put_ bh (usg_mod_name usg) + put_ bh (usg_iface_hash usg) + get bh = do h <- getByte bh case h of @@ -212,11 +230,16 @@ instance Binary Usage where 2 -> do fp <- get bh hash <- get bh - return UsageFile { usg_file_path = fp, usg_file_hash = hash } + label <- get bh + return UsageFile { usg_file_path = fp, usg_file_hash = hash, usg_file_label = label } 3 -> do mod <- get bh hash <- get bh return UsageMergedRequirement { usg_mod = mod, usg_mod_hash = hash } + 4 -> do + mod <- get bh + hash <- get bh + return UsageHomeModuleInterface { usg_mod_name = mod, usg_iface_hash = hash } i -> error ("Binary.get(Usage): " ++ show i) |