X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcodeGen%2FCgExpr.lhs;h=8e8b5e276b7108e94554d69873248d7f6bce518a;hb=26b8a5b3feab9d556c92f495a6775acf8cf9f3ec;hp=90509f3646ae6e6faf5ed74126c01a8d57de0142;hpb=01e0566e61e4222600c7ba0a2d35d6102fd1afb5;p=ghc-hetmet.git diff --git a/ghc/compiler/codeGen/CgExpr.lhs b/ghc/compiler/codeGen/CgExpr.lhs index 90509f3..8e8b5e2 100644 --- a/ghc/compiler/codeGen/CgExpr.lhs +++ b/ghc/compiler/codeGen/CgExpr.lhs @@ -1,7 +1,7 @@ % % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 % -% $Id: CgExpr.lhs,v 1.37 2000/11/07 13:12:22 simonpj Exp $ +% $Id: CgExpr.lhs,v 1.40 2000/11/24 09:51:38 simonpj Exp $ % %******************************************************** %* * @@ -39,12 +39,11 @@ import ClosureInfo ( mkClosureLFInfo, mkSelectorLFInfo, import CostCentre ( sccAbleCostCentre, isSccCountCostCentre ) import Id ( idPrimRep, idType, Id ) import VarSet -import DataCon ( dataConTyCon ) import PrimOp ( primOpOutOfLine, getPrimOpResultInfo, PrimOp(..), PrimOpResultInfo(..) ) import PrimRep ( PrimRep(..), isFollowableRep ) import TyCon ( maybeTyConSingleCon, isUnboxedTupleTyCon, isEnumerationTyCon ) -import Type ( Type, typePrimRep, splitTyConApp_maybe, repType ) +import Type ( Type, typePrimRep, tyConAppArgs, tyConAppTyCon, repType ) import Maybes ( maybeToBool ) import ListSetOps ( assocMaybe ) import Unique ( mkBuiltinUnique ) @@ -143,7 +142,7 @@ cgExpr (StgPrimApp TagToEnumOp [arg] res_ty) -- -- That won't work. -- - (Just (tycon,_)) = splitTyConApp_maybe res_ty + tycon = tyConAppTyCon res_ty cgExpr x@(StgPrimApp op args res_ty) @@ -315,7 +314,7 @@ mkRhsClosure bndr cc bi srt [] -- A thunk body@(StgCase (StgApp scrutinee [{-no args-}]) _ _ _ _ -- ignore uniq, etc. - (StgAlgAlts case_ty + (StgAlgAlts (Just tycon) [(con, params, use_mask, (StgApp selectee [{-no args-}]))] StgNoDefault)) @@ -332,7 +331,6 @@ mkRhsClosure bndr cc bi srt Just the_offset = maybe_offset offset_into_int = the_offset - fixedHdrSize is_single_constructor = maybeToBool (maybeTyConSingleCon tycon) - tycon = dataConTyCon con \end{code} @@ -463,12 +461,10 @@ primRetUnboxedTuple op args res_ty allocate some temporaries for the return values. -} let - (tc,ty_args) = case splitTyConApp_maybe (repType res_ty) of - Nothing -> pprPanic "primRetUnboxedTuple" (ppr res_ty) - Just pr -> pr - prim_reps = map typePrimRep ty_args - temp_uniqs = map mkBuiltinUnique [ n_args .. n_args + length ty_args - 1] - temp_amodes = zipWith CTemp temp_uniqs prim_reps + ty_args = tyConAppArgs (repType res_ty) + prim_reps = map typePrimRep ty_args + temp_uniqs = map mkBuiltinUnique [ n_args .. n_args + length ty_args - 1] + temp_amodes = zipWith CTemp temp_uniqs prim_reps in returnUnboxedTuple temp_amodes (absC (COpStmt temp_amodes op arg_temps [])) \end{code}