Skip to content

Commit eceb413

Browse files
committed
reuse existing representation of axis
1 parent b99eac3 commit eceb413

File tree

8 files changed

+227
-258
lines changed

8 files changed

+227
-258
lines changed

ocaml/lambda/translmode.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ let transl_locality_mode_r locality =
2929

3030
let transl_alloc_mode_l mode =
3131
(* we only take the locality axis *)
32-
Alloc.proj_comonadic Locality mode |> transl_locality_mode_l
32+
Alloc.proj_comonadic Areality mode |> transl_locality_mode_l
3333

3434
let transl_alloc_mode_r mode =
3535
(* we only take the locality axis *)
36-
Alloc.proj_comonadic Locality mode |> transl_locality_mode_r
36+
Alloc.proj_comonadic Areality mode |> transl_locality_mode_r
3737

3838
let transl_modify_mode locality =
3939
match Locality.zap_to_floor locality with

ocaml/typing/ctype.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1583,9 +1583,9 @@ let prim_mode mvar = function
15831583
put in [mode.ml] *)
15841584
let with_locality locality m =
15851585
let m' = Alloc.newvar () in
1586-
Locality.equate_exn (Alloc.proj_comonadic Locality m') locality;
1587-
Alloc.submode_exn m' (Alloc.join_with_comonadic Locality Locality.Const.max m);
1588-
Alloc.submode_exn (Alloc.meet_with_comonadic Locality Locality.Const.min m) m';
1586+
Locality.equate_exn (Alloc.proj_comonadic Areality m') locality;
1587+
Alloc.submode_exn m' (Alloc.join_with_comonadic Areality Locality.Const.max m);
1588+
Alloc.submode_exn (Alloc.meet_with_comonadic Areality Locality.Const.min m) m';
15891589
m'
15901590

15911591
let rec instance_prim_locals locals mvar macc finalret ty =

ocaml/typing/env.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2958,7 +2958,7 @@ let lookup_ident_module (type a) (load : a load) ~errors ~use ~loc s env =
29582958
let escape_mode ~errors ~env ~loc id vmode escaping_context =
29592959
match
29602960
Mode.Regionality.submode
2961-
(Mode.Value.proj_comonadic Regionality vmode)
2961+
(Mode.Value.proj_comonadic Areality vmode)
29622962
(Mode.Regionality.global)
29632963
with
29642964
| Ok () -> ()
@@ -2998,7 +2998,7 @@ let closure_mode ~errors ~env ~loc id {Mode.monadic; comonadic}
29982998
let exclave_mode ~errors ~env ~loc id vmode =
29992999
match
30003000
Mode.Regionality.submode
3001-
(Mode.Value.proj_comonadic Regionality vmode)
3001+
(Mode.Value.proj_comonadic Areality vmode)
30023002
Mode.Regionality.regional
30033003
with
30043004
| Ok () -> vmode |> Mode.value_to_alloc_r2l |> Mode.alloc_as_value
@@ -3962,15 +3962,15 @@ let report_lookup_error _loc env ppf = function
39623962
| Value_used_in_closure (lid, error, context) ->
39633963
let e0, e1 =
39643964
match error with
3965-
| Error (Regionality, _) -> "local", "might escape"
3965+
| Error (Areality, _) -> "local", "might escape"
39663966
| Error (Linearity, _) -> "once", "is many"
39673967
in
39683968
fprintf ppf
39693969
"@[The value %a is %s, so cannot be used \
39703970
inside a closure that %s.@]"
39713971
!print_longident lid e0 e1;
39723972
begin match error, context with
3973-
| Error (Regionality, _), Some Tailcall_argument ->
3973+
| Error (Areality, _), Some Tailcall_argument ->
39743974
fprintf ppf "@.@[Hint: The closure might escape because it \
39753975
is an argument to a tail call@]"
39763976
| _ -> ()

0 commit comments

Comments
 (0)