1
1
open Typedtree
2
2
open Types
3
+ open Mode
3
4
4
5
let dummy_layout = Layouts.Layout. value ~why: Type_argument
5
- let dummy_value_mode = { r_as_l = Amode Global ; r_as_g = Amode Global }
6
+ let dummy_value_mode = Value. legacy
6
7
let mkTvar name = Tvar { name; layout = dummy_layout }
7
8
8
9
let mkTarrow (label , t1 , t2 , comm ) =
9
- Tarrow ((label, Amode Global , Amode Global ), t1, t2, comm)
10
+ Tarrow ((label, Alloc. legacy, Alloc. legacy ), t1, t2, comm)
10
11
11
- type texp_ident_identifier = ident_kind
12
+ type texp_ident_identifier = ident_kind * unique_use
12
13
13
- let mkTexp_ident ?id :(ident_kind = Id_value ) (path, longident, vd) =
14
- Texp_ident (path, longident, vd, ident_kind)
14
+ let mkTexp_ident ?id :(ident_kind, uu = (Id_value , shared_many_use))
15
+ (path, longident, vd) =
16
+ Texp_ident (path, longident, vd, ident_kind, uu)
15
17
16
18
type nonrec apply_arg = apply_arg
17
- type texp_apply_identifier = apply_position * alloc_mode
19
+ type texp_apply_identifier = apply_position * Locality .t
18
20
19
- let mkTexp_apply ?id :(pos, mode = (Default , Amode Global )) (exp, args) =
21
+ let mkTexp_apply ?id :(pos, mode = (Default , Locality. legacy )) (exp, args) =
20
22
Texp_apply (exp, args, pos, mode)
21
23
22
- type texp_tuple_identifier = alloc_mode
24
+ type texp_tuple_identifier = Alloc .t
23
25
24
- let mkTexp_tuple ?id :(mode = Amode Global ) exps = Texp_tuple (exps, mode)
26
+ let mkTexp_tuple ?id :(mode = Alloc. legacy ) exps = Texp_tuple (exps, mode)
25
27
26
- type texp_construct_identifier = alloc_mode option
28
+ type texp_construct_identifier = Alloc .t option
27
29
28
- let mkTexp_construct ?id :(mode = Some ( Amode Global ) ) (name, desc, args) =
30
+ let mkTexp_construct ?id :(mode = Some Alloc. legacy ) (name, desc, args) =
29
31
Texp_construct (name, desc, args, mode)
30
32
31
33
type texp_function = {
@@ -36,8 +38,8 @@ type texp_function = {
36
38
37
39
type texp_function_identifier = {
38
40
partial : partial ;
39
- arg_mode : alloc_mode ;
40
- alloc_mode : alloc_mode ;
41
+ arg_mode : Alloc .t ;
42
+ alloc_mode : Alloc .t ;
41
43
region : bool ;
42
44
curry : fun_curry_state ;
43
45
warnings : Warnings .state ;
@@ -48,10 +50,10 @@ type texp_function_identifier = {
48
50
let texp_function_defaults =
49
51
{
50
52
partial = Total ;
51
- arg_mode = Amode Global ;
52
- alloc_mode = Amode Global ;
53
+ arg_mode = Alloc. legacy ;
54
+ alloc_mode = Alloc. legacy ;
53
55
region = false ;
54
- curry = Final_arg { partial_mode = Amode Global };
56
+ curry = Final_arg { partial_mode = Alloc. legacy };
55
57
warnings = Warnings. backup () ;
56
58
arg_sort = Layouts.Sort. value;
57
59
ret_sort = Layouts.Sort. value;
@@ -106,8 +108,8 @@ type matched_expression_desc =
106
108
107
109
let view_texp (e : expression_desc ) =
108
110
match e with
109
- | Texp_ident (path , longident , vd , ident_kind ) ->
110
- Texp_ident (path, longident, vd, ident_kind)
111
+ | Texp_ident (path , longident , vd , ident_kind , uu ) ->
112
+ Texp_ident (path, longident, vd, ( ident_kind, uu) )
111
113
| Texp_apply (exp , args , pos , mode ) -> Texp_apply (exp, args, (pos, mode))
112
114
| Texp_construct (name , desc , args , mode ) ->
113
115
Texp_construct (name, desc, args, mode)
@@ -142,12 +144,12 @@ let view_texp (e : expression_desc) =
142
144
| Texp_match (e , sort , cases , partial ) -> Texp_match (e, cases, partial, sort)
143
145
| _ -> O e
144
146
145
- type tpat_var_identifier = value_mode
147
+ type tpat_var_identifier = Value .t
146
148
147
149
let mkTpat_var ?id :(mode = dummy_value_mode) (ident, name) =
148
150
Tpat_var (ident, name, mode)
149
151
150
- type tpat_alias_identifier = value_mode
152
+ type tpat_alias_identifier = Value .t
151
153
152
154
let mkTpat_alias ?id :(mode = dummy_value_mode) (p, ident, name) =
153
155
Tpat_alias (p, ident, name, mode)
0 commit comments