From 66638a2a96c7639553a340917b87e26d94265c5e Mon Sep 17 00:00:00 2001 From: Son Ho Date: Sat, 17 Dec 2022 10:27:12 +0100 Subject: Fix various issues with the generation of code for the loops --- compiler/PureUtils.ml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'compiler/PureUtils.ml') diff --git a/compiler/PureUtils.ml b/compiler/PureUtils.ml index b5c9b686..e1421f5a 100644 --- a/compiler/PureUtils.ml +++ b/compiler/PureUtils.ml @@ -7,6 +7,9 @@ let log = Logging.pure_utils_log type regular_fun_id = A.fun_id * T.RegionGroupId.id option [@@deriving show, ord] +(** We use this type as a key for lookups *) +type fun_loop_id = A.FunDeclId.id * LoopId.id option [@@deriving show, ord] + module RegularFunIdOrderedType = struct type t = regular_fun_id @@ -30,6 +33,18 @@ end module FunOrOpIdMap = Collections.MakeMap (FunOrOpIdOrderedType) module FunOrOpIdSet = Collections.MakeSet (FunOrOpIdOrderedType) +module FunLoopIdOrderedType = struct + type t = fun_loop_id + + let compare = compare_fun_loop_id + let to_string = show_fun_loop_id + let pp_t = pp_fun_loop_id + let show_t = show_fun_loop_id +end + +module FunLoopIdMap = Collections.MakeMap (FunLoopIdOrderedType) +module FunLoopIdSet = Collections.MakeSet (FunLoopIdOrderedType) + let dest_arrow_ty (ty : ty) : ty * ty = match ty with | Arrow (arg_ty, ret_ty) -> (arg_ty, ret_ty) -- cgit v1.2.3