@@ -231,7 +231,7 @@ end = struct
231
231
let y = y.Let_binding. var in
232
232
let open (val Lambda_utils. int_ops ~loc ) in
233
233
let product =
234
- Let_binding. make (Immutable Alias) Pintval "product" (x * y )
234
+ Let_binding. make (Immutable Alias) (Pvalue Pintval) "product" (x * y )
235
235
in
236
236
(* [x * y] is safe, for strictly positive [x] and [y], iff you can undo the
237
237
multiplication: [(x * y)/y = x]. We assume the inputs are values, so we
@@ -240,7 +240,7 @@ end = struct
240
240
(Lifthenelse(product .var / y = x ,
241
241
product .var ,
242
242
raise_overflow_exn ~loc ,
243
- Pintval))
243
+ Pvalue Pintval))
244
244
245
245
(* * [safe_product_pos_vals ~loc xs] generates the lambda expression that
246
246
computes the product of all the lambda values in [xs] assuming they are
@@ -260,7 +260,7 @@ end = struct
260
260
variables, but we assume the optimizer can deal with that case nicely. *)
261
261
let safe_product_pos ?(variable_name = " x" ) ~loc factors =
262
262
let factors =
263
- List. map (Let_binding. make (Immutable Strict) Pintval
263
+ List. map (Let_binding. make (Immutable Strict) (Pvalue Pintval)
264
264
variable_name ) factors
265
265
in
266
266
Let_binding. let_all factors (safe_product_pos_vals ~loc factors )
@@ -366,7 +366,7 @@ module Iterator_bindings = struct
366
366
(* We can assume that the range is nonempty, but computing its size
367
367
still might overflow *)
368
368
let range_size =
369
- Let_binding. make (Immutable Alias) Pintval
369
+ Let_binding. make (Immutable Alias) (Pvalue Pintval)
370
370
"range_size" (high - low + l1 )
371
371
in
372
372
Let_binding. let_one range_size
@@ -375,7 +375,7 @@ module Iterator_bindings = struct
375
375
(Lifthenelse(range_size .var > l0 ,
376
376
range_size .var ,
377
377
Precompute_array_size. raise_overflow_exn ~loc ,
378
- Pintval))
378
+ Pvalue Pintval))
379
379
| Array { iter_arr = _ ; iter_len } ->
380
380
iter_len .var
381
381
@@ -445,7 +445,7 @@ let iterator ~transl_exp ~scopes ~loc
445
445
= function
446
446
| Texp_comp_range { ident; pattern = _ ; start; stop; direction } ->
447
447
let bound name value =
448
- Let_binding. make (Immutable Strict) Pintval
448
+ Let_binding. make (Immutable Strict) (Pvalue Pintval)
449
449
name (transl_exp ~scopes value )
450
450
in
451
451
let start = bound "start" start in
@@ -463,14 +463,14 @@ let iterator ~transl_exp ~scopes ~loc
463
463
; direction }
464
464
| Texp_comp_in { pattern; sequence = iter_arr_exp } ->
465
465
let iter_arr =
466
- Let_binding. make (Immutable Strict) Pgenval
466
+ Let_binding. make (Immutable Strict) (Pvalue Pgenval)
467
467
"iter_arr" (transl_exp ~scopes iter_arr_exp )
468
468
in
469
469
let iter_arr_kind = Typeopt. array_kind iter_arr_exp in
470
470
let iter_len =
471
471
(* Extra let-binding if we're not in the fixed-size array case; the
472
472
middle-end will simplify this for us *)
473
- Let_binding. make (Immutable Alias) Pintval
473
+ Let_binding. make (Immutable Alias) (Pvalue Pintval)
474
474
"iter_len"
475
475
(Lprim(Parraylength iter_arr_kind , [iter_arr .var ], loc ))
476
476
in
@@ -491,7 +491,7 @@ let iterator ~transl_exp ~scopes ~loc
491
491
[iter_arr .var ; Lvar iter_ix ],
492
492
loc ))
493
493
pattern
494
- Pintval
494
+ (Pvalue Pintval)
495
495
body
496
496
}
497
497
in
@@ -542,7 +542,7 @@ let clause ~transl_exp ~scopes ~loc = function
542
542
fun body -> Lifthenelse(transl_exp ~scopes cond ,
543
543
body ,
544
544
lambda_unit ,
545
- Pintval (* [unit] is immediate *) )
545
+ (Pvalue Pintval) (* [unit] is immediate *) )
546
546
547
547
(* * The [array_sizing] type describes whether an array comprehension has been
548
548
translated using the fixed-size array optimization ([Fixed_size]), or it has
@@ -614,7 +614,7 @@ let clauses ~transl_exp ~scopes ~loc = function
614
614
for_and_clause ~transl_exp ~loc ~scopes bindings
615
615
in
616
616
let array_size =
617
- Let_binding. make (Immutable Alias) Pintval
617
+ Let_binding. make (Immutable Alias) (Pvalue Pintval)
618
618
"array_size"
619
619
(Iterator_bindings.Fixed_size_array. total_size_nonempty
620
620
~loc var_bindings )
@@ -625,7 +625,7 @@ let clauses ~transl_exp ~scopes ~loc = function
625
625
}
626
626
| clauses ->
627
627
let array_size =
628
- Let_binding. make Mutable Pintval
628
+ Let_binding. make Mutable (Pvalue Pintval)
629
629
"array_size" (int Resizable_array. starting_size )
630
630
in
631
631
let make_comprehension =
@@ -696,7 +696,7 @@ let initial_array ~loc ~array_kind ~array_size ~array_sizing =
696
696
| Dynamic_size, Pfloatarray ->
697
697
Mutable, Resizable_array. make ~loc array_kind (float 0. )
698
698
in
699
- Let_binding. make array_let_kind Pgenval "array" array_value
699
+ Let_binding. make array_let_kind (Pvalue Pgenval) "array" array_value
700
700
701
701
(* * Generate the code for the body of an array comprehension. This involves
702
702
translating the body expression (a [Typedtree.expression], which is the
@@ -763,14 +763,14 @@ let body
763
763
Lassign(array_size .id , i 2 * array_size .var ),
764
764
Lassign(array .id ,
765
765
Resizable_array. double ~loc array .var )),
766
- Pintval (* [unit] is immediate *) ),
766
+ (Pvalue Pintval) (* [unit] is immediate *) ),
767
767
(* ...and then set the element now that the array is big enough *)
768
768
set_element_raw elt )
769
769
in
770
770
let set_element_known_kind_in_bounds = match array_kind with
771
771
| Pgenarray ->
772
772
let is_first_iteration = (index .var = l0 ) in
773
- let elt = Let_binding. make (Immutable Strict) Pgenval "elt" body in
773
+ let elt = Let_binding. make (Immutable Strict) (Pvalue Pgenval) "elt" body in
774
774
let make_array = match array_sizing with
775
775
| Fixed_size ->
776
776
make_vect ~loc ~length :array_size .var ~init :elt .var
@@ -781,7 +781,7 @@ let body
781
781
(Lifthenelse(is_first_iteration ,
782
782
Lassign(array .id , make_array ),
783
783
set_element_in_bounds elt .var ,
784
- Pintval (* [unit] is immediate *) ))
784
+ (Pvalue Pintval) (* [unit] is immediate *) ))
785
785
| Pintarray | Paddrarray | Pfloatarray ->
786
786
set_element_in_bounds body
787
787
in
@@ -801,7 +801,7 @@ let comprehension
801
801
let array =
802
802
initial_array ~loc ~array_kind ~array_size ~array_sizing
803
803
in
804
- let index = Let_binding. make Mutable Pintval "index" (int 0 ) in
804
+ let index = Let_binding. make Mutable (Pvalue Pintval) "index" (int 0 ) in
805
805
(* The core of the comprehension : the array, the index, and the iteration that
806
806
fills everything in. The translation of the clauses will produce a check
807
807
to see if we can avoid doing the hard work of growing the array, which is
@@ -848,6 +848,6 @@ let comprehension
848
848
can use [Pgenarray] to create the empty array above but still
849
849
use [array_kind] here. Is that right? * )
850
850
(* (And the result has the [value_kind] of the array) *)
851
- Parrayval array_kind ))
851
+ (Pvalue ( Parrayval array_kind )) ))
852
852
| Dynamic_size_info ->
853
853
comprehension
0 commit comments