X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FcodeGen%2FCgForeignCall.hs;h=23b68d867f1364f0dca847a1652f3ef5f71e5a29;hp=dd959943fbef9f4d8c011acddd459aca9ef109f6;hb=17b297d97d327620ed6bfab942f8992b2446f1bf;hpb=1c5499d4d5d506ce0cc971e98c09bfbf7bc290a1 diff --git a/compiler/codeGen/CgForeignCall.hs b/compiler/codeGen/CgForeignCall.hs index dd95994..23b68d8 100644 --- a/compiler/codeGen/CgForeignCall.hs +++ b/compiler/codeGen/CgForeignCall.hs @@ -6,6 +6,13 @@ -- ----------------------------------------------------------------------------- +{-# OPTIONS_GHC -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings +-- for details + module CgForeignCall ( cgForeignCall, emitForeignCall, @@ -73,7 +80,7 @@ emitForeignCall results (CCall (CCallSpec target cconv safety)) args live = do vols <- getVolatileRegs live srt <- getSRTInfo emitForeignCall' safety results - (CmmCallee cmm_target cconv) call_args (Just vols) srt + (CmmCallee cmm_target cconv) call_args (Just vols) srt CmmMayReturn where (call_args, cmm_target) = case target of @@ -104,13 +111,14 @@ emitForeignCall' -> [(CmmExpr,MachHint)] -- arguments -> Maybe [GlobalReg] -- live vars, in case we need to save them -> C_SRT -- the SRT of the calls continuation + -> CmmReturnInfo -> Code -emitForeignCall' safety results target args vols srt +emitForeignCall' safety results target args vols srt ret | not (playSafe safety) = do temp_args <- load_args_into_temps args let (caller_save, caller_load) = callerSaveVolatileRegs vols stmtsC caller_save - stmtC (CmmCall target results temp_args CmmUnsafe) + stmtC (CmmCall target results temp_args CmmUnsafe ret) stmtsC caller_load | otherwise = do @@ -131,12 +139,12 @@ emitForeignCall' safety results target args vols srt stmtC (CmmCall (CmmCallee suspendThread CCallConv) [ (id,PtrHint) ] [ (CmmReg (CmmGlobal BaseReg), PtrHint) ] - CmmUnsafe) - stmtC (CmmCall temp_target results temp_args CmmUnsafe) + CmmUnsafe ret) + stmtC (CmmCall temp_target results temp_args CmmUnsafe ret) stmtC (CmmCall (CmmCallee resumeThread CCallConv) [ (new_base, PtrHint) ] [ (CmmReg (CmmLocal id), PtrHint) ] - CmmUnsafe) + CmmUnsafe ret) -- Assign the result to BaseReg: we -- might now have a different Capability! stmtC (CmmAssign (CmmGlobal BaseReg) (CmmReg (CmmLocal new_base)))