X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fstranal%2FSaLib.lhs;h=72b3ebbc862324789ebb3e8d3dd734105d73643c;hb=cd0f89a0bf35c36575ea89d7c7599473a3600683;hp=9135e87ee3cbca992d34f2969e9be50d0e48ca06;hpb=7e602b0a11e567fcb035d1afd34015aebcf9a577;p=ghc-hetmet.git diff --git a/ghc/compiler/stranal/SaLib.lhs b/ghc/compiler/stranal/SaLib.lhs index 9135e87..72b3ebb 100644 --- a/ghc/compiler/stranal/SaLib.lhs +++ b/ghc/compiler/stranal/SaLib.lhs @@ -6,6 +6,10 @@ See also: the ``library'' for the ``back end'' (@SaBackLib@). \begin{code} +#ifndef OLD_STRICTNESS +module SaLib () where +#else + module SaLib ( AbsVal(..), AnalysisKind(..), @@ -18,11 +22,10 @@ module SaLib ( #include "HsVersions.h" -import Id ( Id ) -import CoreSyn ( CoreExpr ) +import Type ( Type ) import VarEnv import IdInfo ( StrictnessInfo(..) ) -import Demand ( Demand, pprDemands ) +import Demand ( Demand ) import Outputable \end{code} @@ -38,7 +41,7 @@ import Outputable data AnalysisKind = StrAnal -- We're doing strictness analysis | AbsAnal -- We're doing absence analysis - deriving Text + deriving Show \end{code} @AbsVal@ is the data type of HNF abstract values. @@ -58,9 +61,8 @@ data AbsVal -- AbsProd [AbsBot, ..., AbsBot] | AbsFun -- An abstract function, with the given: - Id -- argument - CoreExpr -- body - AbsValEnv -- and environment + Type -- Type of the *argument* to the function + (AbsVal -> AbsVal) -- The function | AbsApproxFun -- This is used to represent a coarse [Demand] -- approximation to a function value. It's an @@ -81,12 +83,9 @@ instance Outputable AbsVal where ppr AbsTop = ptext SLIT("AbsTop") ppr AbsBot = ptext SLIT("AbsBot") ppr (AbsProd prod) = hsep [ptext SLIT("AbsProd"), ppr prod] - ppr (AbsFun arg body env) - = hsep [ptext SLIT("AbsFun{"), ppr arg, - ptext SLIT("???"), -- text "}{env:", ppr (keysFM env `zip` eltsFM env), - char '}' ] + ppr (AbsFun bndr_ty body) = ptext SLIT("AbsFun") ppr (AbsApproxFun demands val) - = hsep [ptext SLIT("AbsApprox "), hcat (map ppr demands), ppr val] + = ptext SLIT("AbsApprox") <+> brackets (interpp'SP demands) <+> ppr val \end{code} %----------- @@ -115,7 +114,7 @@ lookupAbsValEnv (AbsValEnv idenv) y absValFromStrictness :: AnalysisKind -> StrictnessInfo -> AbsVal absValFromStrictness anal NoStrictnessInfo = AbsTop -absValFromStrictness anal (StrictnessInfo args_info bot_result _) +absValFromStrictness anal (StrictnessInfo args_info bot_result) = case args_info of -- Check the invariant that the arg list on [] -> res -- AbsApproxFun is non-empty _ -> AbsApproxFun args_info res @@ -125,3 +124,7 @@ absValFromStrictness anal (StrictnessInfo args_info bot_result _) StrAnal -> AbsBot AbsAnal -> AbsTop \end{code} + +\begin{code} +#endif /* OLD_STRICTNESS */ +\end{code}