[project @ 2001-02-07 16:12:47 by simonmar]
authorsimonmar <unknown>
Wed, 7 Feb 2001 16:12:47 +0000 (16:12 +0000)
committersimonmar <unknown>
Wed, 7 Feb 2001 16:12:47 +0000 (16:12 +0000)
wibbles

ghc/compiler/compMan/CmTypes.lhs
ghc/compiler/compMan/CompManager.lhs

index ef2a785..ee8ed47 100644 (file)
@@ -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 {",
index 3426035..f2a83dc 100644 (file)
@@ -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