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
a4997a00
Commit
a4997a00
authored
1 year ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
[kernel] remove obsolete type binding
parent
af90bdaa
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/kernel_services/ast_data/cil_types.ml
+19
-9
19 additions, 9 deletions
src/kernel_services/ast_data/cil_types.ml
src/kernel_services/ast_queries/file.ml
+1
-81
1 addition, 81 deletions
src/kernel_services/ast_queries/file.ml
with
20 additions
and
90 deletions
src/kernel_services/ast_data/cil_types.ml
+
19
−
9
View file @
a4997a00
...
...
@@ -1884,6 +1884,20 @@ type syntactic_scope =
@since 27.0-Cobalt
*)
let
yaml_dict_to_list
=
function
|
`O
l
->
let
make_one
acc
(
k
,
v
)
=
Result
.(
bind
acc
(
fun
l
->
match
Yaml
.
Util
.
to_string
v
with
|
Ok
s
->
Ok
((
k
,
s
)
::
l
)
|
Error
(
`Msg
s
)
->
Error
(
`Msg
(
"Unexpected value for key "
^
k
^
": "
^
s
))))
in
List
.
fold_left
make_one
(
Ok
[]
)
l
|
_
->
Error
(
`Msg
"Unexpected YAML value instead of dictionary of strings"
)
(** Definition of a machine model (architecture + compiler).
@see <https://frama-c.com/download/frama-c-plugin-development-guide.pdf> *)
type
mach
=
{
...
...
@@ -1948,13 +1962,9 @@ type mach = {
rand_max
:
string
;
(* expansion of RAND_MAX macro *)
mb_cur_max
:
string
;
(* expansion of MB_CUR_MAX macro *)
nsig
:
string
;
(* expansion of non-standard NSIG macro, empty if undefined *)
errno
:
(
string
*
string
)
list
;
(* list of macros defining errors in errno.h*)
(* list of macros defining errors in errno.h*)
errno
:
(
string
*
string
)
list
[
@
of_yaml
yaml_dict_to_list
];
machdep_name
:
string
;
(* name of the machdep *)
custom_defs
:
(
string
*
string
)
list
;
(* sequence of key/value for C macros *)
}
(*
Local Variables:
compile-command: "make -C ../../.."
End:
*)
(* sequence of key/value for C macros *)
custom_defs
:
(
string
*
string
)
list
[
@
of_yaml
yaml_dict_to_list
];
}
[
@@
deriving
yaml
]
This diff is collapsed.
Click to expand it.
src/kernel_services/ast_queries/file.ml
+
1
−
81
View file @
a4997a00
...
...
@@ -314,86 +314,6 @@ let set_machdep () =
let
()
=
Cmdline
.
run_after_configuring_stage
set_machdep
let
yaml_dict_to_list
=
function
|
`O
l
->
let
make_one
acc
(
k
,
v
)
=
Result
.(
bind
acc
(
fun
l
->
match
Yaml
.
Util
.
to_string
v
with
|
Ok
s
->
Ok
((
k
,
s
)
::
l
)
|
Error
(
`Msg
s
)
->
Error
(
`Msg
(
"Unexpected value for key "
^
k
^
": "
^
s
))))
in
List
.
fold_left
make_one
(
Ok
[]
)
l
|
_
->
Error
(
`Msg
"Unexpected YAML value instead of dictionary of strings"
)
type
mach
=
Cil_types
.
mach
=
{
sizeof_short
:
int
;
sizeof_int
:
int
;
sizeof_long
:
int
;
sizeof_longlong
:
int
;
sizeof_ptr
:
int
;
sizeof_float
:
int
;
sizeof_double
:
int
;
sizeof_longdouble
:
int
;
sizeof_void
:
int
;
sizeof_fun
:
int
;
size_t
:
string
;
ssize_t
:
string
;
wchar_t
:
string
;
ptrdiff_t
:
string
;
intptr_t
:
string
;
uintptr_t
:
string
;
int_fast8_t
:
string
;
int_fast16_t
:
string
;
int_fast32_t
:
string
;
int_fast64_t
:
string
;
uint_fast8_t
:
string
;
uint_fast16_t
:
string
;
uint_fast32_t
:
string
;
uint_fast64_t
:
string
;
wint_t
:
string
;
sig_atomic_t
:
string
;
time_t
:
string
;
alignof_short
:
int
;
alignof_int
:
int
;
alignof_long
:
int
;
alignof_longlong
:
int
;
alignof_ptr
:
int
;
alignof_float
:
int
;
alignof_double
:
int
;
alignof_longdouble
:
int
;
alignof_str
:
int
;
alignof_fun
:
int
;
char_is_unsigned
:
bool
;
little_endian
:
bool
;
alignof_aligned
:
int
;
has__builtin_va_list
:
bool
;
compiler
:
string
;
cpp_arch_flags
:
string
list
;
version
:
string
;
weof
:
string
;
wordsize
:
string
;
posix_version
:
string
;
bufsiz
:
string
;
eof
:
string
;
fopen_max
:
string
;
filename_max
:
string
;
host_name_max
:
string
;
tty_name_max
:
string
;
l_tmpnam
:
string
;
path_max
:
string
;
tmp_max
:
string
;
rand_max
:
string
;
mb_cur_max
:
string
;
nsig
:
string
;
errno
:
(
string
*
string
)
list
[
@
of_yaml
yaml_dict_to_list
];
machdep_name
:
string
;
custom_defs
:
(
string
*
string
)
list
[
@
of_yaml
yaml_dict_to_list
];
}
[
@@
deriving
yaml
]
(* Local to this module. Use Cil.theMachine.theMachine outside *)
let
get_machdep
()
=
let
m
=
Kernel
.
Machdep
.
get
()
in
...
...
@@ -404,7 +324,7 @@ let get_machdep () =
let
res
=
Result
.
bind
(
Yaml_unix
.
of_file
(
Fpath
.
v
(
file
:>
string
)))
mach_of_yaml
Cil_types
.
mach_of_yaml
in
match
res
with
|
Ok
machdep
->
machdep
...
...
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