X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FZipCfgExtras.hs;h=bd26aca9760991d31a61931c77af529ba9fae84e;hb=d7b36bbbcd56ee14656223d02e32f5a1f52ea17b;hp=e4bd1ae668c742139da701dda89156b872c1fab3;hpb=72fd3e30c209f18af65b9a9a3995f23c16bbe519;p=ghc-hetmet.git diff --git a/compiler/cmm/ZipCfgExtras.hs b/compiler/cmm/ZipCfgExtras.hs index e4bd1ae..bd26aca 100644 --- a/compiler/cmm/ZipCfgExtras.hs +++ b/compiler/cmm/ZipCfgExtras.hs @@ -12,12 +12,11 @@ module ZipCfgExtras () where +import BlockId import Maybes import Panic import ZipCfg -import UniqFM - import Prelude hiding (zip, unzip, last) @@ -31,13 +30,15 @@ unfocus :: FGraph m l -> LGraph m l -- lose focus -- the current focus. -- The new focus can be at either the entry edge or the exit edge. +{- splice_focus_entry :: FGraph m l -> LGraph m l -> FGraph m l splice_focus_exit :: FGraph m l -> LGraph m l -> FGraph m l +-} _unused :: () _unused = all `seq` () - where all = ( exit, focusp, unfocus, splice_focus_entry, splice_focus_exit - , fold_fwd_block, foldM_fwd_block (\_ a -> Just a) + where all = ( exit, focusp, unfocus {- , splice_focus_entry, splice_focus_exit -} + , foldM_fwd_block (\_ a -> Just a) ) unfocus (FGraph e bz bs) = LGraph e (insertBlock (zip bz) bs) @@ -49,6 +50,8 @@ exit g@(LGraph eid _) = FGraph eid (ZBlock h (ZLast l)) others where FGraph _ b others = focusp is_exit g `orElse` panic "no exit in flow graph" (h, l) = goto_end b + +{- splice_focus_entry (FGraph eid (ZBlock head tail) blocks) g = let (tail', g') = splice_tail g tail in FGraph eid (ZBlock head tail') (plusUFM (lg_blocks g') blocks) @@ -56,14 +59,7 @@ splice_focus_entry (FGraph eid (ZBlock head tail) blocks) g = splice_focus_exit (FGraph eid (ZBlock head tail) blocks) g = let (g', head') = splice_head head g in FGraph eid (ZBlock head' tail) (plusUFM (lg_blocks g') blocks) - --- | Fold from first to last -fold_fwd_block :: - (BlockId -> a -> a) -> (m -> a -> a) -> (ZLast l -> a -> a) -> - Block m l -> a -> a -fold_fwd_block first middle last (Block id t) z = tail t (first id z) - where tail (ZTail m t) z = tail t (middle m z) - tail (ZLast l) z = last l z +-} -- | iterate from first to last foldM_fwd_block ::