X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcoreSyn%2FCoreFVs.lhs;h=d2d1383e2b4cc23b978938619e66970a0462073f;hb=980a3e89be93e2d40cc26ca626c8cbf293abb78c;hp=dedc4c06d337885bdec3fb16efbc96b36d9adc50;hpb=08409937537b9d4d8937e1d7264f6b238d350ccd;p=ghc-hetmet.git diff --git a/compiler/coreSyn/CoreFVs.lhs b/compiler/coreSyn/CoreFVs.lhs index dedc4c0..d2d1383 100644 --- a/compiler/coreSyn/CoreFVs.lhs +++ b/compiler/coreSyn/CoreFVs.lhs @@ -194,7 +194,7 @@ expr_fvs (Let (Rec pairs) body) --------- rhs_fvs :: (Id,CoreExpr) -> FV -rhs_fvs (bndr, rhs) = expr_fvs rhs `union` someVars (idRuleVars bndr) +rhs_fvs (bndr, rhs) = expr_fvs rhs `union` someVars (bndrRuleVars bndr) -- Treat any RULES as extra RHSs of the binding --------- @@ -373,6 +373,10 @@ varTypeTyVars var idFreeVars :: Id -> VarSet idFreeVars id = ASSERT( isId id) idRuleVars id `unionVarSet` varTypeTyVars id +bndrRuleVars ::Var -> VarSet +bndrRuleVars v | isTyVar v = emptyVarSet + | otherwise = idRuleVars v + idRuleVars ::Id -> VarSet idRuleVars id = ASSERT( isId id) specInfoFreeVars (idSpecialisation id) \end{code} @@ -425,7 +429,7 @@ freeVars (Case scrut bndr ty alts) rhs2 = freeVars rhs freeVars (Let (NonRec binder rhs) body) - = (freeVarsOf rhs2 `unionFVs` body_fvs `unionFVs` idRuleVars binder, + = (freeVarsOf rhs2 `unionFVs` body_fvs `unionFVs` bndrRuleVars binder, -- Remember any rules; cf rhs_fvs above AnnLet (AnnNonRec binder rhs2) body2) where