Skip to content

Commit

Permalink
Rationalise return values from Simplify_named (ocaml#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshinwell authored and lthls committed Sep 23, 2020
1 parent 444dcd6 commit 22934f2
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 239 deletions.
6 changes: 6 additions & 0 deletions middle_end/flambda/simplify/env/downwards_acc.ml
Expand Up @@ -125,6 +125,12 @@ let add_lifted_constant t const =
lifted_constants = LCS.add t.lifted_constants const;
}

let add_lifted_constant_also_to_env t const =
{ t with
lifted_constants = LCS.add t.lifted_constants const;
denv = DE.add_lifted_constant t.denv const;
}

let add_lifted_constants_from_list t consts =
ListLabels.fold_left consts ~init:t ~f:add_lifted_constant

Expand Down
5 changes: 5 additions & 0 deletions middle_end/flambda/simplify/env/downwards_acc.mli
Expand Up @@ -71,6 +71,11 @@ val add_lifted_constant
-> Simplify_envs.Lifted_constant.t
-> t

val add_lifted_constant_also_to_env
: t
-> Simplify_envs.Lifted_constant.t
-> t

val add_lifted_constants_from_list
: t
-> Simplify_envs.Lifted_constant.t list
Expand Down

0 comments on commit 22934f2

Please sign in to comment.