X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FPprCmm.hs;h=43f39353afa8c21ead7c11ba1872febcbceefd72;hb=2f12b0ddeac0b1ac924dea52aef1ab5815802c78;hp=5f5ae553ebf202364ef769328d7e35c46464a08b;hpb=75879a1e1a0a22d3a7218efd71017af724262704;p=ghc-hetmet.git diff --git a/compiler/cmm/PprCmm.hs b/compiler/cmm/PprCmm.hs index 5f5ae55..43f3935 100644 --- a/compiler/cmm/PprCmm.hs +++ b/compiler/cmm/PprCmm.hs @@ -40,7 +40,7 @@ -- module PprCmm - ( writeCmms, pprCmms, pprCmm, pprStmt, pprExpr, pprSection, pprStatic + ( writeCmms, pprCmms, pprCmm, pprStmt, pprExpr, pprSection, pprStatic, pprLit ) where @@ -71,8 +71,8 @@ writeCmms handle cmms = printForC handle (pprCmms cmms) ----------------------------------------------------------------------------- -instance (Outputable info, Outputable g) - => Outputable (GenCmm CmmStatic info g) where +instance (Outputable d, Outputable info, Outputable g) + => Outputable (GenCmm d info g) where ppr c = pprCmm c instance (Outputable d, Outputable info, Outputable i) @@ -110,7 +110,7 @@ instance Outputable CmmInfo where ----------------------------------------------------------------------------- -pprCmm :: (Outputable info, Outputable g) => GenCmm CmmStatic info g -> SDoc +pprCmm :: (Outputable d, Outputable info, Outputable g) => GenCmm d info g -> SDoc pprCmm (Cmm tops) = vcat $ intersperse (text "") $ map pprTop tops -- -------------------------------------------------------------------------- @@ -284,7 +284,7 @@ genCondBranch expr ident = -- -- jump foo(a, b, c); -- -genJump :: CmmExpr -> [(CmmExpr, MachHint)] -> SDoc +genJump :: CmmExpr -> [CmmHinted CmmExpr] -> SDoc genJump expr args = hcat [ ptext SLIT("jump") @@ -298,18 +298,18 @@ genJump expr 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 +pprHinted :: Outputable a => (CmmHinted a) -> SDoc +pprHinted (CmmHinted a NoHint) = ppr a +pprHinted (CmmHinted a PtrHint) = quotes(text "address") <+> ppr a +pprHinted (CmmHinted a SignedHint) = quotes(text "signed") <+> ppr a +pprHinted (CmmHinted a FloatHint) = quotes(text "float") <+> ppr a -- -------------------------------------------------------------------------- -- Return from a function. [1], Section 6.8.2 of version 1.128 -- -- return (a, b, c); -- -genReturn :: [(CmmExpr, MachHint)] -> SDoc +genReturn :: [CmmHinted CmmExpr] -> SDoc genReturn args = hcat [ ptext SLIT("return") @@ -572,4 +572,3 @@ pprBlockId b = ppr $ getUnique b commafy :: [SDoc] -> SDoc commafy xs = hsep $ punctuate comma xs -