From ddbf5c13453b6a740167ca90b007c45b6030d0aa Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 7 Feb 2001 16:12:47 +0000 Subject: [PATCH] [project @ 2001-02-07 16:12:47 by simonmar] wibbles --- ghc/compiler/compMan/CmTypes.lhs | 7 ++++++- ghc/compiler/compMan/CompManager.lhs | 27 ++++++++++++++++----------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/ghc/compiler/compMan/CmTypes.lhs b/ghc/compiler/compMan/CmTypes.lhs index ef2a785..ee8ed47 100644 --- a/ghc/compiler/compMan/CmTypes.lhs +++ b/ghc/compiler/compMan/CmTypes.lhs @@ -6,7 +6,7 @@ \begin{code} module CmTypes ( Unlinked(..), isObject, nameOfObject, isInterpretable, - Linkable(..), + Linkable(..), isObjectLinkable, ModSummary(..), ms_allimps, name_of_summary, pprSummaryTime ) where @@ -50,6 +50,9 @@ data Linkable = LM { linkableUnlinked :: [Unlinked] } +isObjectLinkable :: Linkable -> Bool +isObjectLinkable l = all isObject (linkableUnlinked l) + instance Outputable Linkable where ppr (LM when_made mod_nm unlinkeds) = text "LinkableM" <+> parens (text (show when_made)) <+> ppr mod_nm @@ -71,6 +74,8 @@ data ModSummary -- file, if home && source } +-- ToDo: shouldn't ms_srcimps and ms_imps be [Module]? --SDM + instance Outputable ModSummary where ppr ms = sep [text "ModSummary {", diff --git a/ghc/compiler/compMan/CompManager.lhs b/ghc/compiler/compMan/CompManager.lhs index 3426035..f2a83dc 100644 --- a/ghc/compiler/compMan/CompManager.lhs +++ b/ghc/compiler/compMan/CompManager.lhs @@ -201,17 +201,7 @@ cmLoadModule cmstate1 rootname let mg2_with_srcimps = topological_sort True mg2unsorted -- Sort out which linkables we wish to keep in the unlinked image. - -- For each module, we take: - -- - -- - the old in-core linkable, if available - -- - an on-disk linkable, if available - -- - -- and we take the youngest of these, provided it is younger than the - -- source file. - -- - -- If a module has a valid linkable, then it may be STABLE (see below), - -- and it is classified as SOURCE UNCHANGED for the purposes of calling - -- compile. + -- See getValidLinkables below for details. valid_linkables <- getValidLinkables ui1 mg2unsorted_names mg2_with_srcimps @@ -347,6 +337,21 @@ cmLoadModule cmstate1 rootname ----------------------------------------------------------------------------- -- getValidLinkables +-- For each module (or SCC of modules), we take: +-- +-- - the old in-core linkable, if available +-- - an on-disk linkable, if available +-- +-- and we take the youngest of these, provided it is younger than the +-- source file. We ignore the on-disk linkables unless all of the +-- dependents of this SCC also have on-disk linkables. +-- +-- If a module has a valid linkable, then it may be STABLE (see below), +-- and it is classified as SOURCE UNCHANGED for the purposes of calling +-- compile. +-- +-- ToDo: this pass could be merged with the preUpsweep. + getValidLinkables :: [Linkable] -- old linkables -> [ModuleName] -- all home modules -- 1.7.10.4