X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FcoreSyn%2FCoreFVs.lhs;h=3ff583ee2006c02f5a2c3c1ab2f43f80b1be685c;hp=f94f61d25ebd30ea2a1fd0578de933deb5b7a283;hb=6a944ae7fe1e8e2e456c68717188463263f8978f;hpb=72462499b891d5779c19f3bda03f96e24f9554ae diff --git a/compiler/coreSyn/CoreFVs.lhs b/compiler/coreSyn/CoreFVs.lhs index f94f61d..3ff583e 100644 --- a/compiler/coreSyn/CoreFVs.lhs +++ b/compiler/coreSyn/CoreFVs.lhs @@ -416,8 +416,11 @@ idRuleRhsVars id = foldr (unionVarSet . ruleRhsFreeVars) idUnfoldingVars :: Id -> VarSet -- Produce free vars for an unfolding, but NOT for an ordinary -- (non-inline) unfolding, since it is a dup of the rhs +-- and we'll get exponential behaviour if we look at both unf and rhs! +-- But do look at the *real* unfolding, even for loop breakers, else +-- we might get out-of-scope variables idUnfoldingVars id - = case idUnfolding id of + = case realIdUnfolding id of CoreUnfolding { uf_tmpl = rhs, uf_guidance = InlineRule {} } -> exprFreeVars rhs DFunUnfolding _ args -> exprsFreeVars args