X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FsimplCore%2FSimplify.lhs;h=b7084c8563516cc71208ca53b6e84e413e28199d;hp=106cd9d30b62aca2ec169c7e34bf3be571d0a9d6;hb=76dfa3944cbf149a30398d29e6762a44772c0174;hpb=c56450419ef6c819ad86ab01dca6fd2966b11305 diff --git a/compiler/simplCore/Simplify.lhs b/compiler/simplCore/Simplify.lhs index 106cd9d..b7084c8 100644 --- a/compiler/simplCore/Simplify.lhs +++ b/compiler/simplCore/Simplify.lhs @@ -671,15 +671,17 @@ simplUnfolding env _ _ _ _ (DFunUnfolding con ops) where ops' = map (CoreSubst.substExpr (mkCoreSubst env)) ops -simplUnfolding env top_lvl _ _ _ +simplUnfolding env top_lvl id _ _ (CoreUnfolding { uf_tmpl = expr, uf_arity = arity , uf_src = src, uf_guidance = guide }) | isInlineRuleSource src - = do { expr' <- simplExpr (updMode updModeForInlineRules env) expr - -- See Note [Simplifying gently inside InlineRules] in SimplUtils + = do { expr' <- simplExpr rule_env expr ; let src' = CoreSubst.substUnfoldingSource (mkCoreSubst env) src ; return (mkCoreUnfolding (isTopLevel top_lvl) src' expr' arity guide) } -- See Note [Top-level flag on inline rules] in CoreUnfold + where + rule_env = updMode (updModeForInlineRules (idInlineActivation id)) env + -- See Note [Simplifying gently inside InlineRules] in SimplUtils simplUnfolding _ top_lvl id _occ_info new_rhs _ = return (mkUnfolding (isTopLevel top_lvl) (isBottomingId id) new_rhs)