Skip to content

Commit bafd8a7

Browse files
authored
flambda-backend: Turn the (most mature) layouts extension on by default (#2241)
1 parent da5210d commit bafd8a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+9109
-9129
lines changed

boot/menhir/parser.ml

Lines changed: 8989 additions & 8988 deletions
Large diffs are not rendered by default.

parsing/parse.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ let prepare_error err =
147147
@{<hint>Hint@}: Mutable sequences of bytes are available in \
148148
the Bytes module.\n\
149149
@{<hint>Hint@}: Did you mean to use 'Bytes.set'?"
150+
| Missing_unboxed_literal_suffix loc ->
151+
Location.errorf ~loc
152+
"Syntax error: Unboxed integer literals require width suffixes."
150153

151154
let () =
152155
Location.register_error_of_exn

parsing/parser.mly

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,8 @@ let unboxed_int sloc int_loc sign (n, m) =
992992
Constant.unboxed ~loc:int_loc (Integer (with_sign sign n, m))
993993
| None ->
994994
if Language_extension.is_enabled unboxed_literals_extension then
995-
expecting int_loc "unboxed integer literal with type-specifying suffix"
995+
raise
996+
Syntaxerr.(Error(Missing_unboxed_literal_suffix (make_loc int_loc)))
996997
else
997998
not_expecting sloc "line number directive"
998999

parsing/syntaxerr.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type error =
2525
| Ill_formed_ast of Location.t * string
2626
| Invalid_package_type of Location.t * string
2727
| Removed_string_set of Location.t
28+
| Missing_unboxed_literal_suffix of Location.t
2829

2930
exception Error of error
3031
exception Escape_error
@@ -39,6 +40,7 @@ let location_of_error = function
3940
| Invalid_package_type (l, _)
4041
| Expecting (l, _)
4142
| Removed_string_set l -> l
43+
| Missing_unboxed_literal_suffix l -> l
4244

4345

4446
let ill_formed_ast loc s =

parsing/syntaxerr.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ type error =
3030
| Ill_formed_ast of Location.t * string
3131
| Invalid_package_type of Location.t * string
3232
| Removed_string_set of Location.t
33+
| Missing_unboxed_literal_suffix of Location.t
3334

3435
exception Error of error
3536
exception Escape_error

testsuite/tests/letrec-check/unboxed.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
(* TEST
2-
flags = '-extension layouts'
32
* expect
43
*)
5-
(* CR layouts: Using [-extension layouts] here is not backward-compatible.
4+
(* CR layouts: Using layout annotations here is not backward-compatible.
65
We can delete this when internal ticket 1110 is resolved.
76
*)
87

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
File "pr6604.ml", line 9, characters 0-2:
22
9 | #1
33
^^
4-
Error: Syntax error: line number directive not expected.
4+
Error: Syntax error: Unboxed integer literals require width suffixes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
File "pr6604_2.ml", line 9, characters 1-3:
22
9 | #1 "pr6604.ml"
33
^^
4-
Error: Syntax error: line number directive not expected.
4+
Error: Syntax error: Unboxed integer literals require width suffixes.

testsuite/tests/typing-layouts-bits32/alloc.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(* TEST
22
* flambda2
3-
flags = "-extension layouts"
43
** native
54
*)
65

testsuite/tests/typing-layouts-bits32/basics.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
(* TEST
2+
* expect
23
* expect
34
flags = "-extension layouts_alpha"
45
* expect
56
flags = "-extension layouts_beta"
6-
* expect
7-
flags = "-extension layouts"
87
*)
98

109
(* This file contains typing tests for the layout [bits32].

0 commit comments

Comments
 (0)