Skip to content

Commit

Permalink
Move duplicated BS module definition to top
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Sep 19, 2023
1 parent 0c54481 commit d35519b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/analyses/region.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct
module D = RegionDomain.RegionDom
module G = Lattice.Unit
module C = D
module BS = (val Base.get_main ())
module V =
struct
include Printable.UnitConf (struct let name = "partitions" end)
Expand Down Expand Up @@ -75,9 +76,7 @@ struct
let locals = f.sformals @ f.slocals in
let reg = ctx.local in
let reg = match exp with
| Some exp ->
let module BS = (val Base.get_main ()) in
Reg.assign (BS.return_lval ()) exp reg
| Some exp -> Reg.assign (BS.return_lval ()) exp reg
| None -> reg
in
Reg.remove_vars locals reg
Expand All @@ -97,7 +96,6 @@ struct
ctx.local

let combine_assign ctx (lval:lval option) fexp (f:fundec) (args:exp list) fc (au:D.t) (f_ask: Queries.ask) : D.t =
let module BS = (val Base.get_main ()) in
let reg = match lval with
| None -> au
| Some lval -> Reg.assign lval (AddrOf (BS.return_lval ())) au
Expand Down

0 comments on commit d35519b

Please sign in to comment.