Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
3b438cca
Commit
3b438cca
authored
3 years ago
by
Valentin Perrelle
Committed by
David Bühler
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Metrics] Use the new Eva API
parent
90d4b206
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugins/metrics/metrics_coverage.ml
+7
-7
7 additions, 7 deletions
src/plugins/metrics/metrics_coverage.ml
src/plugins/metrics/register.ml
+2
-2
2 additions, 2 deletions
src/plugins/metrics/register.ml
src/plugins/metrics/register_gui.ml
+2
-2
2 additions, 2 deletions
src/plugins/metrics/register_gui.ml
with
11 additions
and
11 deletions
src/plugins/metrics/metrics_coverage.ml
+
7
−
7
View file @
3b438cca
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/plugins/metrics/register.ml
+
2
−
2
View file @
3b438cca
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/plugins/metrics/register_gui.ml
+
2
−
2
View file @
3b438cca
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment