@@ -1446,12 +1446,12 @@ module Generate (Target : Target_sig.S) = struct
14461446 | _ -> false )
14471447 c
14481448 | Special (Alias_prim _ ) -> assert false
1449- | Prim (Extern "caml_alloc_dummy_function" , [ _ ; Pc (Int arity ) ]) ->
1449+ | Prim (Extern ( "caml_alloc_dummy_function" , _ ) , [ _ ; Pc (Int arity ) ]) ->
14501450 (* Removed in OCaml 5.2 *)
14511451 Closure. dummy ~cps: (effects_cps () ) ~arity: (Targetint. to_int_exn arity)
1452- | Prim (Extern "caml_alloc_dummy_infix" , _ ) ->
1452+ | Prim (Extern ( "caml_alloc_dummy_infix" , _ ) , _ ) ->
14531453 Closure. dummy ~cps: (effects_cps () ) ~arity: 1
1454- | Prim (Extern "caml_get_global" , [ Pc (String name ) ]) ->
1454+ | Prim (Extern ( "caml_get_global" , _ ) , [ Pc (String name ) ]) ->
14551455 let * x =
14561456 let * context = get_context in
14571457 match
@@ -1469,7 +1469,7 @@ module Generate (Target : Target_sig.S) = struct
14691469 register_import ~import_module: " OCaml" ~name (Global { mut = true ; typ })
14701470 in
14711471 return (W. GlobalGet x)
1472- | Prim (Extern "caml_set_global" , [ Pc (String name ); v ]) ->
1472+ | Prim (Extern ( "caml_set_global" , _ ) , [ Pc (String name ); v ]) ->
14731473 let v = transl_prim_arg ctx v in
14741474 let x = Var. fresh_n name in
14751475 let * () =
@@ -1491,16 +1491,16 @@ module Generate (Target : Target_sig.S) = struct
14911491 Memory. array_get
14921492 (transl_prim_arg ctx x)
14931493 (transl_prim_arg ctx ~typ: (Int Normalized ) y)
1494- | Prim (Extern "caml_array_unsafe_get" , [ x ; y ]) ->
1494+ | Prim (Extern ( "caml_array_unsafe_get" , _ ) , [ x ; y ]) ->
14951495 Memory. gen_array_get
14961496 (transl_prim_arg ctx x)
14971497 (transl_prim_arg ctx ~typ: (Int Normalized ) y)
14981498 | Prim (p , l ) -> (
14991499 match p with
1500- | Extern name when String.Hashtbl. mem internal_primitives name ->
1500+ | Extern ( name , _ ) when String.Hashtbl. mem internal_primitives name ->
15011501 snd (String.Hashtbl. find internal_primitives name) ctx context l
15021502 |> box_number_if_needed ctx x
1503- | Extern name when String.Hashtbl. mem specialized_primitives name ->
1503+ | Extern ( name , _ ) when String.Hashtbl. mem specialized_primitives name ->
15041504 let ((_, arg_typ, _) as typ ) =
15051505 String.Hashtbl. find specialized_primitives name
15061506 in
@@ -1529,7 +1529,7 @@ module Generate (Target : Target_sig.S) = struct
15291529 | _ -> (
15301530 let l = List. map ~f: (fun x -> transl_prim_arg ctx x) l in
15311531 match p, l with
1532- | Extern name , l ->
1532+ | Extern ( name , _ ) , l ->
15331533 let * f =
15341534 register_import ~name (Fun (Type. primitive_type (List. length l)))
15351535 in
@@ -1542,8 +1542,8 @@ module Generate (Target : Target_sig.S) = struct
15421542 in
15431543 loop [] l
15441544 | IsInt , [ x ] -> Value. is_int x
1545- | Vectlength , [ x ] -> Memory. gen_array_length x
1546- | (Not | Lt | Le | Eq | Neq | Ult | Array_get | IsInt | Vectlength ), _ ->
1545+ | Vectlength _ , [ x ] -> Memory. gen_array_length x
1546+ | (Not | Lt | Le | Eq | Neq | Ult | Array_get | IsInt | Vectlength _ ), _ ->
15471547 assert false ))
15481548
15491549 and translate_instr ctx context i =
@@ -1658,34 +1658,36 @@ module Generate (Target : Target_sig.S) = struct
16581658 ( _
16591659 , Prim
16601660 ( Extern
1661- ( " caml_string_get"
1662- | " caml_bytes_get"
1663- | " caml_string_set"
1664- | " caml_bytes_set"
1665- | " caml_check_bound"
1666- | " caml_check_bound_gen"
1667- | " caml_check_bound_float"
1668- | " caml_ba_get_1"
1669- | " caml_ba_get_2"
1670- | " caml_ba_get_3"
1671- | " caml_ba_get_generic"
1672- | " caml_ba_set_1"
1673- | " caml_ba_set_2"
1674- | " caml_ba_set_3"
1675- | " caml_ba_set_generic" )
1661+ ( ( " caml_string_get"
1662+ | " caml_bytes_get"
1663+ | " caml_string_set"
1664+ | " caml_bytes_set"
1665+ | " caml_check_bound"
1666+ | " caml_check_bound_gen"
1667+ | " caml_check_bound_float"
1668+ | " caml_ba_get_1"
1669+ | " caml_ba_get_2"
1670+ | " caml_ba_get_3"
1671+ | " caml_ba_get_generic"
1672+ | " caml_ba_set_1"
1673+ | " caml_ba_set_2"
1674+ | " caml_ba_set_3"
1675+ | " caml_ba_set_generic" )
1676+ , _ )
16761677 , _ ) ) -> fst n, true
16771678 | Let
16781679 ( _
16791680 , Prim
16801681 ( Extern
1681- ( " %int_div"
1682- | " %int_mod"
1683- | " caml_int32_div"
1684- | " caml_int32_mod"
1685- | " caml_int64_div"
1686- | " caml_int64_mod"
1687- | " caml_nativeint_div"
1688- | " caml_nativeint_mod" )
1682+ ( ( " %int_div"
1683+ | " %int_mod"
1684+ | " caml_int32_div"
1685+ | " caml_int32_mod"
1686+ | " caml_int64_div"
1687+ | " caml_int64_mod"
1688+ | " caml_nativeint_div"
1689+ | " caml_nativeint_mod" )
1690+ , _ )
16891691 , _ ) ) -> true , snd n
16901692 | _ -> n)
16911693 ~init: n
0 commit comments