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
c9a5ae13
Commit
c9a5ae13
authored
1 year ago
by
Thibault Martin
Committed by
Allan Blanchard
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Is_populated now remember clauses individually
parent
5cfc38d2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/kernel_internals/typing/populate_spec.ml
+28
-14
28 additions, 14 deletions
src/kernel_internals/typing/populate_spec.ml
with
28 additions
and
14 deletions
src/kernel_internals/typing/populate_spec.ml
+
28
−
14
View file @
c9a5ae13
...
...
@@ -824,10 +824,26 @@ let do_populate clauses kf original_spec =
Allocates
.
emit
config
.
allocates
kf
bhv
allocates
;
Terminates
.
emit
config
.
terminates
kf
bhv
terminates
module
Clauses
=
Datatype
.
Make
(
struct
include
Datatype
.
Serializable_undefined
type
t
=
clause
let
name
=
"clause"
let
reprs
=
[
`Exits
;
`Assigns
;
`Requires
;
`Allocates
;
`Terminates
]
let
equal
a
b
=
a
=
b
let
compare
=
Stdlib
.
compare
let
hash
=
Hashtbl
.
hash
end
)
module
Key
=
Datatype
.
Pair_with_collections
(
Kernel_function
)
(
Clauses
)
(
struct
let
module_name
=
"Populate_spec.Key.t"
end
)
(* Hashtbl used to memorize which kernel function has been populated. *)
module
Is_populated
=
State_builder
.
Hashtbl
(
Ke
rnel_function
.
Hashtbl
)
(
Ke
y
.
Hashtbl
)
(
Datatype
.
Unit
)
(
struct
let
size
=
17
...
...
@@ -837,26 +853,24 @@ module Is_populated =
let
()
=
Ast
.
add_linked_state
Is_populated
.
self
(* Performs specification on [kf] if all requirements are met :
- force is [true]
OR
[-generate-default-spec] is [true] (by default).
- Function has not been populated yet.
- force is [true]
OR
[kf] is not a prototype
(* Perform specification generation for [kf] if all requirements are met :
- [clauses] is not empty
AND
[clauses] contains clauses not already generated for [kf]
- [kf] is a prototype
OR
[
kf]'s specification is empty
[
do_body] is true
*)
let
populate_funspec
?
(
do_body
=
false
)
?
funspec
kf
clauses
=
let
funspec
=
match
funspec
with
|
None
->
Annotations
.
funspec
kf
|
Some
funspec
->
funspec
in
if
not
@@
Is_populated
.
mem
kf
then
let
not_populated
c
=
not
@@
Is_populated
.
mem
(
kf
,
c
)
in
let
todo_clauses
=
List
.
filter
not_populated
clauses
in
if
todo_clauses
<>
[]
then
let
is_proto
=
not
@@
Kernel_function
.
has_definition
kf
in
if
is_proto
||
do_body
then
begin
do_populate
clauses
kf
funspec
;
Is_populated
.
add
kf
()
;
do_populate
todo_
clauses
kf
funspec
;
List
.
iter
(
fun
c
->
Is_populated
.
add
(
kf
,
c
)
()
)
todo_clauses
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