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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/c-calls/c-calls.sig
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/c-calls/c-calls.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 838 - (view) (download) (as text)

1 : george 608 (* c-calls.sig
2 :     *
3 :     * COPYRIGHT (c) 2000 Bell Labs, Lucent Technologies
4 :     *)
5 : george 556
6 : george 608 signature C_CALLS =
7 :     sig
8 : george 556
9 : george 608 structure T : MLTREE
10 : george 556
11 : george 608 datatype c_arg
12 :     = ARG of T.rexp
13 :     (* rexp specifies integer or pointer; if the
14 :     * corresponding parameter is a C struct, then
15 :     * this argument is the address of the struct.
16 :     *)
17 :     | FARG of T.fexp
18 :     (* fexp specifies floating-point argument *)
19 :     | ARGS of c_arg list
20 :     (* list of arguments corresponding to the contents of a C struct *)
21 : george 556
22 :     (* translate a C function call with the given argument list into
23 :     * a MLRISC statement list. The structRet function is called
24 :     * to allocate space for returning a C struct. The result of
25 :     * genCall is a mlrisc list specifying where the result is and the
26 :     * MLRisc statements that implement the calling sequence. Functions
27 :     * with void return type have no result, most others have one result,
28 :     * but some conventions may flatten larger arguments into multiple
29 :     * registers (e.g., a register pair for long long results).
30 : blume 838 *
31 :     * The "saveRestoreDedicated" callback receives a list of registers
32 :     * defined by the call instruction and should return instruction
33 :     * sequences to save/restore any dedicated registers around that call
34 :     * (if necessary).
35 : george 556 *)
36 : george 608 val genCall : {
37 :     name : T.rexp,
38 :     proto : CTypes.c_proto,
39 :     structRet : {szb : int, align : int} -> T.rexp,
40 : blume 838 saveRestoreDedicated :
41 :     T.mlrisc list -> { save: T.stm list, restore: T.stm list },
42 :     callComment : string option,
43 : george 608 args : c_arg list
44 :     } -> {
45 :     callseq : T.stm list,
46 :     result: T.mlrisc list
47 :     }
48 :    
49 :     end

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