move and generalize another instance (#1405)
authorIsaac Dupree <id@isaac.cedarswampstudios.org>
Wed, 26 Dec 2007 17:49:04 +0000 (17:49 +0000)
committerIsaac Dupree <id@isaac.cedarswampstudios.org>
Wed, 26 Dec 2007 17:49:04 +0000 (17:49 +0000)
was instance Outputable CmmGraph
type CmmGraph = LGraph Middle Last
now instance (ctx) => Outputable (LGraph m l),
in module with LGraph where it belongs
This also let us reduce the context of DebugNodes to Haskell98,
leaving that class's only extension being multi-parameter.
(also Outputable (LGraph M Last) with M = ExtendWithSpills Middle
was another redundant instance that was then removed)

compiler/cmm/CmmSpillReload.hs
compiler/cmm/ZipCfg.hs
compiler/cmm/ZipCfgCmmRep.hs
compiler/cmm/ZipDataflow0.hs

index 4067f89..0c53309 100644 (file)
@@ -360,9 +360,6 @@ instance Outputable m => Outputable (ExtendWithSpills m) where
     ppr (Reload regs) = ppr_regs "Reload" regs
     ppr (NotSpillOrReload m) = ppr m
 
-instance Outputable (LGraph M Last) where
-    ppr = pprLgraph
-
 instance DebugNodes M Last
                                
 ppr_regs :: String -> RegSet -> SDoc
index 85727a3..1b9b5c3 100644 (file)
@@ -688,6 +688,9 @@ mkBlockSet = mkUniqSet
 instance (Outputable m, Outputable l) => Outputable (ZTail m l) where
     ppr = pprTail
 
+instance (Outputable m, Outputable l, LastNode l) => Outputable (LGraph m l) where
+    ppr = pprLgraph
+
 pprTail :: (Outputable m, Outputable l) => ZTail m l -> SDoc 
 pprTail (ZTail m t) = ppr m $$ ppr t
 pprTail (ZLast LastExit) = text "<exit>"
index f0dc535..0667b7e 100644 (file)
@@ -197,9 +197,6 @@ instance Outputable Convention where
 
 instance DF.DebugNodes Middle Last
 
-instance Outputable CmmGraph where
-    ppr = pprLgraph
-
 debugPpr :: Bool
 debugPpr = debugIsOn
 
index 3a3b0a8..7503d45 100644 (file)
@@ -244,7 +244,7 @@ fold_edge_facts_with_nodes_b :: LastNode l
 -- fixed point iteratively starting from somewhere other than bottom
 -- (as in the reachability analysis done for proc points).
 
-class (Outputable m, Outputable l, LastNode l, Outputable (LGraph m l)) => DebugNodes m l
+class (Outputable m, Outputable l, LastNode l) => DebugNodes m l
 
 refine_f_anal :: (DebugNodes m l, LastNode l, Outputable a) =>
         FAnalysis m l a -> LGraph m l -> DFA a () -> DFA a ()