X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FsimplCore%2FSimplEnv.lhs;h=5049a9fdc933ad78a9a203224537ec5a066b8e27;hb=f25b9225f77ca8aa097a9acb4b5be27daea94891;hp=5f6dca28d4c17e6182789291579b72ed3351d953;hpb=04612d54b51bebf809717d1cf0242efb6294ee59;p=ghc-hetmet.git diff --git a/ghc/compiler/simplCore/SimplEnv.lhs b/ghc/compiler/simplCore/SimplEnv.lhs index 5f6dca2..5049a9f 100644 --- a/ghc/compiler/simplCore/SimplEnv.lhs +++ b/ghc/compiler/simplCore/SimplEnv.lhs @@ -46,6 +46,7 @@ import IdInfo ( IdInfo, vanillaIdInfo, occInfo, setOccInfo, specInfo, setSpecIn unknownArity, workerExists ) import CoreSyn +import Unify ( TypeRefinement ) import Rules ( RuleBase ) import CoreUtils ( needsCaseBinding ) import CostCentre ( CostCentreStack, subsumedCCS ) @@ -308,22 +309,19 @@ Given an idempotent substitution, generated by the unifier, use it to refine the environment \begin{code} -refineSimplEnv :: SimplEnv -> TvSubstEnv -> [OutTyVar] -> SimplEnv +refineSimplEnv :: SimplEnv -> TypeRefinement -> SimplEnv -- The TvSubstEnv is the refinement, and it refines OutTyVars into OutTypes refineSimplEnv env@(SimplEnv { seTvSubst = tv_subst, seInScope = in_scope }) - refine_tv_subst tvs + (refine_tv_subst, all_bound_here) = env { seTvSubst = composeTvSubst in_scope refine_tv_subst tv_subst, seInScope = in_scope' } where in_scope' - | all bound_here (varEnvKeys refine_tv_subst) = in_scope + | all_bound_here = in_scope -- The tvs are the tyvars bound here. If only they -- are refined, there's no need to do anything | otherwise = mapInScopeSet refine_id in_scope - bound_here uniq = elemVarSetByKey uniq tv_set - tv_set = mkVarSet tvs - refine_id v -- Only refine its type; any rules will get -- refined if they are used (I hope) | isId v = setIdType v (Type.substTy refine_subst (idType v))