Module Ocaml_typing.PrimitiveSource
type native_repr = | Repr_poly| Same_as_ocaml_repr of Jkind_types.Sort.Const.t| Unboxed_float of boxed_float| Unboxed_vector of boxed_vector| Unboxed_or_untagged_integer of unboxed_or_untagged_integer| Unpacked_product of Jkind_types.Sort.Const.t
Representation of arguments/result for the native code version of a primitive.
Untagged integers (such as int[@untagged]) are represented as Unboxed_integer Untagged_int
type 'repr description_gen = private {prim_name : string;prim_arity : int;prim_alloc : bool;prim_c_builtin : bool;prim_effects : effects;prim_coeffects : coeffects;prim_native_name : string;prim_native_repr_args : (mode * 'repr) list;prim_native_repr_res : mode * 'repr;prim_is_layout_poly : bool;
}make_prim_repr_args n x is the same as List.init n (fun _ -> x). Keeping this function here to be close to upstream. It's intended for use with make.
val parse_declaration :
Ocaml_parsing.Parsetree.value_description ->
native_repr_args:(mode * native_repr) list ->
native_repr_res:(mode * native_repr) ->
is_layout_poly:bool ->
descriptionval equal_unboxed_or_untagged_integer :
unboxed_or_untagged_integer ->
unboxed_or_untagged_integer ->
boolnative_name_is_externa returns true iff the native_name for the given primitive identifies that the primitive is not implemented in the compiler itself.
Check if a primitive has the correct native representations for its argument/return types. This check is done based on the primitive name and only imposes constraints on built-in primitives. Raises if the check fails.
Check if a primitive can have layout any anywhere within its type declaration. Returns false for built-in primitives that inspect the layout of type parameters (%array_length for example).
type error = | Old_style_float_with_native_repr_attribute| Old_style_float_with_non_value| Old_style_noalloc_with_noalloc_attribute| No_native_primitive_with_repr_attribute| No_native_primitive_with_non_value| Inconsistent_attributes_for_effects| Inconsistent_noalloc_attributes_for_effects| Invalid_representation_polymorphic_attribute| Invalid_native_repr_for_primitive of {prim_name : string;errors : wrong_repr_error list;
}