Skip to content
Snippets Groups Projects
Commit ae81c18f authored by David Bühler's avatar David Bühler
Browse files

[Eva] Statistics: fixes the equality between keys.

parent 499b41b5
No related branches found
No related tags found
No related merge requests found
...@@ -100,12 +100,7 @@ module Key = Datatype.Make_with_collections ( ...@@ -100,12 +100,7 @@ module Key = Datatype.Make_with_collections (
let rehash (Key (s, x)) = let rehash (Key (s, x)) =
(Key (register s.name s.kind, x)) (Key (register s.name s.kind, x))
let reprs = [Key ({ id = 0; name="dummy"; kind=Global }, ())] let reprs = [Key ({ id = 0; name="dummy"; kind=Global }, ())]
let equal (Key (s1,x1)) (Key (s2,x2)) = let equal = Datatype.from_compare
match s1.kind, s2.kind with
| Global, Global -> true
| Function, Function -> Kernel_function.equal x1 x2
| Statement, Statement -> Cil_datatype.Stmt.equal x1 x2
| _, _ -> false
let compare (Key (s1,x1)) (Key (s2,x2)) = let compare (Key (s1,x1)) (Key (s2,x2)) =
let c = s1.id - s2.id in let c = s1.id - s2.id in
if c <> 0 then c else if c <> 0 then c else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment