X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmLive.hs;h=f9973deb565fb16e3da630d14aa32d0a35027c54;hb=235edf36cc202bb21c00d0e5e05ebf076fb0542e;hp=bee3c65b07b7a24945353effd8847e61a0f05a84;hpb=affbe8dae5d7eb350686b42ddbd4f3561b7bd0ec;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmLive.hs b/compiler/cmm/CmmLive.hs index bee3c65..f9973de 100644 --- a/compiler/cmm/CmmLive.hs +++ b/compiler/cmm/CmmLive.hs @@ -1,8 +1,15 @@ +{-# 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/Commentary/CodingStyle#Warnings +-- for details + module CmmLive ( CmmLive, BlockEntryLiveness, cmmLiveness, - cmmHintFormalsToLiveLocals, + cmmFormalsToLiveLocals, ) where #include "HsVersions.h" @@ -156,8 +163,8 @@ addKilled new_killed live = live `minusUniqSet` new_killed -------------------------------- -- Liveness of a CmmStmt -------------------------------- -cmmHintFormalsToLiveLocals :: CmmHintFormals -> [LocalReg] -cmmHintFormalsToLiveLocals formals = map fst formals +cmmFormalsToLiveLocals :: CmmFormals -> [LocalReg] +cmmFormalsToLiveLocals formals = map hintlessCmm formals cmmStmtLive :: BlockEntryLiveness -> CmmStmt -> CmmLivenessTransformer cmmStmtLive _ (CmmNop) = id @@ -170,13 +177,13 @@ cmmStmtLive _ (CmmAssign reg expr) = (CmmGlobal _) -> id cmmStmtLive _ (CmmStore expr1 expr2) = cmmExprLive expr2 . cmmExprLive expr1 -cmmStmtLive _ (CmmCall target results arguments _) = +cmmStmtLive _ (CmmCall target results arguments _ _) = target_liveness . - foldr ((.) . cmmExprLive) id (map fst arguments) . - addKilled (mkUniqSet $ cmmHintFormalsToLiveLocals results) where + foldr ((.) . cmmExprLive) id (map hintlessCmm arguments) . + addKilled (mkUniqSet $ cmmFormalsToLiveLocals results) where target_liveness = case target of - (CmmForeignCall target _) -> cmmExprLive target + (CmmCallee target _) -> cmmExprLive target (CmmPrim _) -> id cmmStmtLive other_live (CmmBranch target) = addLive (lookupWithDefaultUFM other_live emptyUniqSet target) @@ -190,9 +197,9 @@ cmmStmtLive other_live (CmmSwitch expr targets) = id (mapCatMaybes id targets)) cmmStmtLive _ (CmmJump expr params) = - const (cmmExprLive expr $ foldr ((.) . cmmExprLive) id (map fst params) $ emptyUniqSet) + const (cmmExprLive expr $ foldr ((.) . cmmExprLive) id (map hintlessCmm params) $ emptyUniqSet) cmmStmtLive _ (CmmReturn params) = - const (foldr ((.) . cmmExprLive) id (map fst params) $ emptyUniqSet) + const (foldr ((.) . cmmExprLive) id (map hintlessCmm params) $ emptyUniqSet) -------------------------------- -- Liveness of a CmmExpr