X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcprAnalysis%2FCprAnalyse.lhs;h=cbc28442ea2faf5dc132170e6c17c7a95a87520c;hb=abbc5a0be1df84a33015470319062ed7a3aa3153;hp=ecba6770cb02604be70a8510a6e5215ea8bfd6f8;hpb=d364541154457a49e3c35d671d7a1b57c9c4cca3;p=ghc-hetmet.git diff --git a/ghc/compiler/cprAnalysis/CprAnalyse.lhs b/ghc/compiler/cprAnalysis/CprAnalyse.lhs index ecba677..cbc2844 100644 --- a/ghc/compiler/cprAnalysis/CprAnalyse.lhs +++ b/ghc/compiler/cprAnalysis/CprAnalyse.lhs @@ -2,16 +2,21 @@ constructed product result} \begin{code} +#ifndef OLD_STRICTNESS +module CprAnalyse ( ) where + +#else + module CprAnalyse ( cprAnalyse ) where #include "HsVersions.h" -import CmdLineOpts ( DynFlags, DynFlag(..), dopt ) +import CmdLineOpts ( DynFlags, DynFlag(..) ) import CoreLint ( showPass, endPass ) import CoreSyn import CoreUtils ( exprIsValue ) import Id ( Id, setIdCprInfo, idCprInfo, idArity, - isBottomingId, idDemandInfo ) + isBottomingId, idDemandInfo, isImplicitId ) import IdInfo ( CprInfo(..) ) import Demand ( isStrict ) import VarEnv @@ -91,10 +96,6 @@ data AbsVal = Top -- Not a constructed product -- we could use appropriate Tuple Vals deriving (Eq,Show) -isFun :: AbsVal -> Bool -isFun (Fun _) = True -isFun _ = False - -- For pretty debugging instance Outputable AbsVal where ppr Top = ptext SLIT("Top") @@ -155,6 +156,9 @@ with ids decorated with their CPR info. -- Return environment extended with info from this binding cprAnalBind :: CPREnv -> CoreBind -> (CPREnv, CoreBind) cprAnalBind rho (NonRec b e) + | isImplicitId b -- Don't touch the CPR info on constructors, selectors etc + = (rho, NonRec b e) + | otherwise = (extendVarEnv rho b absval, NonRec b' e') where (e', absval) = cprAnalExpr rho e @@ -307,4 +311,5 @@ getCprAbsVal v = case idCprInfo v of arity = idArity v -- Imported (non-nullary) constructors will have the CPR property -- in their IdInfo, so no need to look at their unfolding +#endif /* OLD_STRICTNESS */ \end{code}