+ ; (warns, maybe_ds_result) <- _scc_ "DeSugar"
+ deSugar hsc_env tc_result
+ ; msg_act (warns, emptyBag)
+ ; case maybe_ds_result of
+ Nothing -> return Nothing
+ Just ds_result -> return (Just ds_result)
+ }}}}}
+
+------------------------------
+hscBootBackEnd :: HscEnv -> ModSummary -> Maybe ModIface -> Maybe ModGuts -> IO HscResult
+-- For hs-boot files, there's no code generation to do
+
+hscBootBackEnd hsc_env mod_summary maybe_checked_iface Nothing
+ = return HscFail
+hscBootBackEnd hsc_env mod_summary maybe_checked_iface (Just ds_result)
+ = do { final_iface <- _scc_ "MkFinalIface"
+ mkIface hsc_env (ms_location mod_summary)
+ maybe_checked_iface ds_result
+
+ ; let { final_details = ModDetails { md_types = mg_types ds_result,
+ md_insts = mg_insts ds_result,
+ md_rules = mg_rules ds_result } }
+ -- And the answer is ...
+ ; dumpIfaceStats hsc_env
+
+ ; return (HscRecomp final_details
+ final_iface
+ False False Nothing)
+ }
+
+------------------------------
+hscBackEnd :: HscEnv -> ModSummary -> Maybe ModIface -> Maybe ModGuts -> IO HscResult
+
+hscBackEnd hsc_env mod_summary maybe_checked_iface Nothing
+ = return HscFail
+
+hscBackEnd hsc_env mod_summary maybe_checked_iface (Just ds_result)
+ = do { -- OMITTED:
+ -- ; seqList imported_modules (return ())
+
+ let one_shot = isOneShot (ghcMode (hsc_dflags hsc_env))
+ dflags = hsc_dflags hsc_env
+
+ -------------------
+ -- FLATTENING
+ -------------------
+ ; flat_result <- _scc_ "Flattening"
+ flatten hsc_env ds_result
+
+
+{- TEMP: need to review space-leak fixing here
+ NB: even the code generator can force one of the
+ thunks for constructor arguments, for newtypes in particular
+
+ ; let -- Rule-base accumulated from imported packages
+ pkg_rule_base = eps_rule_base (hsc_EPS hsc_env)
+
+ -- In one-shot mode, ZAP the external package state at
+ -- this point, because we aren't going to need it from
+ -- now on. We keep the name cache, however, because
+ -- tidyCore needs it.
+ pcs_middle
+ | one_shot = pcs_tc{ pcs_EPS = error "pcs_EPS missing" }
+ | otherwise = pcs_tc
+
+ ; pkg_rule_base `seq` pcs_middle `seq` return ()
+-}
+
+ -- alive at this point:
+ -- pcs_middle
+ -- flat_result
+ -- pkg_rule_base