[commit: ghc] wip/nested-cpr: Mark the scrunitee of a multi-way-case as converging (fa49a3b)
git at git.haskell.org
git at git.haskell.org
Wed Jan 15 18:06:59 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nested-cpr
Link : http://ghc.haskell.org/trac/ghc/changeset/fa49a3b1b7033c618bc468694e07be579612f1f4/ghc
>---------------------------------------------------------------
commit fa49a3b1b7033c618bc468694e07be579612f1f4
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Fri Jan 10 13:45:39 2014 +0000
Mark the scrunitee of a multi-way-case as converging
>---------------------------------------------------------------
fa49a3b1b7033c618bc468694e07be579612f1f4
compiler/stranal/DmdAnal.lhs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs
index 310c013..7bfc7b2 100644
--- a/compiler/stranal/DmdAnal.lhs
+++ b/compiler/stranal/DmdAnal.lhs
@@ -275,7 +275,9 @@ dmdAnal env dmd (Case scrut case_bndr ty [alt@(DataAlt dc, _, _)])
dmdAnal env dmd (Case scrut case_bndr ty alts)
= let -- Case expression with multiple alternatives
- (alt_tys, alts') = mapAndUnzip (dmdAnalAlt env dmd) alts
+ case_bndr_sig = convergeSig nopSig
+ env_alt = extendAnalEnv NotTopLevel env case_bndr case_bndr_sig
+ (alt_tys, alts') = mapAndUnzip (dmdAnalAlt env_alt dmd) alts
(scrut_ty, scrut') = dmdAnal env cleanEvalDmd scrut
(alt_ty, case_bndr') = annotateBndr env (lubDmdTypes alt_tys) case_bndr
res_ty = alt_ty `bothDmdType` toBothDmdArg scrut_ty
More information about the ghc-commits
mailing list