Import Upstream version 20180207
[hcoop/debian/mlton.git] / mlton / ssa / direct-exp2.sig
CommitLineData
7f918cf1
CE
1(* Copyright (C) 2009 Matthew Fluet.
2 * Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 * Copyright (C) 1997-2000 NEC Research Institute.
5 *
6 * MLton is released under a BSD-style license.
7 * See the file MLton-LICENSE for details.
8 *)
9
10signature DIRECT_EXP2_STRUCTS =
11 sig
12 include SSA_TREE2
13 end
14
15signature DIRECT_EXP2 =
16 sig
17 include DIRECT_EXP2_STRUCTS
18
19 structure DirectExp:
20 sig
21 type t
22
23 datatype cases =
24 Con of {con: Con.t,
25 args: (Var.t * Type.t) vector,
26 body: t} vector
27 | Word of WordSize.t * (WordX.t * t) vector
28
29 val arith: {prim: Type.t Prim.t,
30 args: t vector,
31 overflow: t,
32 ty: Type.t} -> t
33 (* For now, call always uses Handler.None. This means it should only
34 * be used for functions that cannot raise.
35 *)
36 val call: {func: Func.t, args: t vector, ty: Type.t} -> t
37 val casee: {test: t,
38 cases: cases,
39 default: t option,
40 ty: Type.t} -> t
41 val conApp: {con: Con.t,
42 args: t vector,
43 ty: Type.t} -> t
44 val const: Const.t -> t
45 val detuple: {body: Var.t vector -> t,
46 length: int,
47 tuple: t} -> t
48 val detupleBind: {body: t,
49 components: Var.t vector,
50 tuple: Var.t,
51 tupleTy: Type.t} -> t
52 val eq: t * t * Type.t -> t
53 val falsee: t
54 val handlee: {try: t,
55 ty: Type.t,
56 catch: Var.t * Type.t,
57 handler: t} -> t
58 val layout: t -> Layout.t
59 val lett: {decs: {var: Var.t, exp: t} list,
60 body: t} -> t
61 val linearize:
62 t * Return.Handler.t -> Label.t * Block.t list
63 val linearizeGoto:
64 t * Return.Handler.t * Label.t -> Label.t * Block.t list
65 val name: t * (Var.t -> t) -> t
66 val primApp: {args: t vector,
67 prim: Type.t Prim.t,
68 targs: Type.t vector,
69 ty: Type.t} -> t
70 val profile: ProfileExp.t -> t
71 val raisee: t -> t
72 val select: {tuple: t,
73 offset: int,
74 ty: Type.t} -> t
75 val seq: t * t -> t
76 val truee: t
77 val tuple: {exps: t vector, ty: Type.t} -> t
78 val var: Var.t * Type.t -> t
79 val word: WordX.t -> t
80 end
81 end