summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bytecomp/lambda.ml6
-rw-r--r--bytecomp/lambda.mli5
-rw-r--r--bytecomp/simplif.ml2
-rw-r--r--bytecomp/translcore.ml4
4 files changed, 3 insertions, 14 deletions
diff --git a/bytecomp/lambda.ml b/bytecomp/lambda.ml
index d6f91ef0b1..7c9e44a54e 100644
--- a/bytecomp/lambda.ml
+++ b/bytecomp/lambda.ml
@@ -496,12 +496,6 @@ let next_raise_count () =
incr raise_count ;
!raise_count
-let negative_raise_count = ref 0
-
-let next_negative_raise_count () =
- decr negative_raise_count ;
- !negative_raise_count
-
(* Anticipated staticraise, for guards *)
let staticfail = Lstaticraise (0,[])
diff --git a/bytecomp/lambda.mli b/bytecomp/lambda.mli
index fef608d4a7..d3c81f8890 100644
--- a/bytecomp/lambda.mli
+++ b/bytecomp/lambda.mli
@@ -354,11 +354,6 @@ val default_stub_attribute : function_attribute
(* Get a new static failure ident *)
val next_raise_count : unit -> int
-val next_negative_raise_count : unit -> int
- (* Negative raise counts are used to compile 'match ... with
- exception x -> ...'. This disabled some simplifications
- performed by the Simplif module that assume that static raises
- are in tail position in their handler. *)
val staticfail : lambda (* Anticipated static failure *)
diff --git a/bytecomp/simplif.ml b/bytecomp/simplif.ml
index 074ff5ccea..954377b8cc 100644
--- a/bytecomp/simplif.ml
+++ b/bytecomp/simplif.ml
@@ -282,7 +282,7 @@ let simplify_exits lam =
if count = 0 then
(* Discard staticcatch: not matching exit *)
simplif l1
- else if i >= 0 && count = 1 && max_depth <= !try_depth then begin
+ else if count = 1 && max_depth <= !try_depth then begin
(* Inline handler if there is a single occurrence and it is not
nested within an inner try..with *)
assert(max_depth = !try_depth);
diff --git a/bytecomp/translcore.ml b/bytecomp/translcore.ml
index 216601e016..22eee67312 100644
--- a/bytecomp/translcore.ml
+++ b/bytecomp/translcore.ml
@@ -1021,7 +1021,7 @@ and transl_exp0 e =
| `Constant_or_function ->
(* a constant expr of type <> float gets compiled as itself *)
transl_exp e
- | `Float ->
+ | `Float ->
(* We don't need to wrap with Popaque: this forward
block will never be shortcutted since it points to a float. *)
Lprim(Pmakeblock(Obj.forward_tag, Immutable, None),
@@ -1347,7 +1347,7 @@ and transl_match e arg pat_expr_list exn_pat_expr_list partial =
and cases = transl_cases pat_expr_list
and exn_cases = transl_cases_try exn_pat_expr_list in
let static_catch body val_ids handler =
- let static_exception_id = next_negative_raise_count () in
+ let static_exception_id = next_raise_count () in
Lstaticcatch
(Ltrywith (Lstaticraise (static_exception_id, body), id,
Matching.for_trywith (Lvar id) exn_cases),