Skip to content
Snippets Groups Projects
Commit 668834f2 authored by Thibault Martin's avatar Thibault Martin Committed by Virgile Prevosto
Browse files

Use new Current_loc API in scope/from/loop_analysis

parent 535d2141
No related branches found
No related tags found
No related merge requests found
......@@ -200,15 +200,11 @@ struct
is redundant with the work done by Value -- hence the use of [\nothing].*)
let bind_locals m b =
let aux_local acc vi =
Current_loc.set vi.vdecl;
(* Consider that local are initialized to a constant value *)
From_memory.bind_var vi Eva.Deps.bottom acc
Current_loc.with_loc vi.vdecl
(From_memory.bind_var vi Eva.Deps.bottom) acc
in
let loc = Current_loc.get () in
let r = List.fold_left aux_local m b.blocals in
Current_loc.set loc;
r
List.fold_left aux_local m b.blocals
let unbind_locals m b =
let aux_local acc vi =
......@@ -631,7 +627,8 @@ struct
compute_using_prototype_for_state state kf assigns
let compute_and_return kf =
let call_site_loc = Current_loc.get () in
let open Current_loc.Operators in
let<> UpdatedCurrentLoc = Current_loc.get () in
From_parameters.feedback
"Computing for function %a%s"
Kernel_function.pretty kf
......@@ -651,7 +648,6 @@ struct
From_parameters.feedback
"Done for function %a" Kernel_function.pretty kf;
Async.yield ();
Current_loc.set call_site_loc;
result
let compute kf =
......
......@@ -361,7 +361,8 @@ module Store(* (B:sig *)
end
let mu (f:(t -> t)) (value,conds,stmt) =
Current_loc.set (Cil_datatype.Stmt.loc stmt);
let open Current_loc.Operators in
let<> UpdatedCurrentLoc = Cil_datatype.Stmt.loc stmt in
let (result,final_conds,_) = f (init stmt) in
(* Induction variables is a map from each Varinfo to its increment. *)
......
......@@ -126,10 +126,11 @@ let register_modified_zones lmap stmt =
* @raise Kernel_function.No_Definition if [kf] has no definition
*)
let compute kf =
let open Current_loc.Operators in
R.debug ~level:1 "computing for function %a" Kernel_function.pretty kf;
let f = Kernel_function.get_definition kf in
let do_stmt lmap s =
Current_loc.set (Cil_datatype.Stmt.loc s);
let<> UpdatedCurrentLoc = Cil_datatype.Stmt.loc s in
if Eva.Results.is_reachable s
then register_modified_zones lmap s
else lmap
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment