summaryrefslogtreecommitdiff
path: root/src/LlbcAstUtils.ml
diff options
context:
space:
mode:
authorSon Ho2022-03-03 17:36:33 +0100
committerSon Ho2022-03-03 17:36:33 +0100
commit00104884e101d3125e62dde9757b9c1cacb3feec (patch)
tree95714d86561013b328e00138f12bb9889576eca5 /src/LlbcAstUtils.ml
parent80d0d22f152386ffe28b48f42f42f8f736170014 (diff)
Make good progress on adding support for external and opaque
declarations
Diffstat (limited to 'src/LlbcAstUtils.ml')
-rw-r--r--src/LlbcAstUtils.ml11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/LlbcAstUtils.ml b/src/LlbcAstUtils.ml
index 93ca4448..41d17bf4 100644
--- a/src/LlbcAstUtils.ml
+++ b/src/LlbcAstUtils.ml
@@ -17,7 +17,10 @@ let statement_has_loops (st : statement) : bool =
with Found -> true
(** Check if a [fun_decl] contains loops *)
-let fun_decl_has_loops (fd : fun_decl) : bool = statement_has_loops fd.body
+let fun_decl_has_loops (fd : fun_decl) : bool =
+ match fd.body with
+ | Some body -> statement_has_loops body.body
+ | None -> false
let lookup_fun_sig (fun_id : fun_id) (fun_decls : fun_decl FunDeclId.Map.t) :
fun_sig =
@@ -64,6 +67,6 @@ let list_ordered_parent_region_groups (sg : fun_sig) (gid : T.RegionGroupId.id)
let parents = List.map (fun (rg : T.region_var_group) -> rg.id) parents in
parents
-let fun_decl_get_input_vars (fdef : fun_decl) : var list =
- let locals = List.tl fdef.locals in
- Collections.List.prefix fdef.arg_count locals
+let fun_body_get_input_vars (fbody : fun_body) : var list =
+ let locals = List.tl fbody.locals in
+ Collections.List.prefix fbody.arg_count locals