X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmZipUtil.hs;h=6a343f836f354e51e283fab57c58212b5aa33ed8;hb=33770e2e376005ff14a1d16b89f32b0d474425e2;hp=f9705478228d4ba10ce8db847ef1edf4ba7b2aa2;hpb=742809424904edbefc39dca8233356b25e546b56;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmZipUtil.hs b/compiler/cmm/CmmZipUtil.hs index f970547..6a343f8 100644 --- a/compiler/cmm/CmmZipUtil.hs +++ b/compiler/cmm/CmmZipUtil.hs @@ -4,13 +4,14 @@ module CmmZipUtil , givesUniquePredecessorTo ) where +import BlockId import Prelude hiding (last, unzip) import ZipCfg import Maybes import UniqSet --- | Compute the predecessors of each *reachable* block +-- | Compute the predecessors of each /reachable/ block zipPreds :: LastNode l => LGraph m l -> BlockEnv BlockSet zipPreds g = foldl add emptyBlockEnv (postorder_dfs g) where add env block@(Block id _) = @@ -24,7 +25,7 @@ zipPreds g = foldl add emptyBlockEnv (postorder_dfs g) givesUniquePredecessorTo :: LastNode l => LGraph m l -> BlockId -> Bool givesUniquePredecessorTo g = \id -> elemBlockSet id singlePreds - -- | accumulates a pair of sets: the set of all blocks containing a single + -- accumulates a pair of sets: the set of all blocks containing a single -- predecessor, and the set of all blocks containing at least two predecessors where (singlePreds, _) = fold_blocks add (emptyBlockSet, emptyBlockSet) g add b (single, multi) = foldl add_pred (single, multi) (succs b)