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
3994d21b
Commit
3994d21b
authored
3 years ago
by
Basile Desloges
Committed by
Julien Signoles
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[eacsl] Add a function to allow visiting global_annotation in E_acsl_visitor
parent
22532fbe
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/e-acsl/src/analyses/e_acsl_visitor.ml
+9
-1
9 additions, 1 deletion
src/plugins/e-acsl/src/analyses/e_acsl_visitor.ml
src/plugins/e-acsl/src/analyses/e_acsl_visitor.mli
+3
-0
3 additions, 0 deletions
src/plugins/e-acsl/src/analyses/e_acsl_visitor.mli
with
12 additions
and
1 deletion
src/plugins/e-acsl/src/analyses/e_acsl_visitor.ml
+
9
−
1
View file @
3994d21b
...
@@ -31,6 +31,7 @@ let case_globals
...
@@ -31,6 +31,7 @@ let case_globals
?
(
var_fun_decl
=
fun
_
->
default
()
)
?
(
var_fun_decl
=
fun
_
->
default
()
)
?
(
var_init
=
fun
_
->
default
()
)
?
(
var_init
=
fun
_
->
default
()
)
?
(
var_def
=
fun
_
_
->
default
()
)
?
(
var_def
=
fun
_
_
->
default
()
)
?
(
glob_annot
=
fun
_
->
default
()
)
~
fun_def
~
fun_def
=
function
=
function
(* library functions and built-ins *)
(* library functions and built-ins *)
...
@@ -65,6 +66,10 @@ let case_globals
...
@@ -65,6 +66,10 @@ let case_globals
|
GFun
(
fundec
,
_
)
->
|
GFun
(
fundec
,
_
)
->
fun_def
fundec
fun_def
fundec
(* global annotation *)
|
GAnnot
(
ga
,
_
)
->
glob_annot
ga
(* other globals: nothing to do *)
(* other globals: nothing to do *)
|
GType
_
|
GType
_
|
GCompTag
_
|
GCompTag
_
...
@@ -74,7 +79,6 @@ let case_globals
...
@@ -74,7 +79,6 @@ let case_globals
|
GAsm
_
|
GAsm
_
|
GPragma
_
|
GPragma
_
|
GText
_
|
GText
_
|
GAnnot
_
(* do never read annotation from sources *)
->
->
default
()
default
()
...
@@ -106,6 +110,9 @@ class visitor
...
@@ -106,6 +110,9 @@ class visitor
method
var_def
:
varinfo
->
init
->
global
list
Cil
.
visitAction
=
method
var_def
:
varinfo
->
init
->
global
list
Cil
.
visitAction
=
fun
_
_
->
self
#
default
()
fun
_
_
->
self
#
default
()
method
glob_annot
:
global_annotation
->
global
list
Cil
.
visitAction
=
fun
_
->
self
#
default
()
method
fun_def
({
svar
=
vi
})
=
method
fun_def
({
svar
=
vi
})
=
let
kf
=
try
Globals
.
Functions
.
get
vi
with
Not_found
->
assert
false
in
let
kf
=
try
Globals
.
Functions
.
get
vi
with
Not_found
->
assert
false
in
if
Functions
.
check
kf
then
Cil
.
DoChildren
else
Cil
.
SkipChildren
if
Functions
.
check
kf
then
Cil
.
DoChildren
else
Cil
.
SkipChildren
...
@@ -120,5 +127,6 @@ class visitor
...
@@ -120,5 +127,6 @@ class visitor
~
var_fun_decl
:
self
#
var_fun_decl
~
var_fun_decl
:
self
#
var_fun_decl
~
var_init
:
self
#
var_init
~
var_init
:
self
#
var_init
~
var_def
:
self
#
var_def
~
var_def
:
self
#
var_def
~
glob_annot
:
self
#
glob_annot
~
fun_def
:
self
#
fun_def
~
fun_def
:
self
#
fun_def
end
end
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/src/analyses/e_acsl_visitor.mli
+
3
−
0
View file @
3994d21b
...
@@ -31,6 +31,7 @@ val case_globals :
...
@@ -31,6 +31,7 @@ val case_globals :
?
var_fun_decl
:
(
varinfo
->
'
a
)
->
?
var_fun_decl
:
(
varinfo
->
'
a
)
->
?
var_init
:
(
varinfo
->
'
a
)
->
?
var_init
:
(
varinfo
->
'
a
)
->
?
var_def
:
(
varinfo
->
init
->
'
a
)
->
?
var_def
:
(
varinfo
->
init
->
'
a
)
->
?
glob_annot
:
(
global_annotation
->
'
a
)
->
fun_def
:
(
fundec
->
'
a
)
->
fun_def
:
(
fundec
->
'
a
)
->
global
->
'
a
global
->
'
a
(** Function to descend into the root of the ast according to the various cases
(** Function to descend into the root of the ast according to the various cases
...
@@ -47,6 +48,7 @@ val case_globals :
...
@@ -47,6 +48,7 @@ val case_globals :
value
value
- [var_def] is the case for variable definitions with an initialization
- [var_def] is the case for variable definitions with an initialization
value
value
- [glob_annot] is the case for global annotations
- [fun_def] is the case for function definition. *)
- [fun_def] is the case for function definition. *)
(** Visitor for managing the root of the AST, on the globals level, with the
(** Visitor for managing the root of the AST, on the globals level, with the
...
@@ -64,5 +66,6 @@ class visitor :
...
@@ -64,5 +66,6 @@ class visitor :
method
var_fun_decl
:
varinfo
->
global
list
Cil
.
visitAction
method
var_fun_decl
:
varinfo
->
global
list
Cil
.
visitAction
method
var_init
:
varinfo
->
global
list
Cil
.
visitAction
method
var_init
:
varinfo
->
global
list
Cil
.
visitAction
method
var_def
:
varinfo
->
init
->
global
list
Cil
.
visitAction
method
var_def
:
varinfo
->
init
->
global
list
Cil
.
visitAction
method
glob_annot
:
global_annotation
->
global
list
Cil
.
visitAction
method
fun_def
:
fundec
->
global
list
Cil
.
visitAction
method
fun_def
:
fundec
->
global
list
Cil
.
visitAction
end
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