Better messages from HscTypes.showModMsg.
[ghc-hetmet.git] / ghc / compiler / main / HscMain.lhs
index ed95559..e170f8f 100644 (file)
@@ -274,7 +274,7 @@ hscMkCompiler norecomp messenger frontend backend
 hscCompileOneShot :: Compiler HscStatus
 hscCompileOneShot hsc_env mod_summary =
     compiler hsc_env mod_summary
-    where mkComp = hscMkCompiler (norecompOneShot HscNoRecomp) oneShotMsg
+    where mkComp = hscMkCompiler norecompOneShot oneShotMsg
           -- How to compile nonBoot files.
           nonBootComp inp = hscSimplify inp >>= hscNormalIface >>=
                             hscWriteIface >>= hscOneShot
@@ -293,7 +293,7 @@ hscCompileOneShot hsc_env mod_summary =
 hscCompileBatch :: Compiler (HscStatus, ModIface, ModDetails)
 hscCompileBatch hsc_env mod_summary
     = compiler hsc_env mod_summary
-    where mkComp = hscMkCompiler norecompBatch (batchMsg False)
+    where mkComp = hscMkCompiler norecompBatch batchMsg
           nonBootComp inp = hscSimplify inp >>= hscNormalIface >>=
                             hscWriteIface >>= hscBatch
           bootComp inp = hscSimpleIface inp >>= hscWriteIface >>= hscNothing
@@ -307,10 +307,11 @@ hscCompileBatch hsc_env mod_summary
                     -> mkComp hscFileFrontEnd bootComp
 
 -- Type-check Haskell, boot and extCore.
+-- Does it make sense to compile extCore to nothing?
 hscCompileNothing :: Compiler (HscStatus, ModIface, ModDetails)
 hscCompileNothing hsc_env mod_summary
     = compiler hsc_env mod_summary
-    where mkComp = hscMkCompiler norecompBatch (batchMsg False)
+    where mkComp = hscMkCompiler norecompBatch batchMsg
           pipeline inp = hscSimpleIface inp >>= hscIgnoreIface >>= hscNothing
           compiler
               = case ms_hsc_src mod_summary of
@@ -324,7 +325,7 @@ hscCompileNothing hsc_env mod_summary
 -- Compile Haskell, extCore to bytecode.
 hscCompileInteractive :: Compiler (InteractiveStatus, ModIface, ModDetails)
 hscCompileInteractive hsc_env mod_summary =
-    hscMkCompiler norecompInteractive (batchMsg True)
+    hscMkCompiler norecompInteractive batchMsg
                   frontend backend
                   hsc_env mod_summary
     where backend inp = hscSimplify inp >>= hscNormalIface >>= hscIgnoreIface >>= hscInteractive
@@ -339,12 +340,12 @@ hscCompileInteractive hsc_env mod_summary =
 -- NoRecomp handlers
 --------------------------------------------------------------
 
-norecompOneShot :: a -> NoRecomp a
-norecompOneShot a old_iface
+norecompOneShot :: NoRecomp HscStatus
+norecompOneShot old_iface
     = do hsc_env <- gets compHscEnv
          liftIO $ do
          dumpIfaceStats hsc_env
-         return a
+         return HscNoRecomp
 
 norecompBatch :: NoRecomp (HscStatus, ModIface, ModDetails)
 norecompBatch = norecompWorker HscNoRecomp False
@@ -376,13 +377,13 @@ oneShotMsg _mb_mod_index recomp
             else compilationProgressMsg (hsc_dflags hsc_env) $
                      "compilation IS NOT required"
 
-batchMsg :: Bool -> Maybe (Int,Int) -> Bool -> Comp ()
-batchMsg toInterp mb_mod_index recomp
+batchMsg :: Maybe (Int,Int) -> Bool -> Comp ()
+batchMsg mb_mod_index recomp
     = do hsc_env <- gets compHscEnv
          mod_summary <- gets compModSummary
          let showMsg msg = compilationProgressMsg (hsc_dflags hsc_env) $
                            (showModuleIndex mb_mod_index ++
-                            msg ++ showModMsg (not toInterp) mod_summary)
+                            msg ++ showModMsg (hscTarget (hsc_dflags hsc_env)) recomp mod_summary)
          liftIO $ do
          if recomp
             then showMsg "Compiling "