[project @ 2003-07-18 13:25:55 by simonmar]
[ghc-hetmet.git] / ghc / compiler / compMan / CompManager.lhs
index 84ff5ae..1722ddc 100644 (file)
@@ -705,18 +705,11 @@ cmLoadFinish ok Succeeded hpt mods ghci_mode pcs
 
        return (new_cmstate, ok, mods_loaded)
 
--- used to fish out the preprocess output files for the purposes
--- of cleaning up.
+-- used to fish out the preprocess output files for the purposes of
+-- cleaning up.  The preprocessed file *might* be the same as the
+-- source file, but that doesn't do any harm.
 ppFilesFromSummaries summaries
-  = [ fn | Just fn <- map toPpFile summaries ]
-  where
-   toPpFile sum
-     | hspp /= ml_hs_file loc = hspp
-     | otherwise              = Nothing
-    where
-      loc  = ms_location sum
-      hspp = ml_hspp_file loc
-
+  = [ fn | Just fn <- map (ml_hspp_file.ms_location) summaries ]
 
 -----------------------------------------------------------------------------
 -- getValidLinkables
@@ -1226,12 +1219,10 @@ summariseFile file
    = do hspp_fn <- preprocess file
         (srcimps,imps,mod_name) <- getImportsFromFile hspp_fn
 
-        let (path, basename, ext) = splitFilename3 file
-            -- GHC.Prim doesn't exist physically, so don't go looking for it.
+        let -- GHC.Prim doesn't exist physically, so don't go looking for it.
             the_imps = filter (/= gHC_PRIM_Name) imps
 
-       (mod, location) <- mkHomeModLocation mod_name True{-is a root-}
-                               path basename ext
+       (mod, location) <- mkHomeModLocation mod_name file
 
         src_timestamp
            <- case ml_hs_file location of