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
e8e8307f
Commit
e8e8307f
authored
1 year ago
by
Jan Rochel
Browse files
Options
Downloads
Patches
Plain Diff
[alias] cosmetics: simplify pretty-printing
parent
ffb8b4cc
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/alias/src/abstract_state.ml
+4
-15
4 additions, 15 deletions
src/plugins/alias/src/abstract_state.ml
with
4 additions
and
15 deletions
src/plugins/alias/src/abstract_state.ml
+
4
−
15
View file @
e8e8307f
...
@@ -93,11 +93,7 @@ module VarMap = struct
...
@@ -93,11 +93,7 @@ module VarMap = struct
|
Some
l
,
Some
r
->
Some
(
l
,
r
)
|
Some
l
,
Some
r
->
Some
(
l
,
r
)
|
_
->
None
|
_
->
None
let
pretty
fmt
=
let
pretty
=
let
module
M
=
Make
(
Datatype
.
Int
)
in
M
.
pretty
let
is_first
=
ref
true
in
iter
(
fun
var
v
->
if
!
is_first
then
is_first
:=
false
else
Format
.
fprintf
fmt
"@;<3>"
;
Format
.
fprintf
fmt
"@ @[%a:%d@]"
Varinfo
.
pretty
var
v
)
end
end
type
state
=
type
state
=
...
@@ -261,19 +257,12 @@ module Pretty = struct
...
@@ -261,19 +257,12 @@ module Pretty = struct
G
.
iter_vertex
pp_unconnected_vertex
s
.
graph
)
G
.
iter_vertex
pp_unconnected_vertex
s
.
graph
)
let
pp_aliases
fmt
s
=
let
pp_aliases
fmt
s
=
let
is_first
=
ref
true
in
let
alias_set_of_vertex
(
i
,
_
)
=
let
pp_alias_set
_
set_lv
=
if
!
is_first
then
is_first
:=
false
else
Format
.
fprintf
fmt
"@;<2>"
;
LSet
.
pretty
fmt
set_lv
in
let
alias_set_of_vertex
i
_
=
let
aliases
=
Readout
.
lvals_pointing_to_vertex
i
s
in
let
aliases
=
Readout
.
lvals_pointing_to_vertex
i
s
in
if
LSet
.
cardinal
aliases
>=
2
then
Some
aliases
else
None
if
LSet
.
cardinal
aliases
>=
2
then
Some
aliases
else
None
in
in
let
alias_sets
=
VMap
.
filter_map
alias_set_of_vertex
s
.
vmap
in
let
alias_sets
=
List
.
filter_map
alias_set_of_vertex
@@
VMap
.
bindings
s
.
vmap
in
if
VMap
.
is_empty
alias_sets
Pretty_utils
.
pp_list
~
empty
:
"<none>"
~
sep
:
"@;<2>"
LSet
.
pretty
fmt
alias_sets
then
Format
.
fprintf
fmt
"<none>"
else
VMap
.
iter
pp_alias_set
alias_sets
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