summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmUtils.hs
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-08-23 16:08:34 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-08-25 11:12:32 +0100
commit639646839679a416e525a1801c5e4f2fcdd9b8e8 (patch)
tree412587a46855f3da5eaab8d616c674e4cb7c974b /compiler/cmm/CmmUtils.hs
parent299d4645a54fc6083bf92034716ca225adce913e (diff)
downloadhaskell-639646839679a416e525a1801c5e4f2fcdd9b8e8.tar.gz
rewrite branchChainElim; other refactoring in CmmContFlowOpt
Diffstat (limited to 'compiler/cmm/CmmUtils.hs')
-rw-r--r--compiler/cmm/CmmUtils.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/cmm/CmmUtils.hs b/compiler/cmm/CmmUtils.hs
index 47a5b09882..a06d62950d 100644
--- a/compiler/cmm/CmmUtils.hs
+++ b/compiler/cmm/CmmUtils.hs
@@ -51,7 +51,7 @@ module CmmUtils(
lastNode, replaceLastNode, insertBetween,
ofBlockMap, toBlockMap, insertBlock,
ofBlockList, toBlockList, bodyToBlockList,
- foldGraphBlocks, mapGraphNodes, postorderDfs,
+ foldGraphBlocks, mapGraphNodes, postorderDfs, mapGraphNodes1,
analFwd, analBwd, analRewFwd, analRewBwd,
dataflowPassFwd, dataflowPassBwd
@@ -418,6 +418,10 @@ mapGraphNodes :: ( CmmNode C O -> CmmNode C O
mapGraphNodes funs@(mf,_,_) g =
ofBlockMap (entryLabel $ mf $ CmmEntry $ g_entry g) $ mapMap (blockMapNodes3 funs) $ toBlockMap g
+mapGraphNodes1 :: (forall e x. CmmNode e x -> CmmNode e x) -> CmmGraph -> CmmGraph
+mapGraphNodes1 f g = modifyGraph (graphMapBlocks (blockMapNodes f)) g
+
+
foldGraphBlocks :: (CmmBlock -> a -> a) -> a -> CmmGraph -> a
foldGraphBlocks k z g = mapFold k z $ toBlockMap g