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 774 - (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 :     *)
31 : george 608 val genCall : {
32 :     name : T.rexp,
33 :     proto : CTypes.c_proto,
34 :     structRet : {szb : int, align : int} -> T.rexp,
35 :     args : c_arg list
36 :     } -> {
37 :     callseq : T.stm list,
38 :     result: T.mlrisc list
39 :     }
40 :    
41 : blume 774 val tmpsp_genCall :
42 :     {
43 :     name : T.rexp,
44 :     proto : CTypes.c_proto,
45 :     structRet : {szb : int, align : int} -> T.rexp,
46 :     args : c_arg list
47 :     } -> {
48 :     callseq : T.stm list,
49 :     result: T.mlrisc list
50 :     }
51 : george 608 end

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