Commit baa3f2a9 authored by simonmar's avatar simonmar

[project @ 2000-12-12 17:19:33 by simonmar]

Oops!  Don't forget to remove type variables from the binders of a
case alternative when converting to STG.
parent fbf965da
......@@ -407,16 +407,20 @@ coreToStgExpr (Case scrut bndr alts)
returnLne ((lit, rhs2), rhs_fvs, rhs_escs)
vars_alg_alt (DataAlt con, binders, rhs)
= extendVarEnvLne [(b, CaseBound) | b <- binders] $
= let
-- remove type variables
binders' = filter isId binders
in
extendVarEnvLne [(b, CaseBound) | b <- binders'] $
coreToStgExpr rhs `thenLne` \ (rhs2, rhs_fvs, rhs_escs) ->
let
good_use_mask = [ b `elementOfFVInfo` rhs_fvs | b <- binders ]
good_use_mask = [ b `elementOfFVInfo` rhs_fvs | b <- binders' ]
-- records whether each param is used in the RHS
in
returnLne (
(con, binders, good_use_mask, rhs2),
rhs_fvs `minusFVBinders` binders,
rhs_escs `minusVarSet` mkVarSet binders
(con, binders', good_use_mask, rhs2),
rhs_fvs `minusFVBinders` binders',
rhs_escs `minusVarSet` mkVarSet binders'
-- ToDo: remove the minusVarSet;
-- since escs won't include any of these binders
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment