Remove unused typedef and enum Typename's

Reviewed By: jvillard

Differential Revision: D3797359

fbshipit-source-id: a8776d3
master
Josh Berdine 8 years ago committed by Facebook Github Bot 2
parent 4fe1615434
commit 8cacd31f85

@ -16,30 +16,20 @@ let module F = Format;
/** Named types. */ /** Named types. */
type t = | TN_typedef of Mangled.t | TN_enum of Mangled.t | TN_csu of Csu.t Mangled.t; type t = | TN_csu of Csu.t Mangled.t;
let to_string = let to_string =
fun fun
| TN_enum name
| TN_typedef name => Mangled.to_string name
| TN_csu csu name => Csu.name csu ^ " " ^ Mangled.to_string name; | TN_csu csu name => Csu.name csu ^ " " ^ Mangled.to_string name;
let pp f typename => F.fprintf f "%s" (to_string typename); let pp f typename => F.fprintf f "%s" (to_string typename);
let name = let name =
fun fun
| TN_enum name
| TN_typedef name
| TN_csu _ name => Mangled.to_string name; | TN_csu _ name => Mangled.to_string name;
let compare tn1 tn2 => let compare tn1 tn2 =>
switch (tn1, tn2) { switch (tn1, tn2) {
| (TN_typedef n1, TN_typedef n2) => Mangled.compare n1 n2
| (TN_typedef _, _) => (-1)
| (_, TN_typedef _) => 1
| (TN_enum n1, TN_enum n2) => Mangled.compare n1 n2
| (TN_enum _, _) => (-1)
| (_, TN_enum _) => 1
| (TN_csu csu1 n1, TN_csu csu2 n2) => | (TN_csu csu1 n1, TN_csu csu2 n2) =>
let n = Csu.compare csu1 csu2; let n = Csu.compare csu1 csu2;
if (n != 0) { if (n != 0) {

@ -14,7 +14,7 @@ open! Utils;
/** Named types. */ /** Named types. */
type t = | TN_typedef of Mangled.t | TN_enum of Mangled.t | TN_csu of Csu.t Mangled.t; type t = | TN_csu of Csu.t Mangled.t;
/** convert the typename to a string */ /** convert the typename to a string */

@ -30,8 +30,7 @@ let remove_pointer_to_typ typ =
let classname_of_type typ = let classname_of_type typ =
match typ with match typ with
| Typ.Tvar (Typename.TN_csu (_, name) ) | Typ.Tvar (Typename.TN_csu (_, name) )
| Typ.Tstruct { Typ.struct_name = Some name } | Typ.Tstruct { struct_name = Some name } -> Mangled.to_string name
| Typ.Tvar (Typename.TN_typedef name) -> Mangled.to_string name
| Typ.Tfun _ -> CFrontend_config.objc_object | Typ.Tfun _ -> CFrontend_config.objc_object
| _ -> | _ ->
Printing.log_out Printing.log_out
@ -42,8 +41,6 @@ let mk_classname n ck = Typename.TN_csu (Csu.Class ck, Mangled.from_string n)
let mk_structname n = Typename.TN_csu (Csu.Struct, Mangled.from_string n) let mk_structname n = Typename.TN_csu (Csu.Struct, Mangled.from_string n)
let mk_enumname n = Typename.TN_enum (Mangled.from_string n)
let is_class typ = let is_class typ =
match typ with match typ with
| Typ.Tptr (Typ.Tstruct { Typ.struct_name = Some name }, _) | Typ.Tptr (Typ.Tstruct { Typ.struct_name = Some name }, _)

@ -19,8 +19,6 @@ val mk_classname : string -> Csu.class_kind -> Typename.t
val mk_structname : string -> Typename.t val mk_structname : string -> Typename.t
val mk_enumname : string -> Typename.t
val get_name_from_struct: Typ.t -> Mangled.t val get_name_from_struct: Typ.t -> Mangled.t
val remove_pointer_to_typ : Typ.t -> Typ.t val remove_pointer_to_typ : Typ.t -> Typ.t

@ -285,7 +285,6 @@ let get_type_from_expr_info ei tenv =
let class_from_pointer_type tenv type_ptr = let class_from_pointer_type tenv type_ptr =
match type_ptr_to_sil_type tenv type_ptr with match type_ptr_to_sil_type tenv type_ptr with
| Typ.Tptr( Typ.Tvar (Typename.TN_typedef name), _) -> Mangled.to_string name
| Typ.Tptr( Typ.Tvar (Typename.TN_csu (_, name)), _) -> Mangled.to_string name | Typ.Tptr( Typ.Tvar (Typename.TN_csu (_, name)), _) -> Mangled.to_string name
| _ -> assert false | _ -> assert false

@ -65,9 +65,6 @@ let print_tenv_struct_unions tenv =
(Typ.to_string typ)^"\n") struct_t.instance_fields (Typ.to_string typ)^"\n") struct_t.instance_fields
) )
) )
| Typename.TN_typedef typname ->
print_endline
((Mangled.to_string typname)^"-->"^(Typ.to_string (Typ.Tstruct struct_t)))
| _ -> () | _ -> ()
) tenv ) tenv

Loading…
Cancel
Save