Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /MLRISC/trunk/c-call/gen/c-call-gen-fn.sml
ViewVC logotype

Diff of /MLRISC/trunk/c-call/gen/c-call-gen-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

MLRISC/trunk/c-call/gen/c-call-fn.sml revision 3223, Thu Sep 4 17:48:33 2008 UTC MLRISC/trunk/c-call/gen/c-call-gen-fn.sml revision 3227, Thu Sep 18 06:06:40 2008 UTC
# Line 1  Line 1 
1  (* c-call-fn.sml  (* c-call-gen-fn.sml
2   *   *
3   * Generate MLRISC code for moving arguments to and from machine locations.   * Generate MLRISC code for moving arguments to and from machine locations.
4   *)   *)
5    
6  functor CCallFn (  functor CCallGenFn (
7      structure T : MLTREE      structure T : MLTREE
8      structure C : CELLS      structure C : CELLS
9    (* given an offset constant, return an expression that gives an offset from    (* given an offset constant, return an expression that gives an offset from
# Line 23  Line 23 
23            where type reg_id = T.reg            where type reg_id = T.reg
24            where type loc_kind = CLocKind.loc_kind            where type loc_kind = CLocKind.loc_kind
25    
26    ) = struct    ) : C_CALL_GEN = struct
27    
28      structure K = CLocKind      structure K = CLocKind
29        structure T = T
30        structure C = C
31        structure SA = SA
32    
33      fun concatMap f ls = List.concat(List.map f ls)      fun concatMap f ls = List.concat(List.map f ls)
34    
# Line 198  Line 201 
201               ListPair.foldl (writeLoc arg) stms (membOffs, locs)               ListPair.foldl (writeLoc arg) stms (membOffs, locs)
202            end            end
203    
204    (* write C arguments to parameter locations; also return any used GPRs or FPRs *)    (* write C arguments to parameter locations; also return any used GPRs and FPRs *)
205      fun writeLocs (args, argLocs) = let      fun writeLocs (args, argLocs) = let
206            val gprs = concatMap gprsOfLoc (List.concat argLocs)            val gprs = concatMap gprsOfLoc (List.concat argLocs)
207            val fprs = concatMap fprsOfLoc (List.concat argLocs)            val fprs = concatMap fprsOfLoc (List.concat argLocs)
# Line 259  Line 262 
262                (List.rev resultRegs, List.rev copyResult)                (List.rev resultRegs, List.rev copyResult)
263            end            end
264    
265    end (* CCallFn *)    end (* CCallGenFn *)

Legend:
Removed from v.3223  
changed lines
  Added in v.3227

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0