@@ -20,27 +20,7 @@ open Types
2020open Typedtree
2121open Lambda
2222
23- <<<<<<< janestreet/ merlin- jst:merge- compiler- renaming- changes
2423(* Expand a type, looking through ordinary synonyms, private synonyms, links,
25- ||||||| ocaml-flambda/flambda-backend:60158e06115c6fc6e30325bb720e65acf351dbce
26- type error =
27- Non_value_layout of type_expr * Jkind.Violation.t option
28- | Non_value_sort of Jkind.Sort.t * type_expr
29- | Sort_without_extension of
30- Jkind.Sort.t * Language_extension.maturity * type_expr option
31- | Non_value_sort_unknown_ty of Jkind.Sort.t
32- | Small_number_sort_without_extension of Jkind.Sort.t * type_expr option
33- | Simd_sort_without_extension of Jkind.Sort.t * type_expr option
34- | Not_a_sort of type_expr * Jkind.Violation.t
35- =======
36- type error =
37- Non_value_layout of type_expr * Jkind.Violation.t option
38- | Sort_without_extension of
39- Jkind.Sort.t * Language_extension.maturity * type_expr option
40- | Small_number_sort_without_extension of Jkind.Sort.t * type_expr option
41- | Simd_sort_without_extension of Jkind.Sort.t * type_expr option
42- | Not_a_sort of type_expr * Jkind.Violation.t
43- >>>>>>> ocaml-flambda/flambda-backend:87a4cecacc0e2f9afee93898f81f55b012c69214
4424 and [@@unboxed] types. The returned type will be therefore be none of these
4525 cases (except in case of missing cmis).
4626
@@ -231,26 +211,7 @@ let array_kind_of_elt ~elt_sort env loc ty =
231211 | Some s -> s
232212 | None ->
233213 Jkind.Sort. default_for_transl_and_get
234- <<<<<<< janestreet/ merlin- jst:merge- compiler- renaming- changes
235214 (type_legacy_sort ~why: Array_element env loc ty)
236- ||||||| ocaml- flambda/ flambda- backend:60158e06115 c6fc6e30325bb720e65acf351dbce
237- kinds. * )
238- match s with
239- | Base Value -> Paddr_scannable
240- | Base (Float64 | Float32 | Bits32 | Bits64 | Word | Vec128 ) as c ->
241- raise (Error (loc, Mixed_product_array (c, elt_ty_for_error)))
242- | Base Void as c ->
243- raise (Error (loc, Unsupported_sort c))
244- =======
245- kinds. * )
246- match s with
247- | Base Value -> Paddr_scannable
248- | Base (Float64 | Float32 | Bits32 | Bits64 | Word |
249- Vec128 | Vec256 | Vec512 ) as c ->
250- raise (Error (loc, Mixed_product_array (c, elt_ty_for_error)))
251- | Base Void as c ->
252- raise (Error (loc, Unsupported_sort c))
253- >>>>>>> ocaml- flambda/ flambda- backend:87 a4cecacc0e2f9afee93898f81f55b012c69214
254215 in
255216 let classify_product ty _sorts =
256217 if is_always_gc_ignorable env ty then
@@ -266,24 +227,7 @@ let array_kind_of_elt ~elt_sort env loc ty =
266227 | Unboxed_float f -> Punboxedfloatarray f
267228 | Unboxed_int i -> Punboxedintarray i
268229 | Unboxed_vector v -> Punboxedvectorarray v
269- <<<<<<< janestreet/ merlin- jst:merge- compiler- renaming- changes
270230 | Product c -> c
271- ||||||| ocaml- flambda/ flambda- backend:60158e06115 c6fc6e30325bb720e65acf351dbce
272- | Base Bits32 -> Punboxedint_ignorable Unboxed_int32
273- | Base Bits64 -> Punboxedint_ignorable Unboxed_int64
274- | Base Word -> Punboxedint_ignorable Unboxed_nativeint
275- | Base Vec128 -> raise (Error (loc, Unsupported_vector_in_product_array ))
276- | Base Void as c -> raise (Error (loc, Unsupported_sort c))
277- | Product sorts -> Pproduct_ignorable (ignorable_product_array_kind loc sorts)
278- =======
279- | Base Bits32 -> Punboxedint_ignorable Unboxed_int32
280- | Base Bits64 -> Punboxedint_ignorable Unboxed_int64
281- | Base Word -> Punboxedint_ignorable Unboxed_nativeint
282- | Base (Vec128 | Vec256 | Vec512 ) ->
283- raise (Error (loc, Unsupported_vector_in_product_array ))
284- | Base Void as c -> raise (Error (loc, Unsupported_sort c))
285- | Product sorts -> Pproduct_ignorable (ignorable_product_array_kind loc sorts)
286- >>>>>>> ocaml- flambda/ flambda- backend:87 a4cecacc0e2f9afee93898f81f55b012c69214
287231
288232let array_type_kind ~elt_sort env loc ty =
289233 match scrape_poly env ty with
@@ -1106,29 +1050,3 @@ let rec layout_union l1 l2 =
11061050 _ ->
11071051 Ptop
11081052*)
1109- <<<<<<< janestreet/ merlin- jst:merge- compiler- renaming- changes
1110- ||||||| ocaml- flambda/ flambda- backend:60158e06115 c6fc6e30325bb720e65acf351dbce
1111- (Jkind.Violation. report_with_offender
1112- ~offender: (fun ppf -> Printtyp. type_expr ppf ty)) err
1113- end
1114- | Non_value_sort (sort , ty ) ->
1115- fprintf ppf
1116- " Non-value layout %a detected in [Typeopt.layout] as sort for type@ %a.@ \
1117- Please report this error to the Jane Street compilers team."
1118- Jkind.Sort. format sort Printtyp. type_expr ty
1119- | Non_value_sort_unknown_ty sort ->
1120- fprintf ppf
1121- " Non-value layout %a detected in [layout_of_sort]@ Please report this \
1122- error to the Jane Street compilers team."
1123- Jkind.Sort. format sort
1124- | Sort_without_extension (sort , maturity , ty ) ->
1125- fprintf ppf " Non-value layout %a detected" Jkind.Sort. format sort;
1126- begin match ty with
1127- =======
1128- (Jkind.Violation. report_with_offender
1129- ~offender :(fun ppf -> Printtyp. type_expr ppf ty )) err
1130- end
1131- | Sort_without_extension (sort , maturity , ty ) ->
1132- fprintf ppf "Non-value layout %a detected" Jkind.Sort. format sort ;
1133- begin match ty with
1134- >>>>>>> ocaml -flambda /flambda -backend :87 a4cecacc0e2f9afee93898f81f55b012c69214
0 commit comments