X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FTidyPgm.lhs;h=6b89b33fb3ed1478eef2934106779cd01b4616e4;hp=a8dede8aa16443f16bc8e50e5fc5f00b291931ca;hb=e5f78a4a5309b598d5195aa49a0bf7a206942cea;hpb=8100cd4395e46ae747be4298c181a4730d6206bc diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs index a8dede8..6b89b33 100644 --- a/compiler/main/TidyPgm.lhs +++ b/compiler/main/TidyPgm.lhs @@ -32,7 +32,7 @@ import Name ( Name, getOccName, nameOccName, mkInternalName, localiseName, isExternalName, nameSrcLoc, isWiredInName, getName ) -import NameSet ( NameSet, elemNameSet ) +import NameSet ( NameSet, elemNameSet, filterNameSet ) import IfaceEnv ( allocateGlobalBinder ) import NameEnv ( filterNameEnv, mapNameEnv ) import OccName ( TidyOccEnv, initTidyOccEnv, tidyOccName ) @@ -124,7 +124,9 @@ mkBootModDetails hsc_env (ModGuts { mg_module = mod , mg_exports = exports , mg_types = type_env , mg_insts = insts - , mg_fam_insts = fam_insts }) + , mg_fam_insts = fam_insts + , mg_modBreaks = modBreaks + }) = do { let dflags = hsc_dflags hsc_env ; showPass dflags "Tidy [hoot] type env" @@ -138,7 +140,10 @@ mkBootModDetails hsc_env (ModGuts { mg_module = mod , md_insts = insts' , md_fam_insts = fam_insts , md_rules = [] - , md_exports = exports }) + , md_exports = exports + , md_modBreaks = modBreaks + , md_vect_info = noVectInfo + }) } where @@ -239,9 +244,11 @@ tidyProgram hsc_env mg_insts = insts, mg_fam_insts = fam_insts, mg_binds = binds, mg_rules = imp_rules, + mg_vect_info = vect_info, mg_dir_imps = dir_imps, mg_deps = deps, mg_foreign = foreign_stubs, - mg_hpc_info = hpc_info }) + mg_hpc_info = hpc_info, + mg_modBreaks = modBreaks }) = do { let dflags = hsc_dflags hsc_env ; showPass dflags "Tidy Core" @@ -280,6 +287,12 @@ tidyProgram hsc_env ; implicit_binds = getImplicitBinds type_env ; all_tidy_binds = implicit_binds ++ tidy_binds ; alg_tycons = filter isAlgTyCon (typeEnvTyCons type_env) + + ; tidy_vect_info = VectInfo + (filterNameSet (isElemId type_env) + (vectInfoCCVar vect_info)) + -- filter against `type_env', not `tidy_type_env', as we must + -- keep all implicit names } ; endPass dflags "Tidy Core" Opt_D_dump_simpl all_tidy_binds @@ -299,7 +312,10 @@ tidyProgram hsc_env md_rules = tidy_rules, md_insts = tidy_insts, md_fam_insts = fam_insts, - md_exports = exports }) + md_exports = exports, + md_modBreaks = modBreaks, + md_vect_info = tidy_vect_info + }) } lookup_dfun type_env dfun_id @@ -307,6 +323,11 @@ lookup_dfun type_env dfun_id Just (AnId dfun_id') -> dfun_id' other -> pprPanic "lookup_dfun" (ppr dfun_id) +isElemId type_env name + = case lookupTypeEnv type_env name of + Just (AnId _) -> True + _ -> False + tidyTypeEnv :: Bool -> NameSet -> TypeEnv -> [CoreBind] -> TypeEnv -- The competed type environment is gotten from