Added an SRT to each CmmCall and added the current SRT to the CgMonad
[ghc-hetmet.git] / compiler / nativeGen / AsmCodeGen.lhs
index f7b7570..b3ca844 100644 (file)
@@ -26,16 +26,12 @@ import CmmOpt               ( cmmMiniInline, cmmMachOpFold )
 import PprCmm          ( pprStmt, pprCmms )
 import MachOp
 import CLabel
-#if powerpc_TARGET_ARCH
-import CLabel           ( mkRtsCodeLabel )
-#endif
 
 import UniqFM
 import Unique          ( Unique, getUnique )
 import UniqSupply
 import FastTypes
 import List            ( groupBy, sortBy )
-import CLabel           ( pprCLabel )
 import ErrUtils                ( dumpIfSet_dyn )
 import DynFlags
 import StaticFlags     ( opt_Static, opt_PIC )
@@ -344,7 +340,7 @@ shortcutBranches dflags tops
     mapping = foldr plusUFM emptyUFM mappings
 
 build_mapping top@(CmmData _ _) = (top, emptyUFM)
-build_mapping (CmmProc info lbl params []) $
+build_mapping (CmmProc info lbl params [])
   = (CmmProc info lbl params [], emptyUFM)
 build_mapping (CmmProc info lbl params (head:blocks))
   = (CmmProc info lbl params (head:others), mapping)
@@ -448,16 +444,12 @@ fixAssign (CmmAssign (CmmGlobal reg) src)
   where
        reg_or_addr = get_GlobalReg_reg_or_addr reg
 
-fixAssign (CmmCall target results args vols)
+{-
+fixAssign (CmmCall target results args)
   = mapAndUnzipUs fixResult results `thenUs` \ (results',stores) ->
-    returnUs (caller_save ++
-             CmmCall target results' args vols :
-             caller_restore ++
+    returnUs (CmmCall target results' args :
              concat stores)
   where
-       -- we also save/restore any caller-saves STG registers here
-       (caller_save, caller_restore) = callerSaveVolatileRegs vols
-
        fixResult g@(CmmGlobal reg,hint) = 
          case get_GlobalReg_reg_or_addr reg of
                Left realreg -> returnUs (g, [])
@@ -468,6 +460,7 @@ fixAssign (CmmCall target results args vols)
                              [CmmStore baseRegAddr (CmmReg local)])
        fixResult other =
          returnUs (other,[])
+-}
 
 fixAssign other_stmt = returnUs [other_stmt]
 
@@ -543,7 +536,7 @@ cmmStmtConFold stmt
            -> do addr' <- cmmExprConFold JumpReference addr
                  return $ CmmJump addr' regs
 
-       CmmCall target regs args vols
+       CmmCall target regs args srt
           -> do target' <- case target of
                              CmmForeignCall e conv -> do
                                e' <- cmmExprConFold CallReference e
@@ -552,7 +545,7 @@ cmmStmtConFold stmt
                  args' <- mapM (\(arg, hint) -> do
                                   arg' <- cmmExprConFold DataReference arg
                                   return (arg', hint)) args
-                return $ CmmCall target' regs args' vols
+                return $ CmmCall target' regs args' srt
 
         CmmCondBranch test dest
            -> do test' <- cmmExprConFold DataReference test