Clean unused values from pattern matching
This commit is contained in:
parent
a194e327d0
commit
58cc468ca3
1 changed files with 2 additions and 10 deletions
12
src/CPS.ml
12
src/CPS.ml
|
@ -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]
|
||||
|
||||
|
|
Loading…
Reference in a new issue