From 5a7a311051c2a525c9692a7b2eb47a70cfc7c9fb Mon Sep 17 00:00:00 2001 From: Isaac Dupree Date: Wed, 26 Dec 2007 17:49:04 +0000 Subject: [PATCH] move and generalize another instance (#1405) 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 | 3 --- compiler/cmm/ZipCfg.hs | 3 +++ compiler/cmm/ZipCfgCmmRep.hs | 3 --- compiler/cmm/ZipDataflow0.hs | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/compiler/cmm/CmmSpillReload.hs b/compiler/cmm/CmmSpillReload.hs index 4067f89..0c53309 100644 --- a/compiler/cmm/CmmSpillReload.hs +++ b/compiler/cmm/CmmSpillReload.hs @@ -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 diff --git a/compiler/cmm/ZipCfg.hs b/compiler/cmm/ZipCfg.hs index 85727a3..1b9b5c3 100644 --- a/compiler/cmm/ZipCfg.hs +++ b/compiler/cmm/ZipCfg.hs @@ -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 "" diff --git a/compiler/cmm/ZipCfgCmmRep.hs b/compiler/cmm/ZipCfgCmmRep.hs index f0dc535..0667b7e 100644 --- a/compiler/cmm/ZipCfgCmmRep.hs +++ b/compiler/cmm/ZipCfgCmmRep.hs @@ -197,9 +197,6 @@ instance Outputable Convention where instance DF.DebugNodes Middle Last -instance Outputable CmmGraph where - ppr = pprLgraph - debugPpr :: Bool debugPpr = debugIsOn diff --git a/compiler/cmm/ZipDataflow0.hs b/compiler/cmm/ZipDataflow0.hs index 3a3b0a8..7503d45 100644 --- a/compiler/cmm/ZipDataflow0.hs +++ b/compiler/cmm/ZipDataflow0.hs @@ -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 () -- 1.7.10.4