[commit: ghc] wip/nested-cpr: Mark the scrunitee of a multi-way-case as converging (be33911)

git at git.haskell.org git at git.haskell.org
Tue Feb 4 18:26:45 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nested-cpr
Link       : http://ghc.haskell.org/trac/ghc/changeset/be339119cf15cb7ec6da88d777c7b3d42aebd18a/ghc

>---------------------------------------------------------------

commit be339119cf15cb7ec6da88d777c7b3d42aebd18a
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


>---------------------------------------------------------------

be339119cf15cb7ec6da88d777c7b3d42aebd18a
 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 9e19e8f..358b081 100644
--- a/compiler/stranal/DmdAnal.lhs
+++ b/compiler/stranal/DmdAnal.lhs
@@ -276,7 +276,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