summaryrefslogtreecommitdiff
path: root/compiler/PureMicroPasses.ml
diff options
context:
space:
mode:
authorSon Ho2023-11-13 13:27:02 +0100
committerSon Ho2023-11-13 13:27:02 +0100
commit6c88d30031255c0ac612b67bb5b3c20c2f07e563 (patch)
tree8b0c28f8eb8bb6e76604b7e66eb84b0940d59f03 /compiler/PureMicroPasses.ml
parent746239e8f29de85f848d14e44eac8690e2065a1d (diff)
Add RegionsHierarchy.ml
Diffstat (limited to '')
-rw-r--r--compiler/PureMicroPasses.ml9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/PureMicroPasses.ml b/compiler/PureMicroPasses.ml
index 8872571f..d2747a4b 100644
--- a/compiler/PureMicroPasses.ml
+++ b/compiler/PureMicroPasses.ml
@@ -786,18 +786,19 @@ let expression_contains_child_call_in_all_paths (ctx : trans_ctx)
if rg_id0 = rg_id1 then true
else
(* We need to use the regions hierarchy *)
- (* First, lookup the signature of the LLBC function *)
- let sg =
+ let regions_hierarchy =
let id0 =
match id0 with
| FunId fun_id -> fun_id
| TraitMethod (_, _, fun_decl_id) -> FRegular fun_decl_id
in
- LlbcAstUtils.lookup_fun_sig id0 ctx.fun_ctx.fun_decls
+ LlbcAstUtils.FunIdMap.find id0
+ ctx.fun_ctx.regions_hierarchies
in
(* Compute the set of ancestors of the function in call1 *)
let call1_ancestors =
- LlbcAstUtils.list_ancestor_region_groups sg rg_id1
+ LlbcAstUtils.list_ancestor_region_groups regions_hierarchy
+ rg_id1
in
(* Check if the function used in call0 is inside *)
T.RegionGroupId.Set.mem rg_id0 call1_ancestors