[project @ 2001-06-07 14:15:22 by simonmar]
authorsimonmar <unknown>
Thu, 7 Jun 2001 14:15:22 +0000 (14:15 +0000)
committersimonmar <unknown>
Thu, 7 Jun 2001 14:15:22 +0000 (14:15 +0000)
Don't force a module's {-# SOURCE #-} imports to have object linkables
in order for the current module's object linkable to be considered
valid (fixes some unnecessary recompilation with recursive modules).

ghc/compiler/compMan/CompManager.lhs

index 6c1439b..56d8325 100644 (file)
@@ -392,7 +392,7 @@ cmLoadModule cmstate1 rootname
                                mg2_with_srcimps
        -- when (verb >= 2) $
         --    putStrLn (showSDoc (text "Valid linkables:" 
-        --                       <+> ppr valid_linkables))
+        --                      <+> ppr valid_linkables))
 
         -- Figure out a stable set of modules which can be retained
         -- the top level envs, to avoid upsweeping them.  Goes to a
@@ -575,7 +575,10 @@ getValidLinkablesSCC old_linkables all_home_mods new_linkables scc0
          scc             = flattenSCC scc0
           scc_names       = map name_of_summary scc
          home_module m   = m `elem` all_home_mods && m `notElem` scc_names
-          scc_allhomeimps = nub (filter home_module (concatMap ms_allimps scc))
+          scc_allhomeimps = nub (filter home_module (concatMap ms_imps scc))
+               -- NOTE: ms_imps, not ms_allimps above.  We don't want to
+               -- force a module's SOURCE imports to be already compiled for
+               -- its object linkable to be valid.
 
          has_object m = case findModuleLinkable_maybe new_linkables m of
                            Nothing -> False
@@ -641,7 +644,6 @@ getValidLinkable old_linkables objects_allowed new_linkables summary
        return (valid_linkable ++ new_linkables)
 
 
-
 maybe_getFileLinkable :: ModuleName -> FilePath -> IO (Maybe Linkable)
 maybe_getFileLinkable mod_name obj_fn
    = do obj_exist <- doesFileExist obj_fn