[commit: ghc] wip/T10137: Set CmmTickScope correctly (971f0b5)

git at git.haskell.org git at git.haskell.org
Tue Mar 10 16:23:05 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T10137
Link       : http://ghc.haskell.org/trac/ghc/changeset/971f0b58ee4b66c008355cbc1f126801162f7801/ghc

>---------------------------------------------------------------

commit 971f0b58ee4b66c008355cbc1f126801162f7801
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue Mar 10 17:07:27 2015 +0100

    Set CmmTickScope correctly


>---------------------------------------------------------------

971f0b58ee4b66c008355cbc1f126801162f7801
 compiler/cmm/CmmCreateSwitchPlans.hs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/compiler/cmm/CmmCreateSwitchPlans.hs b/compiler/cmm/CmmCreateSwitchPlans.hs
index f51ef07..d89a0f4 100644
--- a/compiler/cmm/CmmCreateSwitchPlans.hs
+++ b/compiler/cmm/CmmCreateSwitchPlans.hs
@@ -37,13 +37,13 @@ cmmCreateSwitchPlans dflags g = do
 
 visitSwitches :: DynFlags -> CmmBlock -> UniqSM [CmmBlock]
 visitSwitches dflags block
-  | (CmmEntry l s, middle, CmmSwitch expr signed ids) <- blockSplit block
+  | (entry@(CmmEntry l scope), middle, CmmSwitch expr signed ids) <- blockSplit block
   = do
     let plan = createSwitchPlan ids
 
-    (newTail, newBlocks) <- implementSwitchPlan dflags signed expr plan
+    (newTail, newBlocks) <- implementSwitchPlan dflags signed scope expr plan
 
-    let block' = CmmEntry l s `blockJoinHead` middle `blockAppend` newTail 
+    let block' = entry `blockJoinHead` middle `blockAppend` newTail
 
     return $ block' : newBlocks
 
@@ -52,8 +52,8 @@ visitSwitches dflags block
 
 
 -- Implementing a switch plan (returning a tail block)
-implementSwitchPlan :: DynFlags -> Bool -> CmmExpr -> SwitchPlan -> UniqSM (Block CmmNode O C, [CmmBlock])
-implementSwitchPlan dflags signed expr = go
+implementSwitchPlan :: DynFlags -> Bool -> CmmTickScope -> CmmExpr -> SwitchPlan -> UniqSM (Block CmmNode O C, [CmmBlock])
+implementSwitchPlan dflags signed scope expr = go
   where
     go (Unconditionally l)
       = return (emptyBlock `blockJoinTail` CmmBranch l, [])
@@ -86,7 +86,7 @@ implementSwitchPlan dflags signed expr = go
       = do
         bid <- mkBlockId <$> getUniqueM
         (last, newBlocks) <- go p
-        let block = CmmEntry bid GlobalScope `blockJoinHead` last
+        let block = CmmEntry bid scope `blockJoinHead` last
         return (bid, block: newBlocks)
 
 



More information about the ghc-commits mailing list