summaryrefslogtreecommitdiff
path: root/compiler/GHC/Iface
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Iface')
-rw-r--r--compiler/GHC/Iface/Load.hs6
-rw-r--r--compiler/GHC/Iface/Recomp.hs27
2 files changed, 19 insertions, 14 deletions
diff --git a/compiler/GHC/Iface/Load.hs b/compiler/GHC/Iface/Load.hs
index bf7ae8e005..0786505e3a 100644
--- a/compiler/GHC/Iface/Load.hs
+++ b/compiler/GHC/Iface/Load.hs
@@ -1172,7 +1172,7 @@ pprUsage :: Usage -> SDoc
pprUsage usage@UsagePackageModule{}
= pprUsageImport usage usg_mod
pprUsage usage@UsageHomeModule{}
- = pprUsageImport usage usg_mod_name $$
+ = pprUsageImport usage (\u -> mkModule (usg_unit_id u) (usg_mod_name u)) $$
nest 2 (
maybe Outputable.empty (\v -> text "exports: " <> ppr v) (usg_exports usage) $$
vcat [ ppr n <+> ppr v | (n,v) <- usg_entities usage ]
@@ -1184,7 +1184,9 @@ pprUsage usage@UsageFile{}
pprUsage usage@UsageMergedRequirement{}
= hsep [text "merged", ppr (usg_mod usage), ppr (usg_mod_hash usage)]
pprUsage usage@UsageHomeModuleInterface{}
- = hsep [text "implementation", ppr (usg_mod_name usage), ppr (usg_iface_hash usage)]
+ = hsep [text "implementation", ppr (usg_mod_name usage)
+ , ppr (usg_unit_id usage)
+ , ppr (usg_iface_hash usage)]
pprUsageImport :: Outputable a => Usage -> (Usage -> a) -> SDoc
pprUsageImport usage usg_mod'
diff --git a/compiler/GHC/Iface/Recomp.hs b/compiler/GHC/Iface/Recomp.hs
index 886bc12192..0f8748e536 100644
--- a/compiler/GHC/Iface/Recomp.hs
+++ b/compiler/GHC/Iface/Recomp.hs
@@ -403,7 +403,7 @@ checkVersions hsc_env mod_summary iface
when (isOneShot (ghcMode (hsc_dflags hsc_env))) $ do {
; updateEps_ $ \eps -> eps { eps_is_boot = mkModDeps $ dep_boot_mods (mi_deps iface) }
}
- ; recomp <- checkList [checkModUsage (hsc_FC hsc_env) (homeUnitAsUnit home_unit) u
+ ; recomp <- checkList [checkModUsage (hsc_FC hsc_env) u
| u <- mi_usages iface]
; case recomp of (NeedsRecompile reason) -> return $ OutOfDateItem reason (Just iface) ; _ -> do {
; return $ UpToDateItem iface
@@ -682,7 +682,7 @@ tryGetModIface doc_msg mod
= do -- Load the imported interface if possible
logger <- getLogger
let doc_str = sep [text doc_msg, ppr mod]
- liftIO $ trace_hi_diffs logger (text "Checking interface for module" <+> ppr mod)
+ liftIO $ trace_hi_diffs logger (text "Checking interface for module" <+> ppr mod <+> ppr (moduleUnit mod))
mb_iface <- loadInterface doc_str mod ImportBySystem
-- Load the interface, but don't complain on failure;
@@ -701,8 +701,8 @@ tryGetModIface doc_msg mod
-- | Given the usage information extracted from the old
-- M.hi file for the module being compiled, figure out
-- whether M needs to be recompiled.
-checkModUsage :: FinderCache -> Unit -> Usage -> IfG RecompileRequired
-checkModUsage _ _this_pkg UsagePackageModule{
+checkModUsage :: FinderCache -> Usage -> IfG RecompileRequired
+checkModUsage _ UsagePackageModule{
usg_mod = mod,
usg_mod_hash = old_mod_hash } = do
logger <- getLogger
@@ -714,25 +714,28 @@ checkModUsage _ _this_pkg UsagePackageModule{
-- recompile. This is safe but may entail more recompilation when
-- a dependent package has changed.
-checkModUsage _ _ UsageMergedRequirement{ usg_mod = mod, usg_mod_hash = old_mod_hash } = do
+checkModUsage _ UsageMergedRequirement{ usg_mod = mod, usg_mod_hash = old_mod_hash } = do
logger <- getLogger
needInterface mod $ \iface -> do
let reason = ModuleChangedRaw (moduleName mod)
checkModuleFingerprint logger reason old_mod_hash (mi_mod_hash (mi_final_exts iface))
-checkModUsage _ this_pkg UsageHomeModuleInterface{ usg_mod_name = mod_name, usg_iface_hash = old_mod_hash } = do
- let mod = mkModule this_pkg mod_name
+checkModUsage _ UsageHomeModuleInterface{ usg_mod_name = mod_name
+ , usg_unit_id = uid
+ , usg_iface_hash = old_mod_hash } = do
+ let mod = mkModule (RealUnit (Definite uid)) mod_name
logger <- getLogger
needInterface mod $ \iface -> do
let reason = ModuleChangedIface mod_name
checkIfaceFingerprint logger reason old_mod_hash (mi_iface_hash (mi_final_exts iface))
-checkModUsage _ this_pkg UsageHomeModule{
+checkModUsage _ UsageHomeModule{
usg_mod_name = mod_name,
+ usg_unit_id = uid,
usg_mod_hash = old_mod_hash,
usg_exports = maybe_old_export_hash,
usg_entities = old_decl_hash }
= do
- let mod = mkModule this_pkg mod_name
+ let mod = mkModule (RealUnit (Definite uid)) mod_name
logger <- getLogger
needInterface mod $ \iface -> do
let
@@ -757,9 +760,9 @@ checkModUsage _ this_pkg UsageHomeModule{
, up_to_date logger (text " Great! The bits I use are up to date")
]
-checkModUsage fc _this_pkg UsageFile{ usg_file_path = file,
- usg_file_hash = old_hash,
- usg_file_label = mlabel } =
+checkModUsage fc UsageFile{ usg_file_path = file,
+ usg_file_hash = old_hash,
+ usg_file_label = mlabel } =
liftIO $
handleIO handler $ do
new_hash <- lookupFileCache fc file