[commit: ghc] wip/nested-cpr: Mark the scrunitee of a multi-way-case as converging (ca937b3)
git at git.haskell.org
git at git.haskell.org
Fri Jan 17 23:49:50 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nested-cpr
Link : http://ghc.haskell.org/trac/ghc/changeset/ca937b392d78deaae94ee564aaacd233730d0dad/ghc
>---------------------------------------------------------------
commit ca937b392d78deaae94ee564aaacd233730d0dad
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
>---------------------------------------------------------------
ca937b392d78deaae94ee564aaacd233730d0dad
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