Skip to content
Snippets Groups Projects
Commit 00ac995c authored by David Bühler's avatar David Bühler
Browse files

[from] Uses Eva.Cvalue_callbacks hooks instead of Db.Value.

parent 44c04724
No related branches found
No related tags found
No related merge requests found
...@@ -64,9 +64,9 @@ let record_callwise_dependencies_in_db call_site froms = ...@@ -64,9 +64,9 @@ let record_callwise_dependencies_in_db call_site froms =
Tbl.replace call_site (Function_Froms.join previous froms) Tbl.replace call_site (Function_Froms.join previous froms)
with Not_found -> Tbl.add call_site froms with Not_found -> Tbl.add call_site froms
let call_for_individual_froms (call_type, value_initial_state, call_stack) = let call_for_individual_froms callstack _kf call_type value_initial_state =
if From_parameters.ForceCallDeps.get () then begin if From_parameters.ForceCallDeps.get () then begin
let current_function, call_site = List.hd call_stack in let current_function, call_site = List.hd callstack in
let register_from froms = let register_from froms =
record_callwise_dependencies_in_db call_site froms; record_callwise_dependencies_in_db call_site froms;
match !call_froms_stack with match !call_froms_stack with
...@@ -151,15 +151,13 @@ let compute_call_from_value_states current_function states = ...@@ -151,15 +151,13 @@ let compute_call_from_value_states current_function states =
Callwise_Froms.compute_and_return current_function Callwise_Froms.compute_and_return current_function
let record_for_individual_froms (call_stack, value_res) = let record_for_individual_froms callstack cur_kf value_res =
if From_parameters.ForceCallDeps.get () then begin if From_parameters.ForceCallDeps.get () then begin
let froms = match value_res with let froms = match value_res with
| Value_types.Normal (states, _after_states) | Eva.Cvalue_callbacks.Store ({before_stmts}, memexec_counter) ->
| Value_types.NormalStore ((states, _after_states), _) ->
let cur_kf, _ = List.hd call_stack in
let froms = let froms =
if Eva.Analysis.save_results cur_kf if Eva.Analysis.save_results cur_kf
then compute_call_from_value_states cur_kf (Lazy.force states) then compute_call_from_value_states cur_kf (Lazy.force before_stmts)
else Function_Froms.top else Function_Froms.top
in in
let pre_state = match !call_froms_stack with let pre_state = match !call_froms_stack with
...@@ -168,28 +166,21 @@ let record_for_individual_froms (call_stack, value_res) = ...@@ -168,28 +166,21 @@ let record_for_individual_froms (call_stack, value_res) =
in in
if From_parameters.VerifyAssigns.get () then if From_parameters.VerifyAssigns.get () then
!Db.Value.verify_assigns_froms cur_kf ~pre:pre_state froms; !Db.Value.verify_assigns_froms cur_kf ~pre:pre_state froms;
(match value_res with MemExec.replace memexec_counter froms;
| Value_types.NormalStore (_, memexec_counter) ->
MemExec.replace memexec_counter froms
| _ -> ());
froms froms
| Value_types.Reuse counter -> | Reuse counter ->
MemExec.find counter MemExec.find counter
in in
end_record call_stack froms end_record callstack froms
end end
(* Register our callbacks inside the value analysis *) (* Register our callbacks inside the value analysis *)
let () = From_parameters.ForceCallDeps.add_update_hook let () =
(fun _bold bnew -> Eva.Cvalue_callbacks.register_call_hook call_for_individual_froms;
if bnew then begin Eva.Cvalue_callbacks.register_call_results_hook record_for_individual_froms
Db.Value.Call_Type_Value_Callbacks.extend_once call_for_individual_froms;
Db.Value.Record_Value_Callbacks_New.extend_once
record_for_individual_froms;
end)
let force_compute_all_calldeps ()= let force_compute_all_calldeps ()=
......
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