import StaticFlags
import Outputable
-import MachRegs (callerSaveVolatileRegs)
- -- HACK: this is part of the NCG so we shouldn't use this, but we need
- -- it for now to eliminate the need for saved regs to be in CmmCall.
- -- The long term solution is to factor callerSaveVolatileRegs
- -- from nativeGen into codeGen
-
import Control.Monad
-- -----------------------------------------------------------------------------
= do vols <- getVolatileRegs live
srt <- getSRTInfo
emitForeignCall' safety results
- (CmmForeignCall cmm_target cconv) call_args (Just vols) srt
+ (CmmCallee cmm_target cconv) call_args (Just vols) srt
where
(call_args, cmm_target)
= case target of
-- Once that happens, this function will just emit a (CmmSafe srt) call,
-- and the CPS will will be the one to convert that
-- to this sequence of three CmmUnsafe calls.
- stmtC (CmmCall (CmmForeignCall suspendThread CCallConv)
+ stmtC (CmmCall (CmmCallee suspendThread CCallConv)
[ (id,PtrHint) ]
[ (CmmReg (CmmGlobal BaseReg), PtrHint) ]
CmmUnsafe)
stmtC (CmmCall temp_target results temp_args CmmUnsafe)
- stmtC (CmmCall (CmmForeignCall resumeThread CCallConv)
+ stmtC (CmmCall (CmmCallee resumeThread CCallConv)
[ (new_base, PtrHint) ]
[ (CmmReg (CmmLocal id), PtrHint) ]
CmmUnsafe)
tmp <- maybe_assign_temp e
return (tmp,hint)
-load_target_into_temp (CmmForeignCall expr conv) = do
+load_target_into_temp (CmmCallee expr conv) = do
tmp <- maybe_assign_temp expr
- return (CmmForeignCall tmp conv)
+ return (CmmCallee tmp conv)
load_target_into_temp other_target =
return other_target