X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FsimplCore%2FOccurAnal.lhs;h=4082fcc757a7a35d7eec4acf4fba6223d626bdae;hb=f37e239fb5e81fc493e0ea1af98178bf1f7ceaba;hp=8e199331e25cacb95c2f9fd753b55c1c790d693d;hpb=098d99aa2967cd35bdfe2a8c48ea8eee8ffd4f11;p=ghc-hetmet.git diff --git a/compiler/simplCore/OccurAnal.lhs b/compiler/simplCore/OccurAnal.lhs index 8e19933..4082fcc 100644 --- a/compiler/simplCore/OccurAnal.lhs +++ b/compiler/simplCore/OccurAnal.lhs @@ -455,6 +455,11 @@ occAnal env (Note note body) = case occAnal env body of { (usage, body') -> (usage, Note note body') } + +occAnal env (Cast expr co) + = case occAnal env expr of { (usage, expr') -> + (usage, Cast expr' co) + } \end{code} \begin{code} @@ -632,15 +637,22 @@ is rather like If e turns out to be (e1,e2) we indeed get something like let a = e1; b = e2; x = (a,b) in rhs +Note [Aug 06]: I don't think this is necessary any more, and it helpe + to know when binders are unused. See esp the call to + isDeadBinder in Simplify.mkDupableAlt + \begin{code} occAnalAlt env case_bndr (con, bndrs, rhs) = case occAnal env rhs of { (rhs_usage, rhs') -> let (final_usage, tagged_bndrs) = tagBinders rhs_usage bndrs + final_bndrs = tagged_bndrs -- See Note [Aug06] above +{- final_bndrs | case_bndr `elemVarEnv` final_usage = bndrs | otherwise = tagged_bndrs -- Leave the binders untagged if the case -- binder occurs at all; see note above +-} in (final_usage, (con, final_bndrs, rhs')) } \end{code}