X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FMain.lhs;h=3efd09c9d60aa732fb60adf7d6014200e8236583;hb=783e505e2d884f94d30ec8074e590507f2561c49;hp=a733c0fd1b8f0de92586b1b0fd11d5a0d1b29158;hpb=e1a4f2a5be6e4cd06d96b601fefd519c2569ba99;p=ghc-hetmet.git diff --git a/ghc/compiler/main/Main.lhs b/ghc/compiler/main/Main.lhs index a733c0f..3efd09c 100644 --- a/ghc/compiler/main/Main.lhs +++ b/ghc/compiler/main/Main.lhs @@ -20,13 +20,14 @@ import Lex ( PState(..), P, ParseResult(..) ) import SrcLoc ( mkSrcLoc ) import Rename ( renameModule ) +import RnMonad ( InterfaceDetails(..) ) import MkIface ( startIface, ifaceDecls, endIface ) import TcModule ( TcResults(..), typecheckModule ) import Desugar ( deSugar ) import SimplCore ( core2core ) import CoreLint ( endPass ) -import CoreSyn ( coreBindsSize ) +import CoreUtils ( coreBindsSize ) import CoreTidy ( tidyCorePgm ) import CoreToStg ( topCoreBindsToStg ) import StgSyn ( collectFinalStgBinders, pprStgBindings ) @@ -56,7 +57,7 @@ import NativeInfo ( os, arch ) \end{code} \begin{code} -main = +main = stderr `seq` -- Bug fix. Sigh -- _scc_ "main" doIt classifyOpts \end{code} @@ -74,7 +75,7 @@ parseModule = do ghcExit 1 return (error "parseModule") -- just to get the types right - POk _ m@(HsModule mod _ _ _ _ _) -> + POk _ m@(HsModule mod _ _ _ _ _ _) -> return (mod, m) where glaexts | opt_GlasgowExts = 1# @@ -123,7 +124,8 @@ doIt (core_cmds, stg_cmds) reportCompile mod_name "Compilation NOT required!" >> return (); - Just (this_mod, rn_mod, iface_file_stuff, rn_name_supply, imported_modules) -> + Just (this_mod, rn_mod, iface_file_stuff@(InterfaceDetails _ _ _ deprecations), + rn_name_supply, imported_modules) -> -- Oh well, we've got to recompile for real @@ -150,16 +152,16 @@ doIt (core_cmds, stg_cmds) -------------------------- Desugaring ---------------- _scc_ "DeSugar" - deSugar this_mod ds_uniqs tc_results >>= \ (desugared, rules, h_code, c_code) -> + deSugar this_mod ds_uniqs tc_results >>= \ (desugared, rules, h_code, c_code, fe_binders) -> -------------------------- Main Core-language transformations ---------------- _scc_ "Core2Core" - core2core core_cmds desugared rules >>= \ (simplified, imp_rule_ids) -> + core2core core_cmds desugared rules >>= \ (simplified, orphan_rules) -> -- Do the final tidy-up tidyCorePgm tidy_uniqs this_mod - simplified imp_rule_ids >>= \ (tidy_binds, tidy_imp_rule_ids) -> + simplified orphan_rules >>= \ (tidy_binds, tidy_orphan_rules) -> -------------------------- Convert to STG code ------------------------------- @@ -186,8 +188,8 @@ doIt (core_cmds, stg_cmds) -- simplifier, which for reasons I don't understand, persists -- thoroughout code generation - ifaceDecls if_handle local_tycons local_classes - inst_info final_ids tidy_binds imp_rule_ids >> + ifaceDecls if_handle local_tycons local_classes inst_info + final_ids tidy_binds tidy_orphan_rules deprecations >> endIface if_handle >> -- We are definitely done w/ interface-file stuff at this point: -- (See comments near call to "startIface".) @@ -198,6 +200,7 @@ doIt (core_cmds, stg_cmds) _scc_ "CodeGen" codeGen this_mod imported_modules cost_centre_info + fe_binders local_tycons local_classes stg_binds2 >>= \ abstractC -> @@ -205,7 +208,9 @@ doIt (core_cmds, stg_cmds) -------------------------- Code output ------------------------------- show_pass "CodeOutput" >> _scc_ "CodeOutput" - codeOutput this_mod c_code h_code abstractC ncg_uniqs >> + codeOutput this_mod local_tycons local_classes stg_binds2 + c_code h_code abstractC + ncg_uniqs >> -------------------------- Final report ------------------------------- @@ -222,7 +227,7 @@ doIt (core_cmds, stg_cmds) then \ what -> hPutStr stderr ("*** "++what++":\n") else \ what -> return () -ppSourceStats short (HsModule name version exports imports decls src_loc) +ppSourceStats short (HsModule name version exports imports decls _ src_loc) = (if short then hcat else vcat) (map pp_val [("ExportAll ", export_all), -- 1 if no export list @@ -329,7 +334,7 @@ ppSourceStats short (HsModule name version exports imports decls src_loc) = (length constrs, case derivs of {Nothing -> 0; Just ds -> length ds}) data_info other = (0,0) - class_info (ClassDecl _ _ _ meth_sigs def_meths _ _ _ _ _) + class_info (ClassDecl _ _ _ _ meth_sigs def_meths _ _ _ _ _ _) = case count_sigs meth_sigs of (_,classops,_,_) -> (classops, addpr (count_monobinds def_meths))