X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Fcmm%2FCmmCPSGen.hs;h=732c9626679a58f4525ccfb13479aa42cabb04d2;hb=9ec880fcb29ff038bcc72d78bbe2fd6933566047;hp=3b93b0947e18647a4c9d0de15a6996d12559da8f;hpb=0fbb3a5de71b28f24b46bc373551f738ab0b08eb;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmCPSGen.hs b/compiler/cmm/CmmCPSGen.hs index 3b93b09..732c962 100644 --- a/compiler/cmm/CmmCPSGen.hs +++ b/compiler/cmm/CmmCPSGen.hs @@ -15,9 +15,9 @@ import MachOp import CmmUtils import CmmCallConv -import CgProf (curCCS, curCCSAddr) -import CgUtils (cmmOffsetW) -import CgInfoTbls (entryCode) +import CgProf +import CgUtils +import CgInfoTbls import SMRep import ForeignCall @@ -29,12 +29,6 @@ import List import Panic -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 CPS - -- The format for the call to a continuation -- The fst is the arguments that must be passed to the continuation -- by the continuation's caller. @@ -199,7 +193,7 @@ continuationToProc (max_stack, update_frame_size, formats) stack_use uniques tail_call curr_stack target arguments -- A regular Cmm function call - FinalCall next (CmmForeignCall target CmmCallConv) + FinalCall next (CmmCallee target CmmCallConv) results arguments _ _ -> pack_continuation curr_format cont_format ++ tail_call (curr_stack - cont_stack) @@ -210,10 +204,10 @@ continuationToProc (max_stack, update_frame_size, formats) stack_use uniques cont_stack = continuation_frame_size cont_format -- A safe foreign call - FinalCall next (CmmForeignCall target conv) + FinalCall next (CmmCallee target conv) results arguments _ _ -> target_stmts ++ - foreignCall call_uniques' (CmmForeignCall new_target conv) + foreignCall call_uniques' (CmmCallee new_target conv) results arguments where (call_uniques', target_stmts, new_target) = @@ -232,12 +226,12 @@ foreignCall uniques call results arguments = arg_stmts ++ saveThreadState ++ caller_save ++ - [CmmCall (CmmForeignCall suspendThread CCallConv) + [CmmCall (CmmCallee suspendThread CCallConv) [ (id,PtrHint) ] [ (CmmReg (CmmGlobal BaseReg), PtrHint) ] CmmUnsafe, CmmCall call results new_args CmmUnsafe, - CmmCall (CmmForeignCall resumeThread CCallConv) + CmmCall (CmmCallee resumeThread CCallConv) [ (new_base, PtrHint) ] [ (CmmReg (CmmLocal id), PtrHint) ] CmmUnsafe,