ppx_compare StructTyp

Reviewed By: sblackshear

Differential Revision: D4232383

fbshipit-source-id: 2659835
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent 122d2b031f
commit 952855288d

@ -32,8 +32,7 @@ type t = {
type lookup = Typename.t => option t;
let fld_typ_ann_compare fta1 fta2 =>
triple_compare Ident.compare_fieldname Typ.compare Annot.Item.compare fta1 fta2;
let compare_fld_typ_ann = [%compare : (Ident.fieldname, Typ.t, Annot.Item.t)];
let pp pe pp_base name f {fields} =>
if false {

@ -32,7 +32,7 @@ type lookup = Typename.t => option t;
/** Comparision for fieldnames * types * item annotations. */
let fld_typ_ann_compare:
let compare_fld_typ_ann:
(Ident.fieldname, Typ.t, Annot.Item.t) => (Ident.fieldname, Typ.t, Annot.Item.t) => int;

@ -114,7 +114,7 @@ let rec create_struct_values pname tenv orig_prop footprint_part kind max_stamp
let replace_typ_of_f (f', t', a') =
if Ident.equal_fieldname f f' then (f, res_t', a') else (f', t', a') in
let fields' =
IList.sort StructTyp.fld_typ_ann_compare (IList.map replace_typ_of_f fields) in
IList.sort StructTyp.compare_fld_typ_ann (IList.map replace_typ_of_f fields) in
ignore (Tenv.mk_struct tenv ~default:struct_typ ~fields:fields' name) ;
(atoms', se, t)
| exception Not_found ->
@ -222,7 +222,7 @@ let rec _strexp_extend_values
let f', t' = replace_fv res_typ' (f, t) in
(f', t', a) in
let fields' =
IList.sort StructTyp.fld_typ_ann_compare (IList.map replace_fta fields) in
IList.sort StructTyp.compare_fld_typ_ann (IList.map replace_fta fields) in
ignore (Tenv.mk_struct tenv ~default:struct_typ ~fields:fields' name) ;
(res_atoms', Sil.Estruct (res_fsel', inst'), typ) :: acc in
IList.fold_left replace [] atoms_se_typ_list'
@ -234,7 +234,7 @@ let rec _strexp_extend_values
let replace_fta (f', t', a') =
if Ident.equal_fieldname f' f then (f, res_typ', a') else (f', t', a') in
let fields' =
IList.sort StructTyp.fld_typ_ann_compare (IList.map replace_fta fields) in
IList.sort StructTyp.compare_fld_typ_ann (IList.map replace_fta fields) in
ignore (Tenv.mk_struct tenv ~default:struct_typ ~fields:fields' name) ;
[(atoms', Sil.Estruct (res_fsel', inst'), typ)]
)

Loading…
Cancel
Save