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
95341df4
Commit
95341df4
authored
5 years ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
[kernel] use standard `compare_list` for list comparison
parent
618c6118
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_services/ast_queries/cil_datatype.ml
+12
-18
12 additions, 18 deletions
src/kernel_services/ast_queries/cil_datatype.ml
with
12 additions
and
18 deletions
src/kernel_services/ast_queries/cil_datatype.ml
+
12
−
18
View file @
95341df4
...
...
@@ -1377,24 +1377,18 @@ module Logic_info_structural = struct
l_body
=
LBnone
})
Logic_var
.
reprs
let
compare
i1
i2
=
match
String
.
compare
i1
.
l_var_info
.
lv_name
i2
.
l_var_info
.
lv_name
with
|
(
-
1
|
1
)
as
res
->
res
|
_
->
let
rec
profile_cmp
p1
p2
=
match
p1
,
p2
with
|
[]
,
[]
->
0
|
[]
,
_
->
-
1
|
_
,
[]
->
1
|
h1
::
t1
,
h2
::
t2
->
let
ty1
=
h1
.
lv_type
in
let
ty2
=
h2
.
lv_type
in
let
config
=
{
by_name
=
true
;
logic_type
=
true
;
unroll
=
true
}
in
match
compare_logic_type
config
ty1
ty2
with
|
(
-
1
|
1
)
as
res
->
res
|
_
->
profile_cmp
t1
t2
in
profile_cmp
i1
.
l_profile
i2
.
l_profile
let
name_cmp
=
String
.
compare
i1
.
l_var_info
.
lv_name
i2
.
l_var_info
.
lv_name
in
if
name_cmp
<>
0
then
name_cmp
else
begin
let
config
=
{
by_name
=
true
;
logic_type
=
true
;
unroll
=
true
}
in
let
prm_cmp
p1
p2
=
compare_logic_type
config
p1
.
lv_type
p2
.
lv_type
in
compare_list
prm_cmp
i1
.
l_profile
i2
.
l_profile
end
let
equal
i1
i2
=
Logic_var
.
equal
i1
.
l_var_info
i2
.
l_var_info
let
hash
i
=
Logic_var
.
hash
i
.
l_var_info
...
...
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