Module Complex_shape
module RS = Runtime_shapemodule Layout = Jkind_types.Sort.ConstComplex shape types.
Complex shapes represent type layouts that may include unboxed products and void types, in addition to "simple" runtime shapes that fit in a single register. The term "complex" follows Flambda 2's naming convention (see Flambda_arity.Component_for_creation in middle_end/flambda2/kinds), where "complex" arities can contain unboxed products, as opposed to "singleton" arities that describe single-register values.
A complex shape can be:
Runtime rs: A runtime shape that has a concrete runtime representationVoid: A value with no runtime representationUnboxed_product: A composite structure containing multiple components, each of which is itself a complex shape
Complex shapes are used during DWARF type generation to accurately describe OxCaml types with unboxed layouts before they are flattened into sequences of runtime shapes.
and desc = private | Runtime of RS.t| Void| Unboxed_product of {kind : unboxed_product_kind;components : t list;
}
val void : tval print : Format.formatter -> t -> unitval hash : t -> intExtract the runtime shape from a complex shape, if it is a simple runtime shape. Returns None for Void and Unboxed_product variants.
val flatten_complex_shape : t -> RS.t RS.Or_void.t listFlatten a complex shape into a list of runtime shapes and voids. Can be used to simulate the effect of unarization on function arguments.
module Shape_cache : sig ... endCache for memoizing type_shape_to_complex_shape results.
val type_shape_to_complex_shape :
cache:Shape_cache.t ->
Type_shape.Evaluated_shape.t ->
Layout.t ->
tConvert an evaluated type shape and layout to a complex shape for DWARF type generation.