X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmCPSGen.hs;h=e08823e5618d10e8a3b97bd5026b8d4e6820a89d;hb=7fc749a43b4b6b85d234fa95d4928648259584f4;hp=732c9626679a58f4525ccfb13479aa42cabb04d2;hpb=1c5499d4d5d506ce0cc971e98c09bfbf7bc290a1;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmCPSGen.hs b/compiler/cmm/CmmCPSGen.hs index 732c962..e08823e 100644 --- a/compiler/cmm/CmmCPSGen.hs +++ b/compiler/cmm/CmmCPSGen.hs @@ -1,3 +1,10 @@ +{-# OPTIONS -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/Commentary/CodingStyle#Warnings +-- for details + module CmmCPSGen ( -- | Converts continuations into full proceedures. -- The main work of the CPS transform that everything else is setting-up. @@ -194,7 +201,7 @@ continuationToProc (max_stack, update_frame_size, formats) stack_use uniques -- A regular Cmm function call FinalCall next (CmmCallee target CmmCallConv) - results arguments _ _ -> + results arguments _ _ _ -> pack_continuation curr_format cont_format ++ tail_call (curr_stack - cont_stack) target arguments @@ -205,7 +212,7 @@ continuationToProc (max_stack, update_frame_size, formats) stack_use uniques -- A safe foreign call FinalCall next (CmmCallee target conv) - results arguments _ _ -> + results arguments _ _ _ -> target_stmts ++ foreignCall call_uniques' (CmmCallee new_target conv) results arguments @@ -215,7 +222,7 @@ continuationToProc (max_stack, update_frame_size, formats) stack_use uniques -- A safe prim call FinalCall next (CmmPrim target) - results arguments _ _ -> + results arguments _ _ _ -> foreignCall call_uniques (CmmPrim target) results arguments @@ -229,12 +236,14 @@ foreignCall uniques call results arguments = [CmmCall (CmmCallee suspendThread CCallConv) [ (id,PtrHint) ] [ (CmmReg (CmmGlobal BaseReg), PtrHint) ] - CmmUnsafe, - CmmCall call results new_args CmmUnsafe, + CmmUnsafe + CmmMayReturn, + CmmCall call results new_args CmmUnsafe CmmMayReturn, CmmCall (CmmCallee resumeThread CCallConv) [ (new_base, PtrHint) ] [ (CmmReg (CmmLocal id), PtrHint) ] - CmmUnsafe, + CmmUnsafe + CmmMayReturn, -- Assign the result to BaseReg: we -- might now have a different Capability! CmmAssign (CmmGlobal BaseReg) (CmmReg (CmmLocal new_base))] ++