X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FHscMain.lhs;h=e170f8fa31f351739aa92ccd39ec4b55d9ba1f24;hb=d7d596d039b48dec6b71df9c4bca0d12958ecdb9;hp=ed955591c9d9c3ae94f550441a53f704d4b5c58b;hpb=d700953c29ffe78d6530f734f2820c796e5ec6e0;p=ghc-hetmet.git diff --git a/ghc/compiler/main/HscMain.lhs b/ghc/compiler/main/HscMain.lhs index ed95559..e170f8f 100644 --- a/ghc/compiler/main/HscMain.lhs +++ b/ghc/compiler/main/HscMain.lhs @@ -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 "