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 556 - (view) (download) (as text)

1 : george 556 signature C_CALL = sig
2 :    
3 :     structure T : MLTREE
4 :    
5 :     (* multiple calling conventions on a single architecture *)
6 :     type calling_convention
7 :    
8 :     (* prototype describing C function *)
9 :     type c_proto =
10 :     { conv : calling_convention,
11 :     retTy : CTypes.c_type,
12 :     paramTys : CTypes.c_type list
13 :     }
14 :    
15 :     exception ArgParamMismatch
16 :    
17 :     datatype c_arg
18 :     = ARG of T.rexp
19 :     (* rexp specifies integer or pointer; if the
20 :     * corresponding parameter is a C struct, then
21 :     * this argument is the address of the struct.
22 :     *)
23 :     | FARG of T.fexp
24 :     (* fexp specifies floating-point argument *)
25 :     | ARGS of c_arg list
26 :     (* list of arguments corresponding to contents of a C struct *)
27 :    
28 :     (* translate a C function call with the given argument list into
29 :     * a MLRISC statement list. The structRet function is called
30 :     * to allocate space for returning a C struct. The result of
31 :     * genCall is a mlrisc list specifying where the result is and the
32 :     * MLRisc statements that implement the calling sequence. Functions
33 :     * with void return type have no result, most others have one result,
34 :     * but some conventions may flatten larger arguments into multiple
35 :     * registers (e.g., a register pair for long long results).
36 :     *)
37 :     val genCall :
38 :     { name : T.rexp,
39 :     proto : c_proto,
40 :     structRet : {szb : int, align : int} -> T.rexp,
41 :     args : c_arg list
42 :     }
43 :     ->
44 :     { callseq : T.stm list,
45 :     result: T.mlrisc list
46 :     }
47 :     end

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