-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasicblock.mli
81 lines (77 loc) · 2.43 KB
/
basicblock.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
module M :
sig
type key = Id.l
type +'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge :
(key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val max_binding : 'a t -> key * 'a
val choose : 'a t -> key * 'a
val split : key -> 'a t -> 'a t * 'a option * 'a t
val find : key -> 'a t -> 'a
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
end
type ins =
Let of (Id.t * VirtualAsm.ty) * ins
| Entry
| Ret
| Jump of Id.l
| Label of Id.l
| Nop
| Set of VirtualAsm.literal
| Mov of VirtualAsm.id_or_imm
| Neg of Id.t
| Add of Id.t * VirtualAsm.id_or_imm
| Sub of Id.t * VirtualAsm.id_or_imm
| Mul of Id.t * VirtualAsm.id_or_imm
| Div of Id.t * VirtualAsm.id_or_imm
| SLL of Id.t * VirtualAsm.id_or_imm
| SLR of Id.t * VirtualAsm.id_or_imm
| Ld of VirtualAsm.mem_op
| St of Id.t * VirtualAsm.mem_op
| FMov of Id.t
| FNeg of Id.t
| FAdd of Id.t * Id.t
| FSub of Id.t * Id.t
| FMul of Id.t * Id.t
| FDiv of Id.t * Id.t
| FLd of VirtualAsm.mem_op
| FSt of Id.t * VirtualAsm.mem_op
| BLd of VirtualAsm.mem_op
| BSt of Id.t * VirtualAsm.mem_op
| Comp of VirtualAsm.cmp_op * VirtualAsm.ty * Id.t * VirtualAsm.id_or_imm
| If of ins * Id.l * Id.l
| ApplyCls of (Id.t * VirtualAsm.ty) * Id.t list
| ApplyDir of (Id.l * VirtualAsm.ty) * Id.t list
| Cons of Id.t * Id.t
| Car of Id.t
| Cdr of Id.t
| FCons of Id.t * Id.t
| FCar of Id.t
| FCdr of Id.t
| TupleAlloc of (Id.t * VirtualAsm.ty) list
| ArrayAlloc of VirtualAsm.ty * Id.t
type fundef = {
name : Id.l;
args : (Id.t * VirtualAsm.ty) list;
body : ins list M.t;
ret : VirtualAsm.ty;
}
val f : VirtualAsm.fundef list -> fundef list