Skip to content

Rename "layout" to "kynd" #1875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/cmmgen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,13 @@ let is_strict : kind_for_unboxing -> bool = function
(* [exttype_of_sort] and [machtype_of_sort] should be kept in sync with
[Typeopt.layout_of_const_sort]. *)
(* CR layouts v5: Void case should probably be typ_void *)
let exttype_of_sort (s : Layouts.Sort.const) =
let exttype_of_sort (s : Jkind.Sort.const) =
match s with
| Value -> XInt
| Float64 -> XFloat
| Void -> Misc.fatal_error "Cmmgen.exttype_of_sort: void encountered"

let machtype_of_sort (s : Layouts.Sort.const) =
let machtype_of_sort (s : Jkind.Sort.const) =
match s with
| Value -> typ_val
| Float64 -> typ_float
Expand Down
32 changes: 16 additions & 16 deletions chamelon/compat.jst.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ open Typedtree
open Types
open Mode

let dummy_layout = Layouts.Layout.value ~why:Type_argument
let dummy_jkind = Jkind.value ~why:Type_argument
let dummy_value_mode = Value.legacy
let mkTvar name = Tvar { name; layout = dummy_layout }
let mkTvar name = Tvar { name; jkind = dummy_jkind }

let mkTarrow (label, t1, t2, comm) =
Tarrow ((label, Alloc.legacy, Alloc.legacy), t1, t2, comm)
Expand Down Expand Up @@ -43,8 +43,8 @@ type texp_function_identifier = {
region : bool;
curry : fun_curry_state;
warnings : Warnings.state;
arg_sort : Layouts.sort;
ret_sort : Layouts.sort;
arg_sort : Jkind.sort;
ret_sort : Jkind.sort;
}

let texp_function_defaults =
Expand All @@ -55,8 +55,8 @@ let texp_function_defaults =
region = false;
curry = Final_arg { partial_mode = Alloc.legacy };
warnings = Warnings.backup ();
arg_sort = Layouts.Sort.value;
ret_sort = Layouts.Sort.value;
arg_sort = Jkind.Sort.value;
ret_sort = Jkind.Sort.value;
}

let mkTexp_function ?(id = texp_function_defaults)
Expand All @@ -76,14 +76,14 @@ let mkTexp_function ?(id = texp_function_defaults)
ret_sort = id.ret_sort;
}

type texp_sequence_identifier = Layouts.sort
type texp_sequence_identifier = Jkind.sort

let mkTexp_sequence ?id:(sort = Layouts.Sort.value) (e1, e2) =
let mkTexp_sequence ?id:(sort = Jkind.Sort.value) (e1, e2) =
Texp_sequence (e1, sort, e2)

type texp_match_identifier = Layouts.sort
type texp_match_identifier = Jkind.sort

let mkTexp_match ?id:(sort = Layouts.Sort.value) (e, cases, partial) =
let mkTexp_match ?id:(sort = Jkind.Sort.value) (e, cases, partial) =
Texp_match (e, sort, cases, partial)

type matched_expression_desc =
Expand Down Expand Up @@ -180,9 +180,9 @@ let view_tpat (type a) (p : a pattern_desc) : a matched_pattern_desc =
| Tpat_array (mut, l) -> Tpat_array (l, mut)
| _ -> O p

type tstr_eval_identifier = Layouts.sort
type tstr_eval_identifier = Jkind.sort

let mkTstr_eval ?id:(sort = Layouts.Sort.value) (e, attrs) =
let mkTstr_eval ?id:(sort = Jkind.Sort.value) (e, attrs) =
Tstr_eval (e, sort, attrs)

type matched_structure_item_desc =
Expand All @@ -194,9 +194,9 @@ let view_tstr (si : structure_item_desc) =
| Tstr_eval (e, sort, attrs) -> Tstr_eval (e, attrs, sort)
| _ -> O si

type arg_identifier = Layouts.sort
type arg_identifier = Jkind.sort

let mkArg ?id:(sort = Layouts.Sort.value) e = Arg (e, sort)
let mkArg ?id:(sort = Jkind.Sort.value) e = Arg (e, sort)

let map_arg_or_omitted f arg =
match arg with Arg (e, sort) -> Arg (f e, sort) | Omitted o -> Omitted o
Expand All @@ -223,7 +223,7 @@ let mk_constructor_description cstr_name =
cstr_attributes = [];
cstr_inlined = None;
cstr_uid = Uid.internal_not_actually_unique;
cstr_arg_layouts = [||];
cstr_arg_jkinds = [||];
cstr_repr = Variant_boxed [||];
cstr_constant = true;
}
Expand All @@ -234,7 +234,7 @@ let mk_value_binding ~vb_pat ~vb_expr ~vb_attributes =
vb_expr;
vb_attributes;
vb_loc = Location.none;
vb_sort = Layouts.Sort.value;
vb_sort = Jkind.Sort.value;
}

let mkTtyp_any = Ttyp_var (None, None)
Expand Down
2 changes: 1 addition & 1 deletion native_toplevel/opttopdirs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ let match_printer_type ppf desc typename =
raise Exit
in
Ctype.begin_def();
let ty_arg = Ctype.newvar (Layouts.Layout.value ~why:Debug_printer_argument) in
let ty_arg = Ctype.newvar (Jkind.value ~why:Debug_printer_argument) in
Ctype.unify !toplevel_env
(Ctype.newconstr printer_type [ty_arg])
(Ctype.instance desc.val_type);
Expand Down
Loading