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
81778b06
Commit
81778b06
authored
10 years ago
by
Julien Signoles
Browse files
Options
Downloads
Patches
Plain Diff
update wrt AST change (new constructor GFunDecl)
parent
4c15f86b
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/dup_functions.ml
+8
-5
8 additions, 5 deletions
src/plugins/e-acsl/dup_functions.ml
src/plugins/e-acsl/visit.ml
+5
-4
5 additions, 4 deletions
src/plugins/e-acsl/visit.ml
with
13 additions
and
9 deletions
src/plugins/e-acsl/dup_functions.ml
+
8
−
5
View file @
81778b06
...
@@ -281,7 +281,7 @@ class dup_functions_visitor prj = object (self)
...
@@ -281,7 +281,7 @@ class dup_functions_visitor prj = object (self)
|
_
->
false
|
_
->
false
method
!
vglob_aux
=
function
method
!
vglob_aux
=
function
|
GVarDecl
(
_
,
vi
,
loc
)
|
GFun
({
svar
=
vi
}
,
loc
)
|
GVarDecl
(
vi
,
loc
)
|
GFunDecl
(
_
,
vi
,
loc
)
|
GFun
({
svar
=
vi
}
,
loc
)
when
self
#
is_unvariadic_function
vi
when
self
#
is_unvariadic_function
vi
&&
not
(
Misc
.
is_library_loc
loc
)
&&
not
(
Misc
.
is_library_loc
loc
)
&&
not
(
Cil
.
is_builtin
vi
)
&&
not
(
Cil
.
is_builtin
vi
)
...
@@ -298,9 +298,10 @@ class dup_functions_visitor prj = object (self)
...
@@ -298,9 +298,10 @@ class dup_functions_visitor prj = object (self)
Cil_datatype
.
Varinfo
.
Hashtbl
.
add
fct_tbl
vi
new_vi
;
Cil_datatype
.
Varinfo
.
Hashtbl
.
add
fct_tbl
vi
new_vi
;
Cil
.
DoChildrenPost
Cil
.
DoChildrenPost
(
fun
l
->
match
l
with
(
fun
l
->
match
l
with
|
[
GVarDecl
(
_
,
vi
,
_
)
|
GFun
({
svar
=
vi
}
,
_
)
as
g
]
->
|
[
GVarDecl
(
vi
,
_
)
|
GFunDecl
(
_
,
vi
,
_
)
|
GFun
({
svar
=
vi
}
,
_
)
as
g
]
->
(
match
g
with
(
match
g
with
|
GVar
Decl
_
->
|
GFun
Decl
_
->
if
not
(
Kernel_function
.
is_definition
(
Extlib
.
the
self
#
current_kf
))
if
not
(
Kernel_function
.
is_definition
(
Extlib
.
the
self
#
current_kf
))
&&
vi
.
vname
<>
"malloc"
&&
vi
.
vname
<>
"free"
&&
vi
.
vname
<>
"malloc"
&&
vi
.
vname
<>
"free"
then
then
...
@@ -334,14 +335,16 @@ if there are memory-related annotations.@]"
...
@@ -334,14 +335,16 @@ if there are memory-related annotations.@]"
in
in
self
#
dup_libc
g
new_g
self
#
dup_libc
g
new_g
|
_
->
assert
false
)
|
_
->
assert
false
)
|
GVarDecl
(
_
,
_
,
loc
)
|
GFun
(
_
,
loc
)
when
Misc
.
is_library_loc
loc
->
|
GVarDecl
(
_
,
loc
)
|
GFunDecl
(
_
,
_
,
loc
)
|
GFun
(
_
,
loc
)
when
Misc
.
is_library_loc
loc
->
(
match
before_memory_model
with
(
match
before_memory_model
with
|
Before_gmp
->
before_memory_model
<-
Gmp
|
Before_gmp
->
before_memory_model
<-
Gmp
|
Gmp
|
Memory_model
->
()
|
Gmp
|
Memory_model
->
()
|
After_gmp
->
before_memory_model
<-
Memory_model
|
After_gmp
->
before_memory_model
<-
Memory_model
|
Code
->
assert
false
);
|
Code
->
assert
false
);
Cil
.
JustCopy
Cil
.
JustCopy
|
GVarDecl
(
_
,
vi
,
_
)
|
GFun
({
svar
=
vi
}
,
_
)
when
Cil
.
is_builtin
vi
->
|
GVarDecl
(
vi
,
_
)
|
GFunDecl
(
_
,
vi
,
_
)
|
GFun
({
svar
=
vi
}
,
_
)
when
Cil
.
is_builtin
vi
->
self
#
next
()
;
self
#
next
()
;
Cil
.
JustCopy
Cil
.
JustCopy
|
_
->
|
_
->
...
...
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/visit.ml
+
5
−
4
View file @
81778b06
...
@@ -253,7 +253,8 @@ you must call function `%s' and `__e_acsl_memory_clean by yourself.@]"
...
@@ -253,7 +253,8 @@ you must call function `%s' and `__e_acsl_memory_clean by yourself.@]"
f
)
f
)
method
!
vglob_aux
=
function
method
!
vglob_aux
=
function
|
GVarDecl
(
_
,
vi
,
_
)
|
GVar
(
vi
,
_
,
_
)
|
GFun
({
svar
=
vi
}
,
_
)
|
GVarDecl
(
vi
,
_
)
|
GVar
(
vi
,
_
,
_
)
|
GFunDecl
(
_
,
vi
,
_
)
|
GFun
({
svar
=
vi
}
,
_
)
when
Misc
.
is_library_loc
vi
.
vdecl
->
when
Misc
.
is_library_loc
vi
.
vdecl
->
if
generate
then
if
generate
then
Cil
.
JustCopyPost
Cil
.
JustCopyPost
...
@@ -264,7 +265,7 @@ you must call function `%s' and `__e_acsl_memory_clean by yourself.@]"
...
@@ -264,7 +265,7 @@ you must call function `%s' and `__e_acsl_memory_clean by yourself.@]"
Misc
.
register_library_function
vi
;
Misc
.
register_library_function
vi
;
Cil
.
SkipChildren
Cil
.
SkipChildren
end
end
|
GVarDecl
(
_
,
vi
,
_
)
|
GVar
(
vi
,
_
,
_
)
|
GFun
({
svar
=
vi
}
,
_
)
|
GVarDecl
(
vi
,
_
)
|
GVar
(
vi
,
_
,
_
)
|
GFun
({
svar
=
vi
}
,
_
)
when
Cil
.
is_builtin
vi
->
when
Cil
.
is_builtin
vi
->
if
generate
then
Cil
.
JustCopy
else
Cil
.
SkipChildren
if
generate
then
Cil
.
JustCopy
else
Cil
.
SkipChildren
|
g
when
Misc
.
is_library_loc
(
Global
.
loc
g
)
->
|
g
when
Misc
.
is_library_loc
(
Global
.
loc
g
)
->
...
@@ -289,7 +290,7 @@ you must call function `%s' and `__e_acsl_memory_clean by yourself.@]"
...
@@ -289,7 +290,7 @@ you must call function `%s' and `__e_acsl_memory_clean by yourself.@]"
[vfile]) *)
[vfile]) *)
if
vi
.
vorig_name
=
Kernel
.
MainFunction
.
get
()
then
if
vi
.
vorig_name
=
Kernel
.
MainFunction
.
get
()
then
main_fct
<-
Some
fundec
main_fct
<-
Some
fundec
|
GVarDecl
(
_
,
vi
,
_
)
->
|
GVarDecl
(
vi
,
_
)
|
GFunDecl
(
_
,
vi
,
_
)
->
(* do not convert extern ghost variables, because they can't be linked,
(* do not convert extern ghost variables, because they can't be linked,
see bts #1392 *)
see bts #1392 *)
if
vi
.
vstorage
<>
Extern
then
if
vi
.
vstorage
<>
Extern
then
...
@@ -298,7 +299,7 @@ you must call function `%s' and `__e_acsl_memory_clean by yourself.@]"
...
@@ -298,7 +299,7 @@ you must call function `%s' and `__e_acsl_memory_clean by yourself.@]"
()
()
in
in
(
match
g
with
(
match
g
with
|
GVar
(
vi
,
_
,
_
)
|
GVarDecl
(
_
,
vi
,
_
)
->
|
GVar
(
vi
,
_
,
_
)
|
GVarDecl
(
vi
,
_
)
->
Varinfo
.
Hashtbl
.
replace
global_vars
vi
None
Varinfo
.
Hashtbl
.
replace
global_vars
vi
None
|
_
->
()
);
|
_
->
()
);
if
generate
then
Cil
.
DoChildrenPost
(
fun
g
->
List
.
iter
do_it
g
;
g
)
if
generate
then
Cil
.
DoChildrenPost
(
fun
g
->
List
.
iter
do_it
g
;
g
)
...
...
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