1 (***********************************************************************)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
7 (* Copyright 1996 Institut National de Recherche en Informatique et *)
8 (* en Automatique. All rights reserved. This file is distributed *)
9 (* under the terms of the Q Public License version 1.0. *)
11 (***********************************************************************)
15 type machtype_component
=
20 type machtype
= machtype_component array
22 let typ_void = ([||] : machtype_component array
)
23 let typ_addr = [|Addr
|]
25 let typ_float = [|Float
|]
27 let size_component = function
28 Addr
-> Arch.size_addr
29 | Int
-> Arch.size_int
30 | Float
-> Arch.size_float
32 let size_machtype mty
=
34 for i
= 0 to Array.length mty
- 1 do
35 size := !size + size_component mty
.(i
)
47 let negate_comparison = function
48 Ceq
-> Cne
| Cne
-> Ceq
49 | Clt
-> Cge
| Cle
-> Cgt
50 | Cgt
-> Cle
| Cge
-> Clt
52 let swap_comparison = function
53 Ceq
-> Ceq
| Cne
-> Cne
54 | Clt
-> Cgt
| Cle
-> Cge
55 | Cgt
-> Clt
| Cge
-> Cle
70 Capply
of machtype
* Debuginfo.t
71 | Cextcall
of string * machtype
* bool * Debuginfo.t
72 | Cload
of memory_chunk
74 | Cstore
of memory_chunk
75 | Caddi
| Csubi
| Cmuli
| Cdivi
| Cmodi
76 | Cand
| Cor
| Cxor
| Clsl
| Clsr
| Casr
81 | Caddf
| Csubf
| Cmulf
| Cdivf
82 | Cfloatofint
| Cintoffloat
84 | Craise
of Debuginfo.t
85 | Ccheckbound
of Debuginfo.t
89 | Cconst_natint
of nativeint
90 | Cconst_float
of string
91 | Cconst_symbol
of string
92 | Cconst_pointer
of int
93 | Cconst_natpointer
of nativeint
95 | Clet
of Ident.t
* expression
* expression
96 | Cassign
of Ident.t
* expression
97 | Ctuple
of expression list
98 | Cop
of operation
* expression list
99 | Csequence
of expression
* expression
100 | Cifthenelse
of expression
* expression
* expression
101 | Cswitch
of expression
* int array
* expression array
102 | Cloop
of expression
103 | Ccatch
of int * Ident.t list
* expression
* expression
104 | Cexit
of int * expression list
105 | Ctrywith
of expression
* Ident.t
* expression
109 fun_args
: (Ident.t
* machtype
) list
;
110 fun_body
: expression
;
114 Cdefine_symbol
of string
115 | Cdefine_label
of int
116 | Cglobal_symbol
of string
119 | Cint32
of nativeint
123 | Csymbol_address
of string
124 | Clabel_address
of int
131 | Cdata
of data_item list