From 6552d1ee985d4ea53dfbbf5ae6c1f8e75de21787 Mon Sep 17 00:00:00 2001 From: Olivier Nicole Date: Fri, 28 Apr 2023 18:58:42 +0200 Subject: [PATCH] Remove some dead code and debug printing --- compiler/lib/effects.ml | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/compiler/lib/effects.ml b/compiler/lib/effects.ml index 934a8deee5..5d3f94eea5 100644 --- a/compiler/lib/effects.ml +++ b/compiler/lib/effects.ml @@ -1124,40 +1124,6 @@ let cps_transform ~lifter_functions ~live_vars ~flow_info ~cps_needed p = new_blocks } in - let p = - match Hashtbl.find_opt closure_info p.start with - | None -> p - | Some (cps_params, cps_cont) -> - (* Call [caml_trampoline_cps] to set up the execution context. *) - let new_start = p.free_pc in - let blocks = - let main = Var.fresh () in - let args = Var.fresh () in - let res = Var.fresh () in - Addr.Map.add - new_start - { params = [] - ; body = - [ Let (main, Closure (cps_params, cps_cont)), noloc - ; Let (args, Prim (Extern "%js_array", [])), noloc - ; ( Let (res, Prim (Extern "caml_trampoline_cps", [ Pv main; Pv args ])) - , noloc ) - ] - ; branch = Return res, noloc - } - p.blocks - in - (* Remove the direct-style toplevel code as it is now unreachable *) - let blocks = - Code.traverse - { fold = Code.fold_children } - (fun pc blocks -> Addr.Map.remove pc blocks) - p.start - blocks - blocks - in - { start = new_start; blocks; free_pc = new_start + 1 } - in let p = (* Initialize the global fiber stack and define a global identity function, needed to translate [%resume] *) @@ -1304,9 +1270,6 @@ let f (p, live_vars) = let p = remove_empty_blocks ~live_vars p in let flow_info = Global_flow.f ~fast:false p in let cps_needed = Partial_cps_analysis.f p flow_info in - debug_print "@[cps_needed = @["; - Var.Set.iter (fun v -> debug_print "%s,@ " (Var.to_string v)) cps_needed; - debug_print "@]@,@]"; let p, lifter_functions, liftings = Lambda_lifting_simple.f ~to_lift:cps_needed p in let cps_needed = Var.Set.map (fun f -> try Subst.from_map liftings f with Not_found -> f) cps_needed