diff options
Diffstat (limited to 'compiler/GHC/Cmm.hs')
-rw-r--r-- | compiler/GHC/Cmm.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/GHC/Cmm.hs b/compiler/GHC/Cmm.hs index d93b885e9e..a5b3b35b8b 100644 --- a/compiler/GHC/Cmm.hs +++ b/compiler/GHC/Cmm.hs @@ -266,9 +266,16 @@ newtype ListGraph i instance Outputable instr => Outputable (ListGraph instr) where ppr (ListGraph blocks) = vcat (map ppr blocks) +instance OutputableP instr => OutputableP (ListGraph instr) where + pdoc platform g = ppr (fmap (pdoc platform) g) + + instance Outputable instr => Outputable (GenBasicBlock instr) where ppr = pprBBlock +instance OutputableP instr => OutputableP (GenBasicBlock instr) where + pdoc platform block = ppr (fmap (pdoc platform) block) + pprBBlock :: Outputable stmt => GenBasicBlock stmt -> SDoc pprBBlock (BasicBlock ident stmts) = hang (ppr ident <> colon) 4 (vcat (map ppr stmts)) |