diff options
author | Isaac Dupree <id@isaac.cedarswampstudios.org> | 2008-01-04 10:53:39 +0000 |
---|---|---|
committer | Isaac Dupree <id@isaac.cedarswampstudios.org> | 2008-01-04 10:53:39 +0000 |
commit | d76b6a05ab36066e8aeb67d58e25992d1ef83a8a (patch) | |
tree | 6a1994b9d1cac97252b4435219b33477cd80e139 /compiler/cmm/CmmCPSGen.hs | |
parent | 84629bd7dc7377a5f1138df7185a0b9771880834 (diff) | |
download | haskell-d76b6a05ab36066e8aeb67d58e25992d1ef83a8a.tar.gz |
change CmmActual, CmmFormal to use a data CmmHinted rather than tuple (#1405)
This allows the instance of UserOfLocalRegs to be within Haskell98, and IMHO
makes the code a little cleaner generally.
This is one small (though tedious) step towards making GHC's code more
portable...
Diffstat (limited to 'compiler/cmm/CmmCPSGen.hs')
-rw-r--r-- | compiler/cmm/CmmCPSGen.hs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/compiler/cmm/CmmCPSGen.hs b/compiler/cmm/CmmCPSGen.hs index 94d4b7bdfb..55a7397a68 100644 --- a/compiler/cmm/CmmCPSGen.hs +++ b/compiler/cmm/CmmCPSGen.hs @@ -228,7 +228,7 @@ continuationToProc (max_stack, update_frame_size, formats) stack_use uniques foreignCall call_uniques (CmmPrim target) results arguments -formal_to_actual reg = (CmmReg (CmmLocal reg), NoHint) +formal_to_actual reg = CmmHinted (CmmReg (CmmLocal reg)) NoHint foreignCall :: [Unique] -> CmmCallTarget -> CmmFormals -> CmmActuals -> [CmmStmt] foreignCall uniques call results arguments = @@ -236,14 +236,14 @@ foreignCall uniques call results arguments = saveThreadState ++ caller_save ++ [CmmCall (CmmCallee suspendThread CCallConv) - [ (id,PtrHint) ] - [ (CmmReg (CmmGlobal BaseReg), PtrHint) ] + [ CmmHinted id PtrHint ] + [ CmmHinted (CmmReg (CmmGlobal BaseReg)) PtrHint ] CmmUnsafe CmmMayReturn, CmmCall call results new_args CmmUnsafe CmmMayReturn, CmmCall (CmmCallee resumeThread CCallConv) - [ (new_base, PtrHint) ] - [ (CmmReg (CmmLocal id), PtrHint) ] + [ CmmHinted new_base PtrHint ] + [ CmmHinted (CmmReg (CmmLocal id)) PtrHint ] CmmUnsafe CmmMayReturn, -- Assign the result to BaseReg: we @@ -251,7 +251,7 @@ foreignCall uniques call results arguments = CmmAssign (CmmGlobal BaseReg) (CmmReg (CmmLocal new_base))] ++ caller_load ++ loadThreadState tso_unique ++ - [CmmJump (CmmReg spReg) (map (formal_to_actual . fst) results)] + [CmmJump (CmmReg spReg) (map (formal_to_actual . hintlessCmm) results)] where (_, arg_stmts, new_args) = loadArgsIntoTemps argument_uniques arguments @@ -363,12 +363,12 @@ tail_call spRel target arguments = store_arguments ++ adjust_sp_reg spRel ++ jump where store_arguments = [stack_put spRel expr offset - | ((expr, _), StackParam offset) <- argument_formats] ++ + | ((CmmHinted expr _), StackParam offset) <- argument_formats] ++ [global_put expr global - | ((expr, _), RegisterParam global) <- argument_formats] + | ((CmmHinted expr _), RegisterParam global) <- argument_formats] jump = [CmmJump target arguments] - argument_formats = assignArguments (cmmExprRep . fst) arguments + argument_formats = assignArguments (cmmExprRep . hintlessCmm) arguments adjust_sp_reg spRel = if spRel == 0 |