X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FsimplCore%2FSetLevels.lhs;h=e74525d0349bb5eb3ad3f931048d2514c783be09;hb=9d38678ea60ff32f756390a30c659daa22c98c93;hp=2937890e93babfecbeb16ae8426e76731c179d3a;hpb=47a40c89ca2e588b62d986a58907e178bce1de4f;p=ghc-hetmet.git diff --git a/ghc/compiler/simplCore/SetLevels.lhs b/ghc/compiler/simplCore/SetLevels.lhs index 2937890..e74525d 100644 --- a/ghc/compiler/simplCore/SetLevels.lhs +++ b/ghc/compiler/simplCore/SetLevels.lhs @@ -663,7 +663,7 @@ cloneVar NotTopLevel (lvl_env, subst_env) v lvl let subst = mkSubst emptyVarSet subst_env v' = setVarUnique v uniq - v'' = apply_to_rules subst v' + v'' = modifyIdInfo (substIdInfo subst) v' subst_env' = extendSubstEnv subst_env v (DoneEx (Var v'')) lvl_env' = extendVarEnv lvl_env v lvl in @@ -672,20 +672,14 @@ cloneVar NotTopLevel (lvl_env, subst_env) v lvl cloneVars :: TopLevelFlag -> LevelEnv -> [Id] -> Level -> LvlM (LevelEnv, [Id]) cloneVars TopLevel env vs lvl = returnUs (env, vs) -- Don't clone top level things -cloneVars NotTopLevel (lvl_env, subst_env) vs lvl +cloneVars NotTopLevel (lvl_env, subst_env) vs lvl = getUniquesUs (length vs) `thenLvl` \ uniqs -> let subst = mkSubst emptyVarSet subst_env' vs' = zipWith setVarUnique vs uniqs - vs'' = map (apply_to_rules subst) vs' + vs'' = map (modifyIdInfo (substIdInfo subst)) vs' subst_env' = extendSubstEnvList subst_env vs [DoneEx (Var v'') | v'' <- vs''] lvl_env' = extendVarEnvList lvl_env (vs `zip` repeat lvl) in returnUs ((lvl_env', subst_env'), vs'') - --- Apply the substitution to the rules -apply_to_rules subst id - = modifyIdInfo go_spec id - where - go_spec info = info `setSpecInfo` substRules subst (specInfo info) \end{code}