Skip to content
Snippets Groups Projects
Commit 9cdbc8d9 authored by Thibault Martin's avatar Thibault Martin Committed by Allan Blanchard
Browse files

Use Term compare function

parent f425dd10
No related branches found
No related tags found
No related merge requests found
...@@ -92,6 +92,9 @@ let get_custom_mode mode = ...@@ -92,6 +92,9 @@ let get_custom_mode mode =
| None -> Kernel.abort "Mode %s is not registered" mode | None -> Kernel.abort "Mode %s is not registered" mode
| Some custom_mode -> custom_mode | Some custom_mode -> custom_mode
let compare_it it1 it2 =
Cil_datatype.Term.compare it1.it_content it2.it_content
module type Generator = module type Generator =
sig sig
...@@ -250,11 +253,11 @@ struct ...@@ -250,11 +253,11 @@ struct
| FromAny, _ -> 1 | FromAny, _ -> 1
| _, FromAny -> -1 | _, FromAny -> -1
| From l1, From l2 -> | From l1, From l2 ->
Extlib.list_compare Cil_datatype.Identified_term.compare l1 l2 Extlib.list_compare compare_it l1 l2
let compare_from (f1, d1) (f2, d2) = let compare_from (f1, d1) (f2, d2) =
let r = Cil_datatype.Identified_term.compare f1 f2 in let r = compare_it f1 f2 in
if r <> 0 then compare_deps d1 d2 else r if r <> 0 then r else compare_deps d1 d2
let combine_default clauses = let combine_default clauses =
(* Note: combination is made on a set of complete behaviors in the sens of (* Note: combination is made on a set of complete behaviors in the sens of
...@@ -265,7 +268,7 @@ struct ...@@ -265,7 +268,7 @@ struct
in in
let deps = function let deps = function
| FromAny -> FromAny | FromAny -> FromAny
| From l -> From (List.sort_uniq Cil_datatype.Identified_term.compare l) | From l -> From (List.sort_uniq compare_it l)
in in
let froms = let froms =
List.map (fun (e, ds) -> e, deps ds) @@ List.fold_left collect [] clauses List.map (fun (e, ds) -> e, deps ds) @@ List.fold_left collect [] clauses
...@@ -413,8 +416,8 @@ struct ...@@ -413,8 +416,8 @@ struct
| _ -> assert false | _ -> assert false
in in
let f, a = List.fold_left collect ([],[]) clauses in let f, a = List.fold_left collect ([],[]) clauses in
let f = List.sort_uniq Cil_datatype.Identified_term.compare f in let f = List.sort_uniq compare_it f in
let a = List.sort_uniq Cil_datatype.Identified_term.compare a in let a = List.sort_uniq compare_it a in
FreeAlloc(f, a) FreeAlloc(f, a)
let custom_default mode kf spec = let custom_default mode kf spec =
......
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