diff options
Diffstat (limited to '')
-rw-r--r-- | src/CfimAstUtils.ml | 16 | ||||
-rw-r--r-- | src/Substitute.ml | 1 | ||||
-rw-r--r-- | src/TypesUtils.ml | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/src/CfimAstUtils.ml b/src/CfimAstUtils.ml new file mode 100644 index 00000000..f811475c --- /dev/null +++ b/src/CfimAstUtils.ml @@ -0,0 +1,16 @@ +open CfimAst +open Utils + +(** Check if a [statement] contains loops *) +let rec statement_has_loops (st : statement) : bool = + let obj = + object + inherit [_] iter_statement + + method! visit_Loop _ _ = raise Found + end + in + try + obj#visit_statement () st; + false + with Found -> true diff --git a/src/Substitute.ml b/src/Substitute.ml index d3c3c430..1b6003bb 100644 --- a/src/Substitute.ml +++ b/src/Substitute.ml @@ -52,7 +52,6 @@ let fresh_regions_with_substs (region_vars : T.region_var list) let ctx, fresh_region_ids = List.fold_left_map (fun ctx _ -> C.fresh_region_id ctx) ctx region_vars in - let fresh_regions = List.map (fun rid -> T.Var rid) fresh_region_ids in (* Generate the map from region var ids to regions *) let ls = List.combine region_vars fresh_region_ids in let rid_map = diff --git a/src/TypesUtils.ml b/src/TypesUtils.ml index faf77eac..c1f52120 100644 --- a/src/TypesUtils.ml +++ b/src/TypesUtils.ml @@ -72,7 +72,7 @@ let rec ety_no_regions_to_rty (ty : ety) : rty = regions" (** Check if a [ty] contains regions *) -let rec ty_has_regions (ty : ety) : bool = +let ty_has_regions (ty : ety) : bool = let obj = object inherit [_] iter_ty as super |