Skip to content

Commit e3497ad

Browse files
committed
gcc_backend.ml: tiny fixes to recent refactorings
Signed-off-by: Lukasz Stafiniak <lukstafi@gmail.com>
1 parent 86bf625 commit e3497ad

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

arrayjit/lib/gcc_backend.ml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
open Base
2+
open Ir
23
module Lazy = Utils.Lazy
34

45
let _get_local_debug_runtime = Utils.get_local_debug_runtime
@@ -22,8 +23,6 @@ let root_ctx =
2223

2324
module Tn = Tnode
2425

25-
let is_initialized () = Option.is_some !root_ctx
26-
2726
type 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
686685
let 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

Comments
 (0)