Skip to content

Commit 889c081

Browse files
authored
flambda-backend: Zero alloc: add "assume error" (#2501)
* "error" as an alias for "never_returns_normally" * Add a test * Update text of error messages * Add a comment to the test
1 parent 63a3c0b commit 889c081

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

parsing/builtin_attributes.ml

+5
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,10 @@ let zero_alloc_lookup_table =
847847
fun arity loc ->
848848
Assume { property; strict = true; never_returns_normally = true;
849849
arity; loc; });
850+
(["assume"; "error"],
851+
fun arity loc ->
852+
Assume { property; strict = false; never_returns_normally = true;
853+
arity; loc; });
850854
(["ignore"], fun _ _ -> Ignore_assert_all property)
851855
]
852856

@@ -930,6 +934,7 @@ let assume_zero_alloc ~is_check_allowed check : Zero_alloc_utils.Assume_info.t =
930934
let msg = "Only the following combinations are supported in this context: \
931935
'zero_alloc assume', \
932936
`zero_alloc assume strict`, \
937+
`zero_alloc assume error`,\
933938
`zero_alloc assume never_returns_normally`,\
934939
`zero_alloc assume never_returns_normally strict`."
935940
in

0 commit comments

Comments
 (0)