X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FsimplCore%2FSimplUtils.lhs;h=ebe4083a0a3a2629601df3bf2f35a38187c7a15e;hb=8912a05e1bcc30c7e8e5e017d9cf10176076f141;hp=4b6c4a347cb0ad0e8ee0b2ebc32f5da42e9d25cd;hpb=99cf312c0bacfd96f7b2827bd3dc12aaa8fa920f;p=ghc-hetmet.git diff --git a/compiler/simplCore/SimplUtils.lhs b/compiler/simplCore/SimplUtils.lhs index 4b6c4a3..ebe4083 100644 --- a/compiler/simplCore/SimplUtils.lhs +++ b/compiler/simplCore/SimplUtils.lhs @@ -246,7 +246,9 @@ getContArgs chkr fun orig_cont where args = reverse acc hole_ty = applyTypeToArgs (Var fun) (idType fun) - [substExpr se arg | (arg,se,_) <- args] + [substExpr_mb se arg | (arg,se,_) <- args] + substExpr_mb Nothing arg = arg + substExpr_mb (Just se) arg = substExpr se arg ---------------------------- vanilla_stricts, computed_stricts :: [Bool] @@ -1137,27 +1139,6 @@ tryRhsTyLam env tyvars body -- Only does something if there's a let %* * %************************************************************************ -\begin{code} -mkDataConAlt :: DataCon -> [OutType] -> InExpr -> SimplM InAlt --- Make a data-constructor alternative to replace the DEFAULT case --- NB: there's something a bit bogus here, because we put OutTypes into an InAlt -mkDataConAlt con inst_tys rhs - = do { tv_uniqs <- getUniquesSmpl - ; arg_uniqs <- getUniquesSmpl - ; let tv_bndrs = zipWith mk_tv_bndr (dataConExTyVars con) tv_uniqs - arg_tys = dataConInstArgTys con (inst_tys ++ mkTyVarTys tv_bndrs) - arg_bndrs = zipWith mk_arg arg_tys arg_uniqs - ; return (DataAlt con, tv_bndrs ++ arg_bndrs, rhs) } - where - mk_arg arg_ty uniq -- Equality predicates get a TyVar - -- while dictionaries and others get an Id - | isEqPredTy arg_ty = mk_tv arg_ty uniq - | otherwise = mk_id arg_ty uniq - - mk_tv_bndr tv uniq = mk_tv (tyVarKind tv) uniq - mk_tv kind uniq = mkTyVar (mkSysTvName uniq FSLIT("t")) kind - mk_id ty uniq = mkSysLocal FSLIT("a") uniq ty -\end{code} mkCase puts a case expression back together, trying various transformations first. @@ -1489,7 +1470,7 @@ mkCase1 scrut case_bndr ty alts -- Identity case | isNewTyCon (dataConTyCon con) = wrapNewTypeBody (dataConTyCon con) arg_tys (varToCoreExpr $ head args) | otherwise - = pprTrace "mkCase1" (ppr con) $ mkConApp con (arg_ty_exprs ++ varsToCoreExprs args) + = mkConApp con (arg_ty_exprs ++ varsToCoreExprs args) identity_rhs (LitAlt lit) _ = Lit lit identity_rhs DEFAULT _ = Var case_bndr