summaryrefslogtreecommitdiff
path: root/src/PureMicroPasses.ml
diff options
context:
space:
mode:
authorSon Ho2022-01-28 11:20:47 +0100
committerSon Ho2022-01-28 11:20:47 +0100
commita96c9e10cec6b8af30dd1c70214ec9b6db66645f (patch)
treedc2cba2fc51e8b8ba50cbabc05f852e8dffe000b /src/PureMicroPasses.ml
parent4211b52f1dc9dd55512192ff3519d4f58c897963 (diff)
Change the type of [Pure.call.args] to [expression list] rather than
[typed_rvalue list]
Diffstat (limited to 'src/PureMicroPasses.ml')
-rw-r--r--src/PureMicroPasses.ml13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/PureMicroPasses.ml b/src/PureMicroPasses.ml
index 4ee67011..80d4e8bf 100644
--- a/src/PureMicroPasses.ml
+++ b/src/PureMicroPasses.ml
@@ -133,11 +133,6 @@ let compute_pretty_names (def : fun_def) : fun_def =
(ctx : pn_ctx) : pn_ctx =
match mp with None -> ctx | Some mp -> add_right_constraint mp rv ctx
in
- let add_opt_right_constraint_list ctx rvs =
- List.fold_left
- (fun ctx (mp, rv) -> add_opt_right_constraint mp rv ctx)
- ctx rvs
- in
let add_left_constraint (lv : typed_lvalue) (ctx : pn_ctx) : pn_ctx =
let obj =
object (self)
@@ -171,10 +166,12 @@ let compute_pretty_names (def : fun_def) : fun_def =
(ctx, Value (v, mp))
(* *)
and update_call (call : call) (ctx : pn_ctx) : pn_ctx * expression =
- let ctx =
- add_opt_right_constraint_list ctx
- (List.combine call.args_mplaces call.args)
+ let ctx, args =
+ List.fold_left_map
+ (fun ctx arg -> update_expression arg ctx)
+ ctx call.args
in
+ let call = { call with args } in
(ctx, Call call)
(* *)
and update_let (lv : typed_lvalue) (re : expression) (e : expression)