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
2baab0d3
Commit
2baab0d3
authored
6 years ago
by
Julien Signoles
Browse files
Options
Downloads
Patches
Plain Diff
[rte] remove 'open Flags'
parent
18af5e51
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/rte/register.ml
+2
-4
2 additions, 4 deletions
src/plugins/rte/register.ml
src/plugins/rte/visit.ml
+20
-17
20 additions, 17 deletions
src/plugins/rte/visit.ml
with
22 additions
and
21 deletions
src/plugins/rte/register.ml
+
2
−
4
View file @
2baab0d3
...
...
@@ -24,14 +24,12 @@
(* dedicated computations *)
(* -------------------------------------------------------------------------- *)
open
Flags
(* annotate for all rte + unsigned overflows (which are not rte), for a given
function *)
let
do_all_rte
kf
=
let
flags
=
{
Flags
.
all
with
signed_downcast
=
false
;
Flags
.
signed_downcast
=
false
;
unsigned_downcast
=
false
;
}
in
Visit
.
annotate
~
flags
kf
...
...
@@ -41,7 +39,7 @@ let do_all_rte kf =
let
do_rte
kf
=
let
flags
=
{
Flags
.
all
with
unsigned_overflow
=
false
;
Flags
.
unsigned_overflow
=
false
;
signed_downcast
=
false
;
unsigned_downcast
=
false
;
}
in
...
...
This diff is collapsed.
Click to expand it.
src/plugins/rte/visit.ml
+
20
−
17
View file @
2baab0d3
...
...
@@ -24,7 +24,6 @@
open
Cil_types
open
Cil_datatype
open
Flags
(* AST inplace visitor for runtime annotation generation *)
...
...
@@ -52,49 +51,52 @@ class annot_visitor kf flags on_alarm = object (self)
r
method
private
do_initialized
()
=
flags
.
initialized
&&
not
(
Generator
.
Initialized
.
is_computed
kf
)
flags
.
Flags
.
initialized
&&
not
(
Generator
.
Initialized
.
is_computed
kf
)
method
private
do_mem_access
()
=
flags
.
mem_access
&&
not
(
Generator
.
Mem_access
.
is_computed
kf
)
flags
.
Flags
.
mem_access
&&
not
(
Generator
.
Mem_access
.
is_computed
kf
)
method
private
do_div_mod
()
=
flags
.
div_mod
&&
not
(
Generator
.
Div_mod
.
is_computed
kf
)
flags
.
Flags
.
div_mod
&&
not
(
Generator
.
Div_mod
.
is_computed
kf
)
method
private
do_shift
()
=
flags
.
shift
&&
not
(
Generator
.
Shift
.
is_computed
kf
)
flags
.
Flags
.
shift
&&
not
(
Generator
.
Shift
.
is_computed
kf
)
method
private
do_left_shift_negative
()
=
flags
.
left_shift_negative
flags
.
Flags
.
left_shift_negative
&&
not
(
Generator
.
Left_shift_negative
.
is_computed
kf
)
method
private
do_right_shift_negative
()
=
flags
.
right_shift_negative
flags
.
Flags
.
right_shift_negative
&&
not
(
Generator
.
Right_shift_negative
.
is_computed
kf
)
method
private
do_signed_overflow
()
=
flags
.
signed_overflow
&&
not
(
Generator
.
Signed_overflow
.
is_computed
kf
)
flags
.
Flags
.
signed_overflow
&&
not
(
Generator
.
Signed_overflow
.
is_computed
kf
)
method
private
do_unsigned_overflow
()
=
flags
.
unsigned_overflow
&&
not
(
Generator
.
Unsigned_overflow
.
is_computed
kf
)
flags
.
Flags
.
unsigned_overflow
&&
not
(
Generator
.
Unsigned_overflow
.
is_computed
kf
)
method
private
do_signed_downcast
()
=
flags
.
signed_downcast
&&
not
(
Generator
.
Signed_downcast
.
is_computed
kf
)
flags
.
Flags
.
signed_downcast
&&
not
(
Generator
.
Signed_downcast
.
is_computed
kf
)
method
private
do_unsigned_downcast
()
=
flags
.
unsigned_downcast
&&
not
(
Generator
.
Unsigned_downcast
.
is_computed
kf
)
flags
.
Flags
.
unsigned_downcast
&&
not
(
Generator
.
Unsigned_downcast
.
is_computed
kf
)
method
private
do_float_to_int
()
=
flags
.
float_to_int
&&
not
(
Generator
.
Float_to_int
.
is_computed
kf
)
flags
.
Flags
.
float_to_int
&&
not
(
Generator
.
Float_to_int
.
is_computed
kf
)
method
private
do_finite_float
()
=
flags
.
finite_float
&&
not
(
Generator
.
Finite_float
.
is_computed
kf
)
flags
.
Flags
.
finite_float
&&
not
(
Generator
.
Finite_float
.
is_computed
kf
)
method
private
do_pointer_call
()
=
flags
.
pointer_call
&&
not
(
Generator
.
Pointer_call
.
is_computed
kf
)
flags
.
Flags
.
pointer_call
&&
not
(
Generator
.
Pointer_call
.
is_computed
kf
)
method
private
do_bool_value
()
=
flags
.
bool_value
&&
not
(
Generator
.
Bool_value
.
is_computed
kf
)
flags
.
Flags
.
bool_value
&&
not
(
Generator
.
Bool_value
.
is_computed
kf
)
method
private
queue_stmt_spec
spec
=
let
stmt
=
Extlib
.
the
(
self
#
current_stmt
)
in
...
...
@@ -108,7 +110,7 @@ class annot_visitor kf flags on_alarm = object (self)
fun
fgen
->
let
stmt
=
Extlib
.
the
(
self
#
current_stmt
)
in
let
on_alarm
~
invalid
a
=
on_alarm
stmt
~
invalid
a
in
fgen
~
remove_trivial
:
flags
.
remove_trivial
~
on_alarm
fgen
~
remove_trivial
:
flags
.
Flags
.
remove_trivial
~
on_alarm
method
!
vstmt
s
=
match
s
.
skind
with
|
UnspecifiedSequence
l
->
...
...
@@ -430,6 +432,7 @@ let annotate ?flags kf =
(* Strict version of ||, because [comp] has side-effects *)
let
(
|||
)
a
b
=
a
||
b
in
let
open
Generator
in
let
open
Flags
in
if
comp
Initialized
.
accessor
flags
.
initialized
|||
comp
Mem_access
.
accessor
flags
.
mem_access
|||
comp
Pointer_call
.
accessor
flags
.
pointer_call
|||
...
...
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