[project @ 2001-07-23 10:54:46 by simonpj]
[ghc-hetmet.git] / ghc / compiler / nativeGen / StixMacro.lhs
index 7127883..6f4a5d1 100644 (file)
@@ -11,10 +11,10 @@ module StixMacro ( macroCode, checkCode ) where
 import {-# SOURCE #-} StixPrim ( amodeToStix )
 
 import MachRegs
-import AbsCSyn         ( CStmtMacro(..), MagicId(..), CAddrMode, tagreg,
+import AbsCSyn         ( CStmtMacro(..), CAddrMode, tagreg,
                          CCheckMacro(..) )
-import Constants       ( uF_RET, uF_SU, uF_UPDATEE, uF_SIZE, sEQ_FRAME_SIZE )
-import CallConv                ( cCallConv )
+import Constants       ( uF_RET, uF_SU, uF_UPDATEE, uF_SIZE )
+import ForeignCall     ( CCallConv(..) )
 import PrimOp          ( PrimOp(..) )
 import PrimRep         ( PrimRep(..) )
 import Stix
@@ -72,13 +72,13 @@ adding an indirection.
 macroCode UPD_CAF args
   = let
        [cafptr,bhptr] = map amodeToStix args
+       new_caf = StCall SLIT("newCAF") CCallConv VoidRep [cafptr]
        w0 = StInd PtrRep cafptr
        w1 = StInd PtrRep (StIndex PtrRep cafptr fixedHS)
-       a1 = StAssign PtrRep w0 ind_static_info
-       a2 = StAssign PtrRep w1 bhptr
-       a3 = StCall SLIT("newCAF") cCallConv VoidRep [cafptr]
+       a1 = StAssign PtrRep w1 bhptr
+       a2 = StAssign PtrRep w0 ind_static_info
     in
-    returnUs (\xs -> a1 : a2 : a3 : xs)
+    returnUs (\xs -> new_caf : a1 : a2 : xs)
 \end{code}
 
 -----------------------------------------------------------------------------
@@ -180,7 +180,7 @@ macroCode REGISTER_IMPORT [arg]
 
 macroCode REGISTER_FOREIGN_EXPORT [arg]
    = returnUs (
-       \xs -> StCall SLIT("getStablePtr") cCallConv VoidRep [amodeToStix arg]
+       \xs -> StCall SLIT("getStablePtr") CCallConv VoidRep [amodeToStix arg]
             : xs
      )
 
@@ -213,7 +213,7 @@ stg_update_PAP  = StCLbl mkStgUpdatePAPLabel
 updatePAP, stackOverflow :: StixTree
 
 updatePAP     = StJump NoDestInfo stg_update_PAP
-stackOverflow = StCall SLIT("StackOverflow") cCallConv VoidRep []
+stackOverflow = StCall SLIT("StackOverflow") CCallConv VoidRep []
 \end{code}
 
 -----------------------------------------------------------------------------