Merging in the new codegen branch
[ghc-hetmet.git] / compiler / cmm / CmmZipUtil.hs
index f970547..9f0993d 100644 (file)
@@ -4,16 +4,17 @@ 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 _) =
+    where add env block@(Block id _ _) =
             foldl (\env sid ->
                        let preds = lookupBlockEnv env sid `orElse` emptyBlockSet
                        in  extendBlockEnv env sid (extendBlockSet preds 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)