X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmProcPoint.hs;h=a90af7137dc33017c39f5722691760fc7ac54c9d;hb=aedb94f5f220b5e442b23ecc445fd38c8d9b6ba0;hp=f7af8caae39d89c6a2d02dd1534ff7484bebc177;hpb=17b297d97d327620ed6bfab942f8992b2446f1bf;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmProcPoint.hs b/compiler/cmm/CmmProcPoint.hs index f7af8ca..a90af71 100644 --- a/compiler/cmm/CmmProcPoint.hs +++ b/compiler/cmm/CmmProcPoint.hs @@ -1,8 +1,8 @@ -{-# OPTIONS_GHC -w #-} +{-# OPTIONS -w #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details module CmmProcPoint ( @@ -11,6 +11,7 @@ module CmmProcPoint ( #include "HsVersions.h" +import BlockId import Cmm import CmmBrokenBlock import Dataflow @@ -84,8 +85,8 @@ calculateNewProcPoints owners block = then unitUniqSet child_id else emptyUniqSet where - parent_owners = lookupWithDefaultUFM owners emptyUniqSet parent_id - child_owners = lookupWithDefaultUFM owners emptyUniqSet child_id + parent_owners = lookupWithDefaultBEnv owners emptyUniqSet parent_id + child_owners = lookupWithDefaultBEnv owners emptyUniqSet child_id needs_proc_point = -- only if parent isn't dead (not $ isEmptyUniqSet parent_owners) && @@ -98,11 +99,11 @@ calculateOwnership :: BlockEnv BrokenBlock -> [BrokenBlock] -> BlockEnv (UniqSet BlockId) calculateOwnership blocks_ufm proc_points blocks = - fixedpoint dependants update (map brokenBlockId blocks) emptyUFM + fixedpoint dependants update (map brokenBlockId blocks) emptyBlockEnv where dependants :: BlockId -> [BlockId] dependants ident = - brokenBlockTargets $ lookupWithDefaultUFM + brokenBlockTargets $ lookupWithDefaultBEnv blocks_ufm unknown_block ident update :: BlockId @@ -112,16 +113,16 @@ calculateOwnership blocks_ufm proc_points blocks = update ident cause owners = case (cause, ident `elementOfUniqSet` proc_points) of (Nothing, True) -> - Just $ addToUFM owners ident (unitUniqSet ident) + Just $ extendBlockEnv owners ident (unitUniqSet ident) (Nothing, False) -> Nothing (Just cause', True) -> Nothing (Just cause', False) -> if (sizeUniqSet old) == (sizeUniqSet new) then Nothing - else Just $ addToUFM owners ident new + else Just $ extendBlockEnv owners ident new where - old = lookupWithDefaultUFM owners emptyUniqSet ident + old = lookupWithDefaultBEnv owners emptyUniqSet ident new = old `unionUniqSets` - lookupWithDefaultUFM owners emptyUniqSet cause' + lookupWithDefaultBEnv owners emptyUniqSet cause' unknown_block = panic "unknown BlockId in calculateOwnership"