Clean unused values from pattern matching

This commit is contained in:
Théophile Bastian 2018-02-16 18:25:09 +01:00
parent a194e327d0
commit 58cc468ca3

View file

@ -35,16 +35,8 @@ let rec has_calls (t: S.term): bool = match t with
(* A lambda itself may contain calls, but this call is not evaluated at
* declaration time *)
| S.App _ -> true
| S.IfZero (cond, tIf, tElse) ->
(* Cannot optimize continuation creation
List.exists has_calls [cond; tIf; tElse]
*)
true
| S.Print value ->
(* Cannot optimize continuation creation
has_calls value
*)
true
| S.IfZero _ -> true (* Cannot optimize that with the current languages *)
| S.Print _ -> true (* Cannot optimize that with the current languages *)
| S.Let (_, value, next) ->
List.exists has_calls [value; next]