diff --git a/compiler/lib/driver.ml b/compiler/lib/driver.ml index 58b65a0f30..e3758e6352 100644 --- a/compiler/lib/driver.ml +++ b/compiler/lib/driver.ml @@ -87,11 +87,19 @@ let phi p = let ( +> ) f g x = g (f x) +let map_triple_fst f (x, y, z) = f x, y, z + let effects p = if Config.Flag.effects () then ( if debug () then Format.eprintf "Effects...@."; - p |> Deadcode.f +> Effects.f) + p + |> Deadcode.f + +> Effects.f + +> + if Config.Flag.double_translation () + then Fun.id + else map_triple_fst Lambda_lifting.f) else ( p , (Code.Var.Set.empty : Effects.cps_calls) diff --git a/compiler/lib/generate.ml b/compiler/lib/generate.ml index fd6e28bc30..27f7cdda1e 100644 --- a/compiler/lib/generate.ml +++ b/compiler/lib/generate.ml @@ -1024,7 +1024,7 @@ let apply_fun_raw = bounce to a trampoline if needed, to avoid a stack overflow. The trampoline then performs the call in an shorter stack. *) let f = - if single_version + if single_version && Config.Flag.double_translation () then J.(EObj [ Property (PNS (Utf8_string.of_string_exn "cps"), f) ]) else f in