X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fcmm%2FPprCmm.hs;h=dbfd20e424b678e11a5608f4e030154d23485332;hp=150ffb9d6ff9c180fe9b7714bd5361c983e31a64;hb=0d80489c9b9f2421f65d8dd86c1e50c6bb429715;hpb=724a9e83f9498382e3580d26a7dd7cd6b108408c diff --git a/compiler/cmm/PprCmm.hs b/compiler/cmm/PprCmm.hs index 150ffb9..dbfd20e 100644 --- a/compiler/cmm/PprCmm.hs +++ b/compiler/cmm/PprCmm.hs @@ -37,8 +37,8 @@ module PprCmm ) where +import BlockId import Cmm -import CmmExpr import CmmUtils import MachOp import CLabel @@ -91,6 +91,9 @@ instance Outputable CmmLit where instance Outputable LocalReg where ppr e = pprLocalReg e +instance Outputable Area where + ppr e = pprArea e + instance Outputable GlobalReg where ppr e = pprGlobalReg e @@ -435,7 +438,8 @@ pprExpr9 e = CmmLit lit -> pprLit1 lit CmmLoad expr rep -> ppr rep <> brackets( ppr expr ) CmmReg reg -> ppr reg - CmmRegOff reg off -> parens (ppr reg <+> char '+' <+> int off) + CmmRegOff reg off -> parens (ppr reg <+> char '+' <+> int off) + CmmStackSlot a off -> parens (ppr a <+> char '+' <+> int off) CmmMachOp mop args -> genMachOp mop args genMachOp :: MachOp -> [CmmExpr] -> SDoc @@ -525,7 +529,6 @@ pprReg r = case r of CmmLocal local -> pprLocalReg local CmmGlobal global -> pprGlobalReg global - CmmStack slot -> ppr slot -- -- We only print the type of the local reg if it isn't wordRep @@ -540,6 +543,12 @@ pprLocalReg (LocalReg uniq rep follow) then empty else doubleQuotes (text "ptr") +-- Stack areas +pprArea :: Area -> SDoc +pprArea (RegSlot r) = hcat [ text "slot<", ppr r, text ">" ] +pprArea (CallArea id n n') = + hcat [ text "callslot<", ppr id, char '+', ppr n, char '/', ppr n', text ">" ] + -- needs to be kept in syn with Cmm.hs.GlobalReg -- pprGlobalReg :: GlobalReg -> SDoc