Remove unconditional optimisation on exceptions compilation

This should be handled at a different level
This commit is contained in:
Louis Gesbert 2023-07-04 17:16:09 +02:00
parent 8920564f9e
commit fcb2d08983
2 changed files with 1 additions and 10 deletions

View File

@ -64,15 +64,6 @@ and translate_expr (ctx : 'm ctx) (e : 'm D.expr) : 'm A.expr boxed =
Expr.ecatch (translate_expr ctx arg) EmptyError
(Expr.eraise NoValueProvided m)
m
| EDefault { excepts = [exn]; just; cons }
(* Specific optimisation for this case *) ->
(* FIXME: this case used to be disabled when optimisations are disabled, but
the flag isn't forwarded to this function *)
Expr.ecatch (translate_expr ctx exn) EmptyError
(Expr.eifthenelse (translate_expr ctx just) (translate_expr ctx cons)
(Expr.eraise EmptyError (Mark.get e))
(Mark.get e))
(Mark.get e)
| EDefault { excepts; just; cons } ->
translate_default ctx excepts just cons (Mark.get e)
| EOp { op; tys } -> Expr.eop (Operator.translate op) tys m

View File

@ -238,7 +238,6 @@ module Op = struct
| Map : < polymorphic ; .. > t
| Concat : < polymorphic ; .. > t
| Filter : < polymorphic ; .. > t
| Reduce : < polymorphic ; .. > t
(* * overloaded *)
| Add : < overloaded ; .. > t
| Add_int_int : < resolved ; .. > t
@ -298,6 +297,7 @@ module Op = struct
| Eq_dat_dat : < resolved ; .. > t
(* ternary *)
(* * polymorphic *)
| Reduce : < polymorphic ; .. > t
| Fold : < polymorphic ; .. > t
| HandleDefault : < polymorphic ; .. > t
| HandleDefaultOpt : < polymorphic ; .. > t