-{-# OPTIONS -Wall -fno-warn-name-shadowing -fno-warn-orphans #-}
-module PprCmmZ
- ( pprCmmGraph
+module PprCmmZ
+ ( pprCmmGraphLikeCmm
)
where
import CmmExpr
import PprCmm()
import Outputable
-import qualified ZipCfgCmm as G
+import qualified ZipCfgCmmRep as G
import qualified ZipCfg as Z
-import qualified ZipDataflow as DF
import CmmZipUtil
import UniqSet
import FastString
----------------------------------------------------------------
-instance DF.DebugNodes G.Middle G.Last
-
-
-instance Outputable G.CmmGraph where
- ppr = pprCmmGraph
-
-pprCmmGraph :: G.CmmGraph -> SDoc
-pprCmmGraph g = vcat (swallow blocks)
+pprCmmGraphLikeCmm :: G.CmmGraph -> SDoc
+pprCmmGraphLikeCmm g = vcat (swallow blocks)
where blocks = Z.postorder_dfs g
swallow :: [G.CmmBlock] -> [SDoc]
swallow [] = []
mid m@(G.CopyIn {}) = ppr m <+> text "(proc point)"
mid m = ppr m
block' id prev'
- | id == Z.gr_entry g, entry_has_no_pred =
+ | id == Z.lg_entry g, entry_has_no_pred =
vcat (text "<entry>" : reverse prev')
| otherwise = hang (ppr id <> colon) 4 (vcat (reverse prev'))
last id prev' l n =
endblock (ppr $ CmmBranch id')
-}
preds = zipPreds g
- entry_has_no_pred = case Z.lookupBlockEnv preds (Z.gr_entry g) of
+ entry_has_no_pred = case Z.lookupBlockEnv preds (Z.lg_entry g) of
Nothing -> True
Just s -> isEmptyUniqSet s
single_preds =
in Z.fold_blocks add Z.emptyBlockSet g
unique_pred id = Z.elemBlockSet id single_preds
+