diff --git a/infer/src/IR/Csu.re b/infer/src/IR/Csu.re index dcba9cdd2..d263756e8 100644 --- a/infer/src/IR/Csu.re +++ b/infer/src/IR/Csu.re @@ -15,13 +15,15 @@ open! Utils; type class_kind = | CPP | Java - | Objc; + | Objc +[@@deriving compare]; type t = | Class class_kind | Struct | Union - | Protocol; + | Protocol +[@@deriving compare]; let name = fun @@ -30,26 +32,4 @@ let name = | Union => "union" | Protocol => "protocol"; -let class_kind_num = - fun - | CPP => 1 - | Java => 2 - | Objc => 3; - -let class_kind_compare ck1 ck2 => class_kind_num ck1 - class_kind_num ck2; - -let compare dstruct1 dstruct2 => - switch (dstruct1, dstruct2) { - | (Class ck1, Class ck2) => class_kind_compare ck1 ck2 - | (Class _, _) => (-1) - | (_, Class _) => 1 - | (Struct, Struct) => 0 - | (Struct, _) => (-1) - | (_, Struct) => 1 - | (Union, Union) => 0 - | (Union, _) => (-1) - | (_, Union) => 1 - | (Protocol, Protocol) => 0 - }; - let equal tn1 tn2 => compare tn1 tn2 == 0; diff --git a/infer/src/IR/Csu.rei b/infer/src/IR/Csu.rei index 649777aea..208384cba 100644 --- a/infer/src/IR/Csu.rei +++ b/infer/src/IR/Csu.rei @@ -15,16 +15,16 @@ open! Utils; type class_kind = | CPP | Java - | Objc; + | Objc +[@@deriving compare]; type t = | Class class_kind | Struct | Union - | Protocol; - -let name: t => string; - -let compare: t => t => int; + | Protocol +[@@deriving compare]; let equal: t => t => bool; + +let name: t => string;