Commit 7739836e authored by simonpj@microsoft.com's avatar simonpj@microsoft.com
Browse files

Pretty printing instance for Unfolding

parent 51b836e3
......@@ -36,7 +36,7 @@ import StaticFlags ( opt_UF_CreationThreshold, opt_UF_UseThreshold,
)
import DynFlags ( DynFlags, DynFlag(..), dopt )
import CoreSyn
import PprCore ( pprCoreExpr )
import PprCore () -- Instances
import OccurAnal ( occurAnalyseExpr )
import CoreUtils ( exprIsHNF, exprIsCheap, exprIsTrivial )
import Id ( Id, idType, isId,
......@@ -87,6 +87,14 @@ mkUnfolding top_lvl expr
-- This can occasionally mean that the guidance is very pessimistic;
-- it gets fixed up next round
instance Outputable Unfolding where
ppr NoUnfolding = ptext SLIT("No unfolding")
ppr (OtherCon cs) = ptext SLIT("OtherCon") <+> ppr cs
ppr (CompulsoryUnfolding e) = ptext SLIT("Compulsory") <+> ppr e
ppr (CoreUnfolding e top hnf cheap g)
= ptext SLIT("Unf") <+> sep [ppr top <+> ppr hnf <+> ppr cheap <+> ppr g,
ppr e]
mkCompulsoryUnfolding expr -- Used for things that absolutely must be unfolded
= CompulsoryUnfolding (occurAnalyseExpr expr)
\end{code}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment