Module IR__Struct

module F = Stdlib.Format
type field = IR.Fieldname.t * IR.Typ.t * IR.Annot.Item.t
val compare_field : field -> field -> int
type fields = field list
type java_class_kind =
| Interface
| AbstractClass
| NormalClass
val equal_java_class_kind : java_class_kind -> java_class_kind -> bool
type java_class_info = {
kind : java_class_kind;

class kind in Java

loc : IBase.Location.t option;

None should correspond to rare cases when it was impossible to fetch the location in source file

}
type t = {
fields : fields;

non-static fields

statics : fields;

static fields

supers : IR.Typ.Name.t list;

superclasses

methods : IR.Procname.t list;

methods defined

exported_objc_methods : IR.Procname.t list;

methods in ObjC interface, subset of methods

annots : IR.Annot.Item.t;

annotations

java_class_info : java_class_info option;

present if and only if the class is Java

dummy : bool;

dummy struct for class including static method

}

Type for a structured value.

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

Pretty print a struct type.

val internal_mk_struct : ?⁠default:t -> ?⁠fields:fields -> ?⁠statics:fields -> ?⁠methods:IR.Procname.t list -> ?⁠exported_objc_methods:IR.Procname.t list -> ?⁠supers:IR.Typ.Name.t list -> ?⁠annots:IR.Annot.Item.t -> ?⁠java_class_info:java_class_info -> ?⁠dummy:bool -> unit -> t

Construct a struct_typ, normalizing field types

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

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

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

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

val fld_typ : lookup:lookup -> default:IR.Typ.t -> IR.Fieldname.t -> IR.Typ.t -> IR.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 -> IR.Fieldname.t -> IR.Typ.t -> (IR.Typ.t * IR.Annot.Item.t) option

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

val merge : IR.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)