import CoreSyn
import Id ( idType, addIdStrictness, isWrapperId,
getIdDemandInfo, addIdDemandInfo,
- GenId{-instance Outputable-}
+ GenId{-instance Outputable-}, SYN_IE(Id)
)
import IdInfo ( mkStrictnessInfo, mkBottomStrictnessInfo,
mkDemandInfo, willBeDemanded, DemandInfo
import PprCore ( pprCoreBinding, pprBigCoreBinder )
import PprStyle ( PprStyle(..) )
import PprType ( GenType{-instance Outputable-}, GenTyVar{-ditto-} )
-import Pretty ( ppBesides, ppStr, ppInt, ppChar, ppAboves )
+import Pretty ( Doc, hcat, ptext, int, char, vcat )
import SaAbsInt
import SaLib
import TyVar ( GenTyVar{-instance Eq-} )
import WorkWrap -- "back-end" of strictness analyser
import Unique ( Unique{-instance Eq -} )
+import UniqSupply ( UniqSupply )
import Util ( zipWith4Equal, pprTrace, panic )
\end{code}
in
-- possibly show what we decided about strictness...
(if opt_D_dump_stranal
- then pprTrace "Strictness:\n" (ppAboves (
+ then pprTrace "Strictness:\n" (vcat (
map (pprCoreBinding PprDebug) binds_w_strictness))
else id
)
where
pp_stats (SaStats tlam dlam tc dc tlet dlet)
= pprTrace "Binders marked demanded: "
- (ppBesides [ppStr "Lambda vars: ", ppInt IBOX(dlam), ppChar '/', ppInt IBOX(tlam),
- ppStr "; Case vars: ", ppInt IBOX(dc), ppChar '/', ppInt IBOX(tc),
- ppStr "; Let vars: ", ppInt IBOX(dlet), ppChar '/', ppInt IBOX(tlet)
+ (hcat [ptext SLIT("Lambda vars: "), int IBOX(dlam), char '/', int IBOX(tlam),
+ ptext SLIT("; Case vars: "), int IBOX(dc), char '/', int IBOX(tc),
+ ptext SLIT("; Let vars: "), int IBOX(dlet), char '/', int IBOX(tlet)
])
#endif
\end{code}
addStrictnessInfoToId strflags str_val abs_val binder body
-{- SCHEDULED FOR NUKING
- | isWrapperId binder
- = binder -- Avoid clobbering existing strictness info
- -- (and, more importantly, worker info).
- -- Deeply suspicious (SLPJ)
--}
-
| isBot str_val
= binder `addIdStrictness` mkBottomStrictnessInfo
| otherwise
- = case (collectBinders body) of { (_, _, lambda_bounds, rhs) ->
- let
- tys = map idType lambda_bounds
- strictness = findStrictness strflags tys str_val abs_val
- in
- binder `addIdStrictness` mkStrictnessInfo strictness Nothing
- }
+ = case (collectBinders body) of
+ (_, _, [], rhs) -> binder
+ (_, _, lambda_bounds, rhs) -> binder `addIdStrictness`
+ mkStrictnessInfo strictness Nothing
+ where
+ tys = map idType lambda_bounds
+ strictness = findStrictness strflags tys str_val abs_val
\end{code}
\begin{code}