Skip to content
Snippets Groups Projects
Commit 3b438cca authored by Valentin Perrelle's avatar Valentin Perrelle Committed by David Bühler
Browse files

[Metrics] Use the new Eva API

parent 90d4b206
No related branches found
No related tags found
No related merge requests found
......@@ -215,7 +215,7 @@ class coverageByFun = object
method! vstmt s =
total <- total + 1;
if Db.Value.is_reachable_stmt s then value <- value + 1;
if Eva.Results.is_reachable s then value <- value + 1;
Cil.DoChildren
method result = (total, value)
......@@ -244,12 +244,12 @@ let compute_coverage_for kf =
with Kernel_function.No_Definition -> ()
let compute_coverage_by_fun () =
if Db.Value.is_computed () && not (is_computed_by_fun ())
if Eva.Analysis.is_computed () && not (is_computed_by_fun ())
then
let libc = Metrics_parameters.Libc.get () in
Globals.Functions.iter
(fun kf ->
if !Db.Value.is_called kf &&
if Eva.Results.is_called kf &&
Metrics_base.consider_function ~libc (Kernel_function.get_vi kf)
then compute_coverage_for kf)
......@@ -264,12 +264,12 @@ let compute_syntactic ~libc kf =
let dkey_sem = Metrics_parameters.register_category "semantic-visitor"
let compute_semantic ~libc =
assert (Db.Value.is_computed ());
assert (Eva.Analysis.is_computed ());
let res = ref Varinfo.Set.empty in
(* Just iter on all the functions and consult the appropriate table *)
Globals.Functions.iter
(fun kf ->
if !Db.Value.is_called kf &&
if Eva.Results.is_called kf &&
Metrics_base.consider_function ~libc
(Kernel_function.get_vi kf)
then begin
......@@ -360,7 +360,7 @@ class semantic_printer ~libc (cov_metrics : coverage_metrics) = object(self)
(* uses semantic *)
method pp_value_coverage fmt =
assert (Db.Value.is_computed ());
assert (Eva.Analysis.is_computed ());
let all = self#all_funs in
let syntactic = cov_metrics.syntactic
and semantic = cov_metrics.semantic in
......@@ -425,7 +425,7 @@ let percent_coverage ~libc cov_metrics =
;;
let compute ~libc =
assert (Db.Value.is_computed ());
assert (Eva.Analysis.is_computed ());
let semantic = compute_semantic ~libc in
let main = fst (Globals.entry_point ()) in
let syntactic, initializers = compute_syntactic ~libc main in
......
......@@ -47,8 +47,8 @@ let syntactic ?(libc=Metrics_parameters.Libc.get ()) () =
let () = ValueCoverage.set_output_dependencies [Db.Value.self; Libc.self]
let value ~libc () =
!Db.Value.compute ();
if Db.Value.is_computed () then begin
Eva.Analysis.compute ();
if Eva.Analysis.is_computed () then begin
let cov_metrics = Metrics_coverage.compute ~libc in
let cov_printer = new Metrics_coverage.semantic_printer ~libc cov_metrics in
Metrics_parameters.result "%t" cov_printer#pp_value_coverage;
......
......@@ -146,7 +146,7 @@ module CyclomaticMetricsGUI = struct
end
method cyclo_selector (popup_factory:GMenu.menu GMenu.factory) main_ui ~button localizable =
if button = 3 && Db.Value.is_computed () then
if button = 3 && Eva.Analysis.is_computed () then
match localizable with
| PVDecl (Some kf, _,_) ->
let callback1 () =
......@@ -214,7 +214,7 @@ module ValueCoverageGUI = struct
begin
match !result with
| None ->
!Db.Value.compute ();
Eva.Analysis.compute ();
result := Some (Metrics_coverage.compute ~libc)
| Some _ -> ()
end;
......
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