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
9644abd7
Commit
9644abd7
authored
4 years ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
[variadic] translates __sync family
parent
f276cd9c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/variadic/classify.ml
+1
-0
1 addition, 0 deletions
src/plugins/variadic/classify.ml
src/plugins/variadic/translate.ml
+8
-11
8 additions, 11 deletions
src/plugins/variadic/translate.ml
with
9 additions
and
11 deletions
src/plugins/variadic/classify.ml
+
1
−
0
View file @
9644abd7
...
...
@@ -148,6 +148,7 @@ let classify_std env vi = match vi.vname with
(* stropts.h *)
|
"ioctl"
->
mk_overload
env
[
"__va_ioctl_void"
;
"__va_ioctl_int"
;
"__va_ioctl_ptr"
]
|
n
when
Extlib
.
string_prefix
"__sync_"
n
->
Misc
|
n
when
Cil_builtins
.
Builtin_functions
.
mem
n
->
Builtin
(* Anything else *)
|
_
->
Unknown
...
...
This diff is collapsed.
Click to expand it.
src/plugins/variadic/translate.ml
+
8
−
11
View file @
9644abd7
...
...
@@ -54,8 +54,7 @@ let translate_variadics (file : file) =
method
!
vglob
glob
=
begin
match
glob
with
|
GFunDecl
(
_
,
vi
,
_
)
|
GFun
({
svar
=
vi
}
,
_
)
when
not
(
is_framac_builtin
vi
)
->
|
GFunDecl
(
_
,
vi
,
_
)
|
GFun
({
svar
=
vi
}
,
_
)
->
if
not
(
Table
.
mem
classification
vi
)
then
begin
let
vf
=
Classify
.
classify
env
vi
in
Option
.
iter
(
Table
.
add
classification
vi
)
vf
...
...
@@ -88,16 +87,14 @@ let translate_variadics (file : file) =
(* Translate types and signatures *)
method
!
vglob
glob
=
begin
match
glob
with
|
GFunDecl
(
_
,
vi
,
_
)
when
is_framac_builtin
vi
->
if
Classify
.
classify
env
vi
<>
None
then
begin
Self
.
result
~
level
:
2
~
current
:
true
"Variadic builtin %s left untransformed."
vi
.
vname
;
end
;
Cil
.
SkipChildren
|
GFunDecl
(
_
,
vi
,
_
)
->
if
Table
.
mem
classification
vi
then
Generic
.
add_vpar
vi
;
(
match
Table
.
find_opt
classification
vi
with
|
None
->
()
|
Some
{
vf_class
=
Builtin
}
->
Self
.
result
~
level
:
2
~
current
:
true
"Variadic builtin %s left untransformed."
vi
.
vname
;
|
Some
_
->
Generic
.
add_vpar
vi
);
Cil
.
DoChildren
|
GFun
({
svar
=
vi
}
as
fundec
,
_
)
->
...
...
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