[commit: ghc] master: fix 'return' in cmm code when tablesNextToCode==False (811a19c)

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/811a19c95bcb4d97a075134a45fb04f2e81acf4e

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

commit 811a19c95bcb4d97a075134a45fb04f2e81acf4e
Author: Simon Marlow <[email protected]>
Date:   Fri Nov 2 12:09:35 2012 +0000

    fix 'return' in cmm code when tablesNextToCode==False

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

 compiler/cmm/CmmParse.y |    6 ++++++
 compiler/cmm/MkGraph.hs |    8 +-------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y
index 1291f64..dfa44ca 100644
--- a/compiler/cmm/CmmParse.y
+++ b/compiler/cmm/CmmParse.y
@@ -1065,6 +1065,12 @@ doReturn exprs_code = do
   updfr_off <- getUpdFrameOff
   emit (mkReturnSimple dflags exprs updfr_off)
 
+mkReturnSimple  :: DynFlags -> [CmmActual] -> UpdFrameOffset -> CmmAGraph
+mkReturnSimple dflags actuals updfr_off =
+  mkReturn dflags e actuals updfr_off
+  where e = entryCode dflags (CmmLoad (CmmStackSlot Old updfr_off)
+                             (gcWord dflags))
+
 doRawJump :: CmmParse CmmExpr -> [GlobalReg] -> CmmParse ()
 doRawJump expr_code vols = do
   dflags <- getDynFlags
diff --git a/compiler/cmm/MkGraph.hs b/compiler/cmm/MkGraph.hs
index 1536794..7971b1d 100644
--- a/compiler/cmm/MkGraph.hs
+++ b/compiler/cmm/MkGraph.hs
@@ -12,7 +12,7 @@ module MkGraph
   , mkJump, mkJumpExtra, mkDirectJump, mkForeignJump, mkForeignJumpExtra
   , mkRawJump
   , mkCbranch, mkSwitch
-  , mkReturn, mkReturnSimple, mkComment, mkCallEntry, mkBranch
+  , mkReturn, mkComment, mkCallEntry, mkBranch
   , copyInOflow, copyOutOflow
   , noExtraStack
   , toCall, Transfer(..)
@@ -23,7 +23,6 @@ import BlockId
 import Cmm
 import CmmCallConv
 
-
 import Compiler.Hoopl hiding (Unique, (<*>), mkFirst, mkMiddle, mkLast, mkLabel, mkBranch, Shape(..))
 import DynFlags
 import FastString
@@ -241,11 +240,6 @@ mkReturn dflags e actuals updfr_off =
   lastWithArgs dflags Ret  Old NativeReturn actuals updfr_off $
     toCall e Nothing updfr_off 0
 
-mkReturnSimple  :: DynFlags -> [CmmActual] -> UpdFrameOffset -> CmmAGraph
-mkReturnSimple dflags actuals updfr_off =
-  mkReturn dflags e actuals updfr_off
-  where e = CmmLoad (CmmStackSlot Old updfr_off) (gcWord dflags)
-
 mkBranch        :: BlockId -> CmmAGraph
 mkBranch bid     = mkLast (CmmBranch bid)
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.