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
831465fa
Commit
831465fa
authored
3 years ago
by
David Bühler
Committed by
Virgile Prevosto
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[kernel] Rmtmps: optimizes markReferenced visitor.
parent
bfa278e9
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/rmtmps.ml
+16
-12
16 additions, 12 deletions
src/kernel_internals/typing/rmtmps.ml
with
16 additions
and
12 deletions
src/kernel_internals/typing/rmtmps.ml
+
16
−
12
View file @
831465fa
...
...
@@ -581,7 +581,7 @@ let global_type_and_name = function
|
GText
_
->
"<text>"
|
GAnnot
_
->
"<annot>"
class
markReferencedVisitor
=
object
class
markReferencedVisitor
=
object
(
self
)
inherit
nopCilVisitor
val
dkey
=
Kernel
.
dkey_referenced
...
...
@@ -589,6 +589,13 @@ class markReferencedVisitor = object
val
inside_exp
:
exp
Stack
.
t
=
Stack
.
create
()
val
inside_typ
:
typ
Stack
.
t
=
Stack
.
create
()
method
private
reference
varinfo
loc
=
if
not
(
hasAttribute
"FC_BUILTIN"
varinfo
.
vattr
)
then
begin
Kernel
.
debug
~
dkey
"referenced: var/fun %s@."
varinfo
.
vname
;
Kernel
.
debug
~
source
:
(
fst
loc
)
~
dkey
"referenced: fun %s"
varinfo
.
vname
;
varinfo
.
vreferenced
<-
true
;
end
method
!
vglob
=
function
|
GType
(
typeinfo
,
loc
)
->
Kernel
.
debug
~
source
:
(
fst
loc
)
~
dkey
"referenced: type %s"
typeinfo
.
tname
;
...
...
@@ -604,19 +611,14 @@ class markReferencedVisitor = object
Kernel
.
debug
~
source
:
(
fst
loc
)
~
dkey
"referenced: enum %s"
enuminfo
.
ename
;
enuminfo
.
ereferenced
<-
true
;
DoChildren
|
GVar
(
varinfo
,
_
,
loc
)
|
GVarDecl
(
varinfo
,
loc
)
|
GFunDecl
(
_
,
varinfo
,
loc
)
|
GFun
({
svar
=
varinfo
}
,
loc
)
->
if
not
(
hasAttribute
"FC_BUILTIN"
varinfo
.
vattr
)
then
begin
Kernel
.
debug
~
dkey
"referenced: var/fun %s@."
varinfo
.
vname
;
Kernel
.
debug
~
source
:
(
fst
loc
)
~
dkey
"referenced: fun %s"
varinfo
.
vname
;
varinfo
.
vreferenced
<-
true
;
end
;
|
GVar
(
varinfo
,
_
,
loc
)
|
GFun
({
svar
=
varinfo
}
,
loc
)
->
self
#
reference
varinfo
loc
;
DoChildren
|
GAnnot
_
->
DoChildren
|
_
->
|
GVarDecl
(
varinfo
,
loc
)
|
GFunDecl
(
_
,
varinfo
,
loc
)
->
self
#
reference
varinfo
loc
;
SkipChildren
|
_
->
SkipChildren
method
!
vtype
=
function
|
TNamed
(
ti
,
_
)
->
...
...
@@ -661,6 +663,8 @@ class markReferencedVisitor = object
end
;
SkipChildren
method
!
vspec
_
=
SkipChildren
method
!
vcode_annot
_
=
SkipChildren
end
let
markReferenced
ast
=
...
...
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