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
c08c6e47
Commit
c08c6e47
authored
3 years ago
by
Andre Maroneze
Browse files
Options
Downloads
Patches
Plain Diff
[Kernel] cleanup unused code in Rmtmps
parent
3873db16
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/kernel_internals/typing/rmtmps.ml
+3
-10
3 additions, 10 deletions
src/kernel_internals/typing/rmtmps.ml
with
3 additions
and
10 deletions
src/kernel_internals/typing/rmtmps.ml
+
3
−
10
View file @
c08c6e47
...
@@ -790,8 +790,6 @@ let remove_unused_labels ?(is_removable=label_removable) func =
...
@@ -790,8 +790,6 @@ let remove_unused_labels ?(is_removable=label_removable) func =
(
visitCilBlock
(
new
removeUnusedLabels
is_removable
usedLabels
)
func
.
sbody
)
(
visitCilBlock
(
new
removeUnusedLabels
is_removable
usedLabels
)
func
.
sbody
)
let
removeUnmarked
isRoot
ast
reachable_tbl
=
let
removeUnmarked
isRoot
ast
reachable_tbl
=
let
removedLocals
=
ref
[]
in
let
filterGlobal
global
=
let
filterGlobal
global
=
match
global
with
match
global
with
(* unused global types, variables, and functions are simply removed *)
(* unused global types, variables, and functions are simply removed *)
...
@@ -823,11 +821,7 @@ let removeUnmarked isRoot ast reachable_tbl =
...
@@ -823,11 +821,7 @@ let removeUnmarked isRoot ast reachable_tbl =
if
(
local
.
vtemp
||
local
.
vstorage
=
Static
)
&&
if
(
local
.
vtemp
||
local
.
vstorage
=
Static
)
&&
not
(
is_reachable
reachable_tbl
(
Var
local
))
then
not
(
is_reachable
reachable_tbl
(
Var
local
))
then
begin
begin
(* along the way, record the interesting locals that were removed *)
Kernel
.
debug
~
dkey
"removing local: %s"
local
.
vname
;
let
name
=
local
.
vname
in
(
Kernel
.
debug
~
dkey
"removing local: %s"
name
);
removedLocals
:=
(
func
.
svar
.
vname
^
"::"
^
name
)
::
!
removedLocals
;
false
false
end
else
true
end
else
true
in
in
...
@@ -873,8 +867,7 @@ let removeUnmarked isRoot ast reachable_tbl =
...
@@ -873,8 +867,7 @@ let removeUnmarked isRoot ast reachable_tbl =
end
;
end
;
Kernel
.
debug
~
dkey
"kept global %s (%a)"
(
global_type_and_name
rg
)
Printer
.
pp_global
rg
Kernel
.
debug
~
dkey
"kept global %s (%a)"
(
global_type_and_name
rg
)
Printer
.
pp_global
rg
)
keptGlobals
;
)
keptGlobals
;
end
;
end
!
removedLocals
(***********************************************************************
(***********************************************************************
...
@@ -914,7 +907,7 @@ let removeUnused ?(isRoot=isExportedRoot) ast =
...
@@ -914,7 +907,7 @@ let removeUnused ?(isRoot=isExportedRoot) ast =
markReferenced
ast
;
markReferenced
ast
;
(* take out the trash *)
(* take out the trash *)
ignore
(
removeUnmarked
isRoot
ast
reachable_tbl
)
removeUnmarked
isRoot
ast
reachable_tbl
end
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