[infer] Remove ppx_compare workaround for nonrec types (2)

Summary:
The past issue with ppx_compare on nonrec types has (at some point) been fixed.

Greped for `let compare = compare` and removed the workaround for `nonrec`.

Reviewed By: jberdine

Differential Revision: D21973087

fbshipit-source-id: 5e2043e20
master
Ezgi Çiçek 5 years ago committed by Facebook GitHub Bot
parent a383f2afd2
commit c23e0044fc

@ -53,21 +53,15 @@ let equal = [%compare.equal: t]
let hash = Hashtbl.hash
module Set = Caml.Set.Make (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
end)
module Map = Caml.Map.Make (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
end)
module Hash = Hashtbl.Make (struct
type nonrec t = t
let equal = equal
type nonrec t = t [@@deriving equal]
let hash = hash
end)

@ -19,9 +19,7 @@ let get_field_name {field_name} = field_name
let is_java {class_name} = Typ.Name.Java.is_class class_name
module T = struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
end
module Set = Caml.Set.Make (T)

@ -74,21 +74,15 @@ let equal i1 i2 =
(** {2 Set for identifiers} *)
module Set = Caml.Set.Make (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
end)
module Map = Caml.Map.Make (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
end)
module Hash = Hashtbl.Make (struct
type nonrec t = t
let equal = equal
type nonrec t = t [@@deriving equal]
let hash (id : t) = Hashtbl.hash id
end)
@ -240,9 +234,7 @@ let to_string id = F.asprintf "%a" pp id
let pp_name f name = F.pp_print_string f (name_to_string name)
module HashQueue = Hash_queue.Make (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let hash = Hashtbl.hash

@ -13,15 +13,11 @@ module L = Logging
type t = {classname: string; package: string option} [@@deriving compare, equal]
module Map = Caml.Map.Make (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
end)
module Set = Caml.Set.Make (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
end)
let make ~package ~classname =

@ -49,13 +49,9 @@ let rename ~f {plain; mangled} =
module Set = Caml.Set.Make (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
end)
module Map = Caml.Map.Make (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
end)

@ -176,9 +176,7 @@ module Node = struct
end)
module IdMap = PrettyPrintable.MakePPMap (struct
type t = id
let compare = compare_id
type t = id [@@deriving compare]
let pp = pp_id
end)

@ -735,11 +735,7 @@ let make_java ~class_name ~return_type ~method_name ~parameters ~kind () =
let make_objc_dealloc name = ObjC_Cpp (ObjC_Cpp.make_dealloc name)
module Hashable = struct
type nonrec t = t
let equal = equal
let compare = compare
type nonrec t = t [@@deriving compare, equal]
let hash = hash
@ -751,17 +747,13 @@ module LRUHash = LRUHashtbl.Make (Hashable)
module HashQueue = Hash_queue.Make (Hashable)
module Map = PrettyPrintable.MakePPMap (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end)
module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end)
@ -801,9 +793,7 @@ let to_filename pname =
module SQLite = struct
module T = struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let hash = hash

@ -320,9 +320,7 @@ let is_objc_static_local_of_proc_name pname pvar =
let is_block_pvar pvar = Typ.has_block_prefix (Mangled.to_string (get_name pvar))
module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp Pp.text
end)

@ -509,17 +509,13 @@ module Name = struct
end
module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end)
module Map = PrettyPrintable.MakePPMap (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end)

@ -88,9 +88,7 @@ let get_footprint_index t =
module Map = PrettyPrintable.MakePPMap (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end)

@ -188,9 +188,7 @@ end
include Raw
module BaseMap = PrettyPrintable.MakePPMap (struct
type t = base
let compare = compare_base
type t = base [@@deriving compare]
let pp = pp_base
end)

@ -23,9 +23,7 @@ let dummy = make Procname.empty_block Location.dummy
let pp fmt t = F.fprintf fmt "%a at %a" Procname.pp t.pname Location.pp t.loc
module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end)

@ -94,9 +94,7 @@ let compare_err_data err_data1 err_data2 = Location.compare err_data1.loc err_da
module ErrDataSet = (* set err_data with no repeated loc *)
Caml.Set.Make (struct
type t = err_data
let compare = compare_err_data
type t = err_data [@@deriving compare]
end)
(** Hash table to implement error logs *)

@ -18,9 +18,7 @@ let site t = t.site
let pp fmt s = CallSite.pp fmt s.site
module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end)

@ -60,9 +60,7 @@ module DefaultNode : Node with type t = Procdesc.Node.t and type id = Procdesc.N
let pp_id = Procdesc.Node.pp_id
module OrderedId = struct
type t = id
let compare = compare_id
type t = id [@@deriving compare]
let pp = pp_id
end
@ -98,9 +96,7 @@ end = struct
let pp_id fmt (id, index) = F.fprintf fmt "(%a: %d)" Procdesc.Node.pp_id id index
module OrderedId = struct
type t = id
let compare = compare_id
type t = id [@@deriving compare]
let pp = pp_id
end

@ -49,9 +49,7 @@ module Make (Kind : Kind) = struct
let pp fmt s = F.fprintf fmt "%a(%a)" Kind.pp s.kind CallSite.pp s.site
module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end)

@ -65,9 +65,7 @@ module Make (Kind : Kind) = struct
let with_callsite t callee_site = {t with site= callee_site}
module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end)
@ -93,9 +91,7 @@ module Dummy = struct
module Kind = struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let matches ~caller ~callee = Int.equal 0 (compare caller callee)
@ -103,9 +99,7 @@ module Dummy = struct
end
module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end)

@ -48,9 +48,7 @@ let pp_range f (loc_start, loc_end) =
module Map = PrettyPrintable.MakePPMap (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end)

@ -24,9 +24,7 @@ type t =
let equal = [%compare.equal: t]
module OrderedSourceFile = struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
end
module Map = Caml.Map.Make (OrderedSourceFile)

@ -391,9 +391,7 @@ end = struct
module PathMap = Caml.Map.Make (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
end)
let pp fmt path =

@ -50,9 +50,7 @@ let compare (rc1 : t) (rc2 : t) =
module Set = Caml.Set.Make (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
end)
let is_inst_rearrange node =

@ -26,9 +26,7 @@ let pp f l = F.fprintf f "v%d" l
let of_id v = v
module PPKey = struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end

@ -245,10 +245,7 @@ module JNI = struct
| FullyQualifiedClass of (string * string)
| Array of t
| Method of (t list * t)
let compare = compare
let equal = equal
[@@deriving compare, equal]
let parse_str = parse_str

@ -27,9 +27,7 @@ module MockTraceElem = struct
module Kind = struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let matches = matches
@ -37,9 +35,7 @@ module MockTraceElem = struct
end
module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t
let compare = compare
type nonrec t = t [@@deriving compare]
let pp = pp
end)

@ -31,9 +31,7 @@ module MockNode = struct
let pp_id fmt i = F.pp_print_int fmt i
module OrderedId = struct
type t = id
let compare = compare_id
type t = id [@@deriving compare]
let pp = pp_id
end

Loading…
Cancel
Save