[commit: ghc] master: replaceLabels: null out the cml_cont field of CmmCall (4dc7d04)

Simon Marlow <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/4dc7d04e59161be4ea33192f82aa94be3c68bf20

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

commit 4dc7d04e59161be4ea33192f82aa94be3c68bf20
Author: Simon Marlow <[email protected]>
Date:   Mon Nov 12 14:01:01 2012 +0000

    replaceLabels: null out the cml_cont field of CmmCall
    
    This fixes a CmmLint complaint when doing proc-point splitting.

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

 compiler/cmm/CmmProcPoint.hs |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/compiler/cmm/CmmProcPoint.hs b/compiler/cmm/CmmProcPoint.hs
index 02b232d..fb94b95 100644
--- a/compiler/cmm/CmmProcPoint.hs
+++ b/compiler/cmm/CmmProcPoint.hs
@@ -354,7 +354,10 @@ replaceBranches env cmmg
     last (CmmBranch id)          = CmmBranch (lookup id)
     last (CmmCondBranch e ti fi) = CmmCondBranch e (lookup ti) (lookup fi)
     last (CmmSwitch e tbl)       = CmmSwitch e (map (fmap lookup) tbl)
-    last l@(CmmCall {})          = l
+    last l@(CmmCall {})          = l { cml_cont = Nothing }
+            -- NB. remove the continuation of a CmmCall, since this
+            -- label will now be in a different CmmProc.  Not only
+            -- is this tidier, it stops CmmLint from complaining.
     last l@(CmmForeignCall {})   = l
     lookup id = fmap lookup (mapLookup id env) `orElse` id
             -- XXX: this is a recursive lookup, it follows chains
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.