+ = do { compilationProgressMsg (hsc_dflags hsc_env) $
+ (showModuleIndex mb_mod_index ++
+ "Skipping " ++ showModMsg have_object mod_summary)
+
+ ; new_details <- {-# SCC "tcRnIface" #-}
+ initIfaceCheck hsc_env $
+ typecheckIface old_iface ;
+ ; dumpIfaceStats hsc_env
+
+ ; return (HscNoRecomp new_details old_iface)
+ }
+
+hscNoRecomp hsc_env mod_summary
+ have_object Nothing
+ mb_mod_index
+ = panic "hscNoRecomp" -- hscNoRecomp definitely expects to
+ -- have the old interface available
+
+------------------------------
+hscRecomp hsc_env mod_summary
+ have_object maybe_old_iface
+ mb_mod_index
+ = case ms_hsc_src mod_summary of
+ HsSrcFile -> do
+ front_res <- hscFileFrontEnd hsc_env mod_summary mb_mod_index
+ case ghcMode (hsc_dflags hsc_env) of
+ JustTypecheck -> hscBootBackEnd hsc_env mod_summary maybe_old_iface front_res
+ _ -> hscBackEnd hsc_env mod_summary maybe_old_iface front_res
+
+ HsBootFile -> do
+ front_res <- hscFileFrontEnd hsc_env mod_summary mb_mod_index
+ hscBootBackEnd hsc_env mod_summary maybe_old_iface front_res
+
+ ExtCoreFile -> do
+ front_res <- hscCoreFrontEnd hsc_env mod_summary
+ hscBackEnd hsc_env mod_summary maybe_old_iface front_res
+
+hscCoreFrontEnd hsc_env mod_summary = do {
+ -------------------
+ -- PARSE
+ -------------------
+ ; inp <- readFile (expectJust "hscCoreFrontEnd" (ms_hspp_file mod_summary))
+ ; case parseCore inp 1 of
+ FailP s -> errorMsg (hsc_dflags hsc_env) (text s{-ToDo: wrong-}) >> return Nothing
+ OkP rdr_module -> do {
+
+ -------------------
+ -- RENAME and TYPECHECK
+ -------------------
+ ; (tc_msgs, maybe_tc_result) <- {-# SCC "TypeCheck" #-}
+ tcRnExtCore hsc_env rdr_module
+ ; printErrorsAndWarnings (hsc_dflags hsc_env) tc_msgs
+ ; case maybe_tc_result of
+ Nothing -> return Nothing
+ Just mod_guts -> return (Just mod_guts) -- No desugaring to do!
+ }}
+
+
+hscFileFrontEnd hsc_env mod_summary mb_mod_index = do {
+ -------------------
+ -- DISPLAY PROGRESS MESSAGE
+ -------------------
+ ; let dflags = hsc_dflags hsc_env
+ one_shot = isOneShot (ghcMode dflags)
+ toInterp = hscTarget dflags == HscInterpreted
+ ; when (not one_shot) $
+ compilationProgressMsg dflags $
+ (showModuleIndex mb_mod_index ++
+ "Compiling " ++ showModMsg (not toInterp) mod_summary)
+
+ -------------------
+ -- PARSE
+ -------------------
+ ; let hspp_file = expectJust "hscFileFrontEnd" (ms_hspp_file mod_summary)
+ hspp_buf = ms_hspp_buf mod_summary