X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FHscMain.lhs;h=d5ad093bc9d3ef10f5cfa92ebd48e166e65a68d0;hb=0a5613f40b0e32cf59966e6b56b807cdbe80aa7b;hp=9f91b4d6ba336a4f56c7715c3d7ca4cf085b3516;hpb=a21998556af1e827b9462d2cdc46005e90fb7fd2;p=ghc-hetmet.git diff --git a/compiler/main/HscMain.lhs b/compiler/main/HscMain.lhs index 9f91b4d..d5ad093 100644 --- a/compiler/main/HscMain.lhs +++ b/compiler/main/HscMain.lhs @@ -24,6 +24,7 @@ module HscMain , hscCompileBatch -- :: Compiler (HscStatus, ModIface, ModDetails) , hscCompileNothing -- :: Compiler (HscStatus, ModIface, ModDetails) , hscCompileInteractive -- :: Compiler (InteractiveStatus, ModIface, ModDetails) + , hscCheckRecompBackend , HscStatus' (..) , InteractiveStatus, HscStatus @@ -382,6 +383,22 @@ genericHscCompile compiler hscMessage -> do hscMessage mb_mod_index True mod_summary hscRecompile compiler mod_summary mb_old_hash +hscCheckRecompBackend :: HsCompiler a -> TcGblEnv -> Compiler a +hscCheckRecompBackend compiler tc_result + hsc_env mod_summary source_unchanged mb_old_iface _m_of_n = + withTempSession (\_ -> hsc_env) $ do + (recomp_reqd, mb_checked_iface) + <- {-# SCC "checkOldIface" #-} + liftIO $ checkOldIface hsc_env mod_summary + source_unchanged mb_old_iface + + let mb_old_hash = fmap mi_iface_hash mb_checked_iface + case mb_checked_iface of + Just iface | not recomp_reqd + -> hscNoRecomp compiler iface{ mi_globals = Just (tcg_rdr_env tc_result) } + _otherwise + -> hscBackend compiler tc_result mod_summary mb_old_hash + genericHscRecompile :: GhcMonad m => HsCompiler a -> ModSummary -> Maybe Fingerprint