X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcoreSyn%2FCoreUtils.lhs;h=ab99d49a644d76cc52fe3a7b01d7e9508ec1e695;hb=0171936c9092666692c69a7f93fa75af976330cb;hp=4e61e8304e738756482fdf3ca4d16c016d9f36ca;hpb=51666a19707f4ca34eec28a14bffbbc7d642e647;p=ghc-hetmet.git diff --git a/ghc/compiler/coreSyn/CoreUtils.lhs b/ghc/compiler/coreSyn/CoreUtils.lhs index 4e61e83..ab99d49 100644 --- a/ghc/compiler/coreSyn/CoreUtils.lhs +++ b/ghc/compiler/coreSyn/CoreUtils.lhs @@ -48,16 +48,15 @@ import Name ( hashName ) import Literal ( hashLiteral, literalType, litIsDupable, isZeroLit ) import DataCon ( DataCon, dataConRepArity, dataConArgTys, isExistentialDataCon, dataConTyCon ) import PrimOp ( PrimOp(..), primOpOkForSpeculation, primOpIsCheap ) -import Id ( Id, idType, globalIdDetails, idNewStrictness, idLBVarInfo, +import Id ( Id, idType, globalIdDetails, idNewStrictness, mkWildId, idArity, idName, idUnfolding, idInfo, isOneShotLambda, isDataConId_maybe, mkSysLocal, isDataConId, isBottomingId ) -import IdInfo ( LBVarInfo(..), - GlobalIdDetails(..), +import IdInfo ( GlobalIdDetails(..), megaSeqIdInfo ) import NewDemand ( appIsBottom ) import Type ( Type, mkFunTy, mkForAllTy, splitFunTy_maybe, splitFunTy, - applyTys, isUnLiftedType, seqType, mkUTy, mkTyVarTy, + applyTys, isUnLiftedType, seqType, mkTyVarTy, splitForAllTy_maybe, isForAllTy, splitNewType_maybe, splitTyConApp_maybe, eqType, funResultTy, applyTy, funResultTy, applyTy @@ -111,12 +110,8 @@ mkPiTypes :: [Var] -> Type -> Type -- doesn't work... mkPiTypes vs ty = foldr mkPiType ty vs mkPiType v ty - | isId v = add_usage (mkFunTy (idType v) ty) + | isId v = mkFunTy (idType v) ty | otherwise = mkForAllTy v ty - where - add_usage ty = case idLBVarInfo v of - LBVarInfo u -> mkUTy u ty - otherwise -> ty \end{code} \begin{code} @@ -868,7 +863,7 @@ eta_expand n us expr ty case splitFunTy_maybe ty of { Just (arg_ty, res_ty) -> Lam arg1 (eta_expand (n-1) us2 (App expr (Var arg1)) res_ty) where - arg1 = mkSysLocal SLIT("eta") uniq arg_ty + arg1 = mkSysLocal FSLIT("eta") uniq arg_ty (uniq:us2) = us ; Nothing -> @@ -1019,7 +1014,7 @@ coreBindsSize bs = foldr ((+) . bindSize) 0 bs exprSize :: CoreExpr -> Int -- A measure of the size of the expressions -- It also forces the expression pretty drastically as a side effect -exprSize (Var v) = varSize v +exprSize (Var v) = v `seq` 1 exprSize (Lit lit) = lit `seq` 1 exprSize (App f a) = exprSize f + exprSize a exprSize (Lam b e) = varSize b + exprSize e