--
module PprCmm
- ( writeCmms, pprCmms, pprCmm, pprStmt, pprExpr, pprSection, pprStatic
+ ( writeCmms, pprCmms, pprCmm, pprStmt, pprExpr, pprSection, pprStatic, pprLit
)
where
CmmLoad (CmmReg _) _ -> pprExpr expr
_ -> parens (pprExpr expr)
, space
- , parens ( commafy $ map ppr args )
+ , parens ( commafy $ map pprHinted args )
, semi ]
+pprHinted :: Outputable a => (a, MachHint) -> SDoc
+pprHinted (a, NoHint) = ppr a
+pprHinted (a, PtrHint) = quotes(text "address") <+> ppr a
+pprHinted (a, SignedHint) = quotes(text "signed") <+> ppr a
+pprHinted (a, FloatHint) = quotes(text "float") <+> ppr a
+
-- --------------------------------------------------------------------------
-- Return from a function. [1], Section 6.8.2 of version 1.128
--
pprLocalReg :: LocalReg -> SDoc
pprLocalReg (LocalReg uniq rep follow)
= hcat [ char '_', ppr uniq, ty ] where
- ty = if rep == wordRep && follow == KindNonPtr
+ ty = if rep == wordRep && follow == GCKindNonPtr
then empty
else dcolon <> ptr <> ppr rep
- ptr = if follow == KindNonPtr
+ ptr = if follow == GCKindNonPtr
then empty
else doubleQuotes (text "ptr")
commafy :: [SDoc] -> SDoc
commafy xs = hsep $ punctuate comma xs
-