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
ecd1cf53
Commit
ecd1cf53
authored
11 years ago
by
Julien Signoles
Committed by
Zaynah Dargaye
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
code simplification when moving labels
parent
7c61ba85
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/e-acsl/label.ml
+2
-7
2 additions, 7 deletions
src/plugins/e-acsl/label.ml
with
2 additions
and
7 deletions
src/plugins/e-acsl/label.ml
+
2
−
7
View file @
ecd1cf53
...
...
@@ -30,16 +30,11 @@ let move (vis:Visitor.generic_frama_c_visitor) ~old new_stmt =
old
.
labels
<-
[]
;
new_stmt
.
labels
<-
labels
@
new_stmt
.
labels
;
(* update the gotos of the function jumping to one of the labels *)
let
update_label
sref
=
(* [!s_ref] and [old] are not part of the same project, thus it is
safer to compare the ids than to use Stmt.equal *)
if
!
sref
.
sid
=
old
.
sid
then
sref
:=
new_stmt
in
let
o
=
object
inherit
Visitor
.
frama_c_inplace
method
!
vstmt_aux
s
=
match
s
.
skind
with
|
Goto
(
s_ref
,
_
)
->
update_label
s_ref
;
if
Cil_datatype
.
Stmt
.
equal
!
s_ref
old
then
s_ref
:=
new_stmt
;
Cil
.
SkipChildren
|
_
->
Cil
.
DoChildren
(* improve efficiency: skip childrens which cannot contain any label *)
...
...
@@ -49,7 +44,7 @@ let move (vis:Visitor.generic_frama_c_visitor) ~old new_stmt =
end
in
let
f
=
Extlib
.
the
vis
#
current_func
in
let
mv_labels
s
=
ignore
(
Visitor
.
visitFramacStmt
o
(
Cil
.
get
_stmt
vis
#
behavior
s
))
ignore
(
Visitor
.
visitFramacStmt
o
(
Cil
.
memo
_stmt
vis
#
behavior
s
))
in
List
.
iter
mv_labels
f
.
sallstmts
...
...
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