From e6edaac99fc38fc3cb574db06fe83c7eb32ef37b Mon Sep 17 00:00:00 2001 From: Son Ho Date: Fri, 9 Dec 2022 16:51:40 +0100 Subject: Merge loop abs so that there is one abs per function input region group --- compiler/Interpreter.ml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'compiler/Interpreter.ml') diff --git a/compiler/Interpreter.ml b/compiler/Interpreter.ml index ec1b6260..4b030088 100644 --- a/compiler/Interpreter.ml +++ b/compiler/Interpreter.ml @@ -29,12 +29,14 @@ let compute_type_fun_global_contexts (m : A.crate) : let initialize_eval_context (type_context : C.type_context) (fun_context : C.fun_context) (global_context : C.global_context) - (type_vars : T.type_var list) : C.eval_ctx = + (region_groups : T.RegionGroupId.id list) (type_vars : T.type_var list) : + C.eval_ctx = C.reset_global_counters (); { C.type_context; C.fun_context; C.global_context; + C.region_groups; C.type_vars; C.env = [ C.Frame ]; C.ended_regions = T.RegionId.Set.empty; @@ -69,9 +71,12 @@ let initialize_symbolic_context_for_fun (type_context : C.type_context) * *) let sg = fdef.signature in (* Create the context *) + let region_groups = + List.map (fun (g : T.region_var_group) -> g.id) sg.regions_hierarchy + in let ctx = initialize_eval_context type_context fun_context global_context - sg.type_params + region_groups sg.type_params in (* Instantiate the signature *) let type_params = List.map (fun tv -> T.TypeVar tv.T.index) sg.type_params in @@ -312,7 +317,7 @@ module Test = struct compute_type_fun_global_contexts crate in let ctx = - initialize_eval_context type_context fun_context global_context [] + initialize_eval_context type_context fun_context global_context [] [] in (* Insert the (uninitialized) local variables *) -- cgit v1.2.3