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
807f02cc
Commit
807f02cc
authored
3 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[callgraph] Exports via dynamic [iter_in_rev_order] and [accept_base] used by Eva.
parent
1b5d11ad
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/callgraph/uses.ml
+19
-0
19 additions, 0 deletions
src/plugins/callgraph/uses.ml
with
19 additions
and
0 deletions
src/plugins/callgraph/uses.ml
+
19
−
0
View file @
807f02cc
...
...
@@ -73,6 +73,15 @@ let iter_in_rev_order =
in
fun
f
->
I
.
iter
(
Cg
.
get
()
)
f
let
_iter_in_rev_order
=
Dynamic
.
register
~
comment
:
"Iterate over all the functions in the callgraph in reverse order"
~
plugin
:
Options
.
name
"iter_in_rev_order"
Datatype
.(
func
(
func
Kernel_function
.
ty
unit
)
unit
)
~
journalize
:
false
iter_in_rev_order
let
iter_on_aux
iter_dir
f
kf
=
let
cg
=
Cg
.
get
()
in
if
Cg
.
G
.
mem_vertex
cg
kf
then
...
...
@@ -116,6 +125,16 @@ let accept_base ~with_formals ~with_locals kf v =
|
true
,
_
,
Declaration
(
_
,
vd
,
_
,
_
)
->
Base
.
is_formal_of_prototype
v
vd
)
||
is_local_or_formal_of_caller
v
kf
let
_accept_base
=
Dynamic
.
register
~
comment
:
"Returns [true] if the given base is a global, \
or a formal or local of either [kf] or one of its callers"
~
plugin
:
Options
.
name
"accept_base"
Datatype
.(
func2
Kernel_function
.
ty
Base
.
ty
bool
)
~
journalize
:
false
(
fun
kf
b
->
accept_base
~
with_formals
:
true
~
with_locals
:
true
kf
b
)
let
nb_calls
()
=
let
g
=
Cg
.
get
()
in
(* [g] contains bidirectional edges (from caller to callee and
...
...
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