diff --git a/src/optimization/analyzerTexprTransformer.ml b/src/optimization/analyzerTexprTransformer.ml index 244d05cfac0..52414019f0a 100644 --- a/src/optimization/analyzerTexprTransformer.ml +++ b/src/optimization/analyzerTexprTransformer.ml @@ -1018,9 +1018,12 @@ and block_to_texpr_coroutine ctx bb vcontinuation vresult verror p = ])) com.basic.tvoid p and func ctx i = - let bb,t,p,tf,coroutine = Hashtbl.find ctx.graph.g_functions i in + let tfi = Hashtbl.find ctx.graph.g_functions i in + let tf = tfi.tf_tf in + let bb = tfi.tf_bb in + let p = tfi.tf_pos in let e,tf_args,tf_type = - match coroutine with + match tfi.tf_coroutine with | Some (vresult,verror) -> let vcontinuation = alloc_var VGenerated "_hx_continuation" (tfun [t_dynamic] ctx.com.basic.tvoid) p in declare_var ctx.graph vcontinuation bb; @@ -1072,7 +1075,7 @@ and func ctx i = Type.map_expr loop e in let e = loop e in - mk (TFunction {tf with tf_args = tf_args; tf_type = tf_type; tf_expr = e}) t p + mk (TFunction {tf with tf_args = tf_args; tf_type = tf_type; tf_expr = e}) tfi.tf_t p let to_texpr ctx = func ctx ctx.entry.bb_id \ No newline at end of file diff --git a/src/optimization/analyzerTypes.ml b/src/optimization/analyzerTypes.ml index 7c8b4416529..606d48d13f3 100644 --- a/src/optimization/analyzerTypes.ml +++ b/src/optimization/analyzerTypes.ml @@ -246,7 +246,14 @@ end module Graph = struct open BasicBlock - type tfunc_info = BasicBlock.t * Type.t * pos * tfunc * (tvar * tvar) option + type tfunc_info = { + tf_bb : BasicBlock.t; + tf_t : Type.t; + tf_pos : pos; + tf_tf : tfunc; + tf_coroutine : (tvar * tvar) option; + } + type texpr_lookup = BasicBlock.t * texpr_lookup_target type var_write = BasicBlock.t list type 'a itbl = (int,'a) Hashtbl.t @@ -332,8 +339,8 @@ module Graph = struct (* nodes *) - let add_function g tf t p bb coroutine = - Hashtbl.add g.g_functions bb.bb_id (bb,t,p,tf,coroutine) + let add_function g tf_tf tf_t tf_pos tf_bb tf_coroutine = + Hashtbl.add g.g_functions tf_bb.bb_id ({tf_bb;tf_t;tf_pos;tf_tf;tf_coroutine}) let alloc_id = let r = ref 1 in @@ -589,7 +596,7 @@ module Graph = struct () end in - Hashtbl.iter (fun _ (bb,_,_,_,_) -> loop [0] bb) g.g_functions + Hashtbl.iter (fun _ tfi -> loop [0] tfi.tf_bb) g.g_functions end type analyzer_context = {