Rescue UsageSP analysis from bit-rot.
-- not safe to print or parse LBVarInfo because it is not really a
-- property of the definition, but a property of the context.
pprLBVarInfo NoLBVarInfo = empty
-pprLBVarInfo IsOneShotLambda = ptext SLIT("OneShot")
+pprLBVarInfo IsOneShotLambda = getPprStyle $ \ sty ->
+ if ifaceStyle sty then empty
+ else ptext SLIT("OneShot")
instance Outputable LBVarInfo where
ppr = pprLBVarInfo
import CoreUnfold ( noUnfolding )
import CoreLint ( beginPass, endPass )
import Rules ( ProtoCoreRule(..) )
+import UsageSPInf ( doUsageSPInf )
import VarEnv
import VarSet
import Var ( Id, IdOrTyVar )
import SrcLoc ( noSrcLoc )
import Util ( mapAccumL )
import Outputable
-
-doUsageSPInf = panic "doUsageSpInf"
\end{code}
`unionNameSets` extractHsTyNames_s tys
get (MonoFunTy ty1 ty2) = get ty1 `unionNameSets` get ty2
get (MonoDictTy cls tys) = unitNameSet cls `unionNameSets` extractHsTyNames_s tys
+ get (MonoUsgTy u ty) = get ty
get (MonoTyVar tv) = unitNameSet tv
get (HsForAllTy (Just tvs)
ctxt ty) = (extractHsCtxtTyNames ctxt `unionNameSets` get ty)
opt_UsageSPOn,
)
import CoreLint ( beginPass, endPass )
-import CoreTidy ( tidyCorePgm )
import CoreSyn
import CSE ( cseProgram )
import Rules ( RuleBase, ProtoCoreRule(..), pprProtoCoreRule, prepareRuleBase, orphanRule )
This code is (based on) PhD work of Keith Wansbrough <kw217@cl.cam.ac.uk>,
September 1998 .. May 1999.
-Keith Wansbrough 1998-09-04..1999-05-05
+Keith Wansbrough 1998-09-04..1999-06-25
\begin{code}
module UsageSPInf ( doUsageSPInf ) where
usgInfCE (Note InlineCall e) = usgInfCE e
+usgInfCE (Note InlineMe e) = usgInfCE e
+
usgInfCE (Note (TermUsg u) e) = pprTrace "usgInfCE: ignoring extra TermUsg:" (ppr u) $
usgInfCE e
This code is (based on) PhD work of Keith Wansbrough <kw217@cl.cam.ac.uk>,
September 1998 .. May 1999.
-Keith Wansbrough 1998-09-04..1999-05-03
+Keith Wansbrough 1998-09-04..1999-06-25
\begin{code}
module UsageSPLint ( doLintUSPAnnotsBinds,
checkCE (Note InlineCall e) (Note InlineCall e') = checkCE e e'
+checkCE (Note InlineMe e) (Note InlineMe e') = checkCE e e'
+
checkCE t@(Note (TermUsg u) e) t'@(Note (TermUsg u') e')
= checkCE e e'
`unionBags` (checkUsg u u' (WorseTerm t t'))
This code is (based on) PhD work of Keith Wansbrough <kw217@cl.cam.ac.uk>,
September 1998 .. May 1999.
-Keith Wansbrough 1998-09-04..1999-05-07
+Keith Wansbrough 1998-09-04..1999-06-25
\begin{code}
module UsageSPUtils ( AnnotM(AnnotM), initAnnotM,
go (Note InlineCall e) = do { e' <- go e
; return (Note InlineCall e')
}
+ go (Note InlineMe e) = do { e' <- go e
+ ; return (Note InlineMe e')
+ }
go e0@(Note (TermUsg _) _) = do { e1 <- mungeTerm e0
; case e1 of -- munge may have removed note
Note tu@(TermUsg _) e2 -> do { e3 <- go e2