extra prettyprinting only when debugging
[ghc-hetmet.git] / compiler / cmm / PprCmmZ.hs
index 390bca6..e2fd960 100644 (file)
@@ -1,7 +1,6 @@
-{-# OPTIONS -Wall -fno-warn-name-shadowing -fno-warn-orphans #-}
 
-module PprCmmZ 
-    ( pprCmmGraph
+module PprCmmZ
+    ( pprCmmGraphLikeCmm
     )
 where
 
@@ -11,23 +10,16 @@ import Cmm
 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 [] = []
@@ -39,7 +31,7 @@ pprCmmGraph g = vcat (swallow blocks)
           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 =
@@ -96,7 +88,7 @@ pprCmmGraph g = vcat (swallow blocks)
                                 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 =
@@ -110,3 +102,4 @@ pprCmmGraph g = vcat (swallow blocks)
               in  Z.fold_blocks add Z.emptyBlockSet g
           unique_pred id = Z.elemBlockSet id single_preds
 
+