)
where
+import BlockId
import Cmm
-import CmmExpr
import CmmUtils
import MachOp
import CLabel
instance Outputable LocalReg where
ppr e = pprLocalReg e
+instance Outputable Area where
+ ppr e = pprArea e
+
instance Outputable GlobalReg where
ppr e = pprGlobalReg 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
= 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
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