Skip to content

Commit 6f02ad0

Browse files
authored
flambda-backend: Use "unboxable" as the name of the best-effort unboxing attribute (#2319)
1 parent ee1d25d commit 6f02ad0

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lambda/printlambda.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ let rec lam ppf = function
944944
let { unbox_param } = p.attributes in
945945
fprintf ppf "@ %a%s%a%s"
946946
Ident.print p.name (alloc_kind p.mode) layout p.layout
947-
(if unbox_param then "[@unboxed]" else "")
947+
(if unbox_param then "[@unboxable]" else "")
948948
) params
949949
| Tupled ->
950950
fprintf ppf " (";
@@ -956,7 +956,7 @@ let rec lam ppf = function
956956
Ident.print ppf p.name;
957957
Format.fprintf ppf "%s" (alloc_kind p.mode);
958958
layout ppf p.layout;
959-
if unbox_param then Format.fprintf ppf "[@unboxed]"
959+
if unbox_param then Format.fprintf ppf "[@unboxable]"
960960
)
961961
params;
962962
fprintf ppf ")" in

lambda/translattribute.ml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ let is_loop_attribute =
5353
let is_opaque_attribute =
5454
[ ["opaque"; "ocaml.opaque"], true ]
5555

56-
let is_unboxed_attribute =
57-
[ ["unboxed"; "ocaml.unboxed"], true ]
56+
let is_unboxable_attribute =
57+
[ ["unboxable"; "ocaml.unboxable"], true ]
5858

5959
let find_attribute ?mark_used p attributes =
6060
let inline_attribute =
@@ -591,13 +591,13 @@ let add_opaque_attribute expr loc attributes =
591591
let add_unbox_return_attribute expr loc attributes =
592592
match expr with
593593
| Lfunction funct ->
594-
let attr = find_attribute is_unboxed_attribute attributes in
594+
let attr = find_attribute is_unboxable_attribute attributes in
595595
begin match attr with
596596
| None -> expr
597597
| Some _ ->
598598
if funct.attr.unbox_return then
599599
Location.prerr_warning loc
600-
(Warnings.Duplicated_attribute "unboxed");
600+
(Warnings.Duplicated_attribute "unboxable");
601601
let attr = { funct.attr with unbox_return = true } in
602602
lfunction_with_attr ~attr funct
603603
end
@@ -676,8 +676,8 @@ let add_function_attributes lam loc attr =
676676
lam
677677

678678
let transl_param_attributes pat =
679-
let attrs = pat.pat_attributes in
680-
let unbox_param =
681-
Option.is_some (find_attribute is_unboxed_attribute attrs)
682-
in
683-
{ unbox_param }
679+
let attrs = pat.pat_attributes in
680+
let unbox_param =
681+
Option.is_some (find_attribute is_unboxable_attribute attrs)
682+
in
683+
{ unbox_param }

0 commit comments

Comments
 (0)