diff options
author | Son Ho | 2023-12-22 21:03:17 +0100 |
---|---|---|
committer | Son Ho | 2023-12-22 21:03:17 +0100 |
commit | 70d506d148e5ae1a3e4115034161f449aff666ed (patch) | |
tree | 43faecd146f5d792d398512097b3afdb503ae11c /compiler/PureMicroPasses.ml | |
parent | b230ddacd44a1ca1804940bf89253bde8de7ffe1 (diff) |
Fix the output type of the loops backward functions
Diffstat (limited to '')
-rw-r--r-- | compiler/PureMicroPasses.ml | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/compiler/PureMicroPasses.ml b/compiler/PureMicroPasses.ml index 67495ab5..e7e9d5e1 100644 --- a/compiler/PureMicroPasses.ml +++ b/compiler/PureMicroPasses.ml @@ -459,7 +459,7 @@ let compute_pretty_names (def : fun_decl) : fun_decl = input_state; inputs; inputs_lvs; - back_output_tys; + output_ty; loop_body; } = loop @@ -478,7 +478,7 @@ let compute_pretty_names (def : fun_decl) : fun_decl = input_state; inputs; inputs_lvs; - back_output_tys; + output_ty; loop_body; } in @@ -1498,26 +1498,7 @@ let decompose_loops (_ctx : trans_ctx) (def : fun_decl) : List.concat [ fuel; fwd_inputs; fwd_state; back_inputs ] in - let output = - match loop.back_output_tys with - | None -> - (* Forward function: the return type is the same as the - parent function *) - fun_sig.output - | Some doutputs -> - (* Backward function: custom return type *) - let output = mk_simpl_tuple_ty doutputs in - let output = - if loop_fwd_effect_info.stateful then - mk_simpl_tuple_ty [ mk_state_ty; output ] - else output - in - let output = - if loop_fwd_effect_info.can_fail then mk_result_ty output - else output - in - output - in + let output = loop.output_ty in let loop_sig = { |