X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcoreSyn%2FCorePrep.lhs;h=757d7da3a565ec0411ae85e05808706364972998;hb=4c38417c48af875afa5afbc996fcb53004a50209;hp=c8f35ea32289b4a7824d7e6da393f6fbbf476f29;hpb=f94350a049d2a1c2b2f1aa25c62dfe20a541c049;p=ghc-hetmet.git diff --git a/compiler/coreSyn/CorePrep.lhs b/compiler/coreSyn/CorePrep.lhs index c8f35ea..757d7da 100644 --- a/compiler/coreSyn/CorePrep.lhs +++ b/compiler/coreSyn/CorePrep.lhs @@ -1,42 +1,45 @@ % -% (c) The University of Glasgow, 1994-2000 +% (c) The University of Glasgow, 1994-2006 % -\section{Core pass to saturate constructors and PrimOps} + +Core pass to saturate constructors and PrimOps \begin{code} +{-# OPTIONS -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings +-- for details + module CorePrep ( corePrepPgm, corePrepExpr ) where #include "HsVersions.h" -import CoreUtils( exprType, exprIsHNF, etaExpand, exprArity, exprOkForSpeculation ) -import CoreFVs ( exprFreeVars ) -import CoreLint ( endPass ) +import CoreUtils hiding (exprIsTrivial) +import CoreFVs +import CoreLint import CoreSyn -import Type ( Type, applyTy, - splitFunTy_maybe, isUnLiftedType, isUnboxedTupleType, seqType ) -import Coercion ( coercionKind ) -import TyCon ( TyCon, tyConDataCons ) -import NewDemand ( Demand, isStrictDmd, lazyDmd, StrictSig(..), DmdType(..) ) -import Var ( Var, Id, setVarUnique ) +import Type +import Coercion +import TyCon +import NewDemand +import Var import VarSet import VarEnv -import Id ( mkSysLocal, idType, idNewDemandInfo, idArity, setIdUnfolding, - isFCallId, isGlobalId, isLocalId, hasNoBinding, idNewStrictness, - isPrimOpId_maybe - ) -import DataCon ( dataConWorkId ) -import PrimOp ( PrimOp( DataToTagOp ) ) -import BasicTypes ( TopLevelFlag(..), isTopLevel, isNotTopLevel, - RecFlag(..), isNonRec - ) +import Id +import IdInfo +import DataCon +import PrimOp +import BasicTypes import UniqSupply import Maybes import OrdList import ErrUtils import DynFlags -import Util ( listLengthCmp ) +import Util import Outputable \end{code} @@ -385,6 +388,12 @@ corePrepExprFloat env (Note n@(SCC _) expr) deLamFloat expr1 `thenUs` \ (floats, expr2) -> returnUs (floats, Note n expr2) +corePrepExprFloat env (Case (Var id) bndr ty [(DEFAULT,[],expr)]) + | Just (TickBox {}) <- isTickBoxOp_maybe id + = corePrepAnExpr env expr `thenUs` \ expr1 -> + deLamFloat expr1 `thenUs` \ (floats, expr2) -> + return (floats, Case (Var id) bndr ty [(DEFAULT,[],expr2)]) + corePrepExprFloat env (Note other_note expr) = corePrepExprFloat env expr `thenUs` \ (floats, expr') -> returnUs (floats, Note other_note expr')