Skip to content

Commit bd4ce4a

Browse files
authored
flambda-backend: Revert "Semaphore without probes: dummy notes (#142)" (#242)
This reverts commit 8c9bf5e.
1 parent c98530f commit bd4ce4a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

typing/typecore.ml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ type error =
124124
| Probe_format
125125
| Probe_name_too_long of string
126126
| Probe_name_format of string
127+
| Probe_name_undefined of string
127128
| Probe_is_enabled_format
128129
| Literal_overflow of string
129130
| Unknown_literal of string * char
@@ -3752,6 +3753,10 @@ and type_expect_
37523753
_ } ,
37533754
_)}]) ->
37543755
check_probe_name name name_loc env;
3756+
add_delayed_check
3757+
(fun () ->
3758+
if not (Env.has_probe name) then
3759+
raise(Error(name_loc, env, (Probe_name_undefined name))));
37553760
rue {
37563761
exp_desc = Texp_probe_is_enabled {name};
37573762
exp_loc = loc; exp_extra = [];
@@ -5601,6 +5606,11 @@ let report_error ~loc env = function
56015606
Probe names may only contain alphanumeric characters or \
56025607
underscores."
56035608
name
5609+
| Probe_name_undefined name ->
5610+
Location.errorf ~loc
5611+
"Undefined probe name `%s' used in %%probe_is_enabled. \
5612+
Not found [%%probe \"%s\" ...] in the same compilation unit."
5613+
name name
56045614
| Probe_format ->
56055615
Location.errorf ~loc
56065616
"Probe points must consist of a name, as a string \

typing/typecore.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ type error =
181181
| Probe_format
182182
| Probe_name_too_long of string
183183
| Probe_name_format of string
184+
| Probe_name_undefined of string
184185
(* CR-soon mshinwell: Use an inlined record *)
185186
| Probe_is_enabled_format
186187
| Literal_overflow of string

0 commit comments

Comments
 (0)