11open Base
2+ open Ir
23module Lazy = Utils. Lazy
34
45let _get_local_debug_runtime = Utils. get_local_debug_runtime
@@ -22,8 +23,6 @@ let root_ctx =
2223
2324module Tn = Tnode
2425
25- let is_initialized () = Option. is_some ! root_ctx
26-
2726type tn_info = {
2827 tn : Tn .t ; (* * The original array. *)
2928 ptr : (Gccjit .rvalue [@ sexp.opaque]) Lazy .t ;
@@ -686,8 +685,7 @@ let%diagn_sexp compile_proc ~name ctx bindings ~get_ident
686685let compile ~(name : string ) bindings (lowered : Low_level.optimized ) =
687686 let get_ident = Low_level. get_ident_within_code ~no_dots: true [| lowered.llc |] in
688687 let open Gccjit in
689- if Option. is_none ! root_ctx then initialize () ;
690- let ctx = Context. create_child @@ Option. value_exn ~here: [% here] ! root_ctx in
688+ let ctx = Context. create_child root_ctx in
691689 Context. set_option ctx Context. Optimization_level (optimization_level () );
692690 (* if Utils.settings.with_debug && Utils.settings.output_debug_files_in_build_directory then (
693691 Context.set_option ctx Context.Keep_intermediates true; Context.set_option ctx
@@ -709,8 +707,7 @@ let%diagn_sexp compile_batch ~(names : string option array) bindings
709707 @@ Array. filter_map lowereds ~f: (Option. map ~f: (fun { Low_level. llc; _ } -> llc))
710708 in
711709 let open Gccjit in
712- if Option. is_none ! root_ctx then initialize () ;
713- let ctx = Context. create_child @@ Option. value_exn ~here: [% here] ! root_ctx in
710+ let ctx = Context. create_child root_ctx in
714711 Context. set_option ctx Context. Optimization_level (optimization_level () );
715712 (* if Utils.settings.with_debug && Utils.settings.output_debug_files_in_build_directory then (
716713 Context.set_option ctx Context.Keep_intermediates true; Context.set_option ctx
0 commit comments