Module IR.Struct

module F = Stdlib.Format
type objc_property_attribute =
  1. | Copy
  2. | Strong
  3. | Weak
val compare_objc_property_attribute : objc_property_attribute -> objc_property_attribute -> int
val equal_objc_property_attribute : objc_property_attribute -> objc_property_attribute -> bool
val hash_fold_objc_property_attribute : Ppx_hash_lib.Std.Hash.state -> objc_property_attribute -> Ppx_hash_lib.Std.Hash.state
val hash_objc_property_attribute : objc_property_attribute -> Ppx_hash_lib.Std.Hash.hash_value
val hash_normalize_objc_property_attribute : objc_property_attribute -> objc_property_attribute
val hash_normalize_objc_property_attribute_opt : objc_property_attribute option -> objc_property_attribute option
val hash_normalize_objc_property_attribute_list : objc_property_attribute list -> objc_property_attribute list
type field = {
  1. name : Fieldname.t;
  2. typ : Typ.t;
  3. annot : Annot.Item.t;
  4. objc_property_attributes : objc_property_attribute list;
}
val compare_field : field -> field -> int
val equal_field : field -> field -> bool
val hash_fold_field : Ppx_hash_lib.Std.Hash.state -> field -> Ppx_hash_lib.Std.Hash.state
val hash_field : field -> Ppx_hash_lib.Std.Hash.hash_value
val hash_normalize_field : field -> field
val hash_normalize_field_opt : field option -> field option
val hash_normalize_field_list : field list -> field list
val mk_field : ?annot:Annot.Item.t -> ?objc_property_attributes:objc_property_attribute list -> Fieldname.t -> Typ.t -> field
val field_has_weak : field -> bool
type java_class_kind =
  1. | Interface
  2. | AbstractClass
  3. | NormalClass
val equal_java_class_kind : java_class_kind -> java_class_kind -> bool
type hack_class_kind =
  1. | Class
  2. | AbstractClass
  3. | Interface
  4. | Trait
  5. | Alias
module ClassInfo : sig ... end
type t = private {
  1. fields : field list;
    (*

    non-static fields

    *)
  2. statics : field list;
    (*

    static fields

    *)
  3. supers : Typ.Name.t list;
    (*

    superclasses

    *)
  4. objc_protocols : Typ.Name.t list;
    (*

    ObjC protocols

    *)
  5. methods : Procname.t list;
    (*

    methods defined

    *)
  6. exported_objc_methods : Procname.t list;
    (*

    methods in ObjC interface, subset of methods

    *)
  7. annots : Annot.Item.t;
    (*

    annotations

    *)
  8. class_info : ClassInfo.t;
    (*

    present if and only if the class is Java or Hack

    *)
  9. dummy : bool;
    (*

    dummy struct for class including static method

    *)
  10. source_file : IBase.SourceFile.t option;
    (*

    source file containing this struct's declaration

    *)
}

Type for a structured value.

val hash_normalize : t -> t
val hash_normalize_opt : t option -> t option
val hash_normalize_list : t list -> t list
type lookup = Typ.Name.t -> t option
val pp_field : IStdlib.Pp.env -> F.formatter -> field -> unit
val pp : IStdlib.Pp.env -> Typ.Name.t -> F.formatter -> t -> unit

Pretty print a struct type.

val internal_mk_struct : ?default:t -> ?fields:field list -> ?statics:field list -> ?methods:Procname.t list -> ?exported_objc_methods:Procname.t list -> ?supers:Typ.Name.t list -> ?objc_protocols:Typ.Name.t list -> ?annots:Annot.Item.t -> ?class_info:ClassInfo.t -> ?dummy:bool -> ?source_file:IBase.SourceFile.t -> Typ.name -> t

Construct a struct_typ, normalizing field types

val get_extensible_array_element_typ : lookup:lookup -> Typ.t -> Typ.t option

the element typ of the final extensible array in the given typ, if any

type field_info = {
  1. typ : Typ.t;
  2. annotations : Annot.Item.t;
  3. is_static : bool;
}
val get_field_info : lookup:lookup -> Fieldname.t -> Typ.t -> field_info option

Lookup for info associated with the field fn. None if typ has no field named fn

val fld_typ_opt : lookup:lookup -> Fieldname.t -> Typ.t -> Typ.t option

If a struct type with field f, return Some (the type of f). If not, return None.

val fld_typ : lookup:lookup -> default:Typ.t -> Fieldname.t -> Typ.t -> Typ.t

If a struct type with field f, return the type of f. If not, return the default type if given, otherwise raise an exception

val get_field_type_and_annotation : lookup:lookup -> Fieldname.t -> Typ.t -> (Typ.t * Annot.Item.t) option

Return the type of the field fn and its annotation, None if typ has no field named fn

val merge : Typ.Name.t -> newer:t -> current:t -> t

best effort directed merge of two structs for the same typename

val is_not_java_interface : t -> bool

check that a struct either defines a non-java type, or a non-java-interface type (abstract or normal class)

val get_source_file : t -> IBase.SourceFile.t option
val is_hack_class : t -> bool
val is_hack_abstract_class : t -> bool
val is_hack_alias : t -> bool
val is_hack_interface : t -> bool
val is_hack_trait : t -> bool