IR.TenvModule for Type Environments.
val create : unit -> tCreate a new type environment.
val length : t -> intval load : IBase.SourceFile.t -> t optionLoad a type environment for a source file
val store_debug_file_for_source : IBase.SourceFile.t -> t -> unitval read : IBase.DB.filename -> t optionRead and return a type environment from the given file
val write : t -> IBase.DB.filename -> unitWrite the type environment into the given file
module Global : sig ... endval lookup : t -> Typ.Name.t -> Struct.t optionLook up a name in the given type environment.
val mk_struct :
t ->
?default:Struct.t ->
?fields:Struct.field list ->
?statics:Struct.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:Struct.ClassInfo.t ->
?dummy:bool ->
?source_file:IBase.SourceFile.t ->
Typ.Name.t ->
Struct.tConstruct a struct_typ, normalizing field types
val add_field : t -> Typ.Name.t -> Struct.field -> unitAdd a field to a given struct in the global type environment.
val pp : Stdlib.Format.formatter -> t -> unitprint a type environment
val fold : t -> init:'acc -> f:(Typ.Name.t -> Struct.t -> 'acc -> 'acc) -> 'accval fold_supers :
?ignore_require_extends:bool ->
t ->
Typ.Name.t ->
init:'a ->
f:(Typ.Name.t -> Struct.t option -> 'a -> 'a) ->
'aval mem_supers :
t ->
Typ.Name.t ->
f:(Typ.Name.t -> Struct.t option -> bool) ->
boolval get_parent : t -> Typ.Name.t -> Typ.Name.t optionval find_map_supers :
?ignore_require_extends:bool ->
t ->
Typ.Name.t ->
f:(Typ.Name.t -> Struct.t option -> 'a option) ->
'a optionval get_fields_trans : t -> Typ.Name.t -> Struct.field listGet all fields from the super classes transitively
val pp_per_file : Stdlib.Format.formatter -> per_file -> unitprint per file type environment
Best-effort merge of src into dst. If a procedure is both in dst and src, the one in dst will get overwritten.
module MethodInfo : sig ... endval pp_unresolved_reason :
Ppx_show_runtime.Format.formatter ->
unresolved_reason ->
unitval show_unresolved_reason : unresolved_reason -> stringtype unresolved_data = {missed_captures : Typ.Name.Set.t;unresolved_reason : unresolved_reason option;}val mk_unresolved_data :
?missed_captures:Typ.Name.Set.t ->
unresolved_reason option ->
unresolved_datatype resolution_result = (MethodInfo.t, unresolved_data) IStdlib.IStd.Result.tval resolve_method :
?is_virtual:bool ->
method_exists:(Procname.t -> Procname.t list -> bool) ->
t ->
Typ.Name.t ->
Procname.t ->
resolution_resultresolve_method ~method_exists tenv class_name procname returns either ResolvedTo info where info resolves procname to a method in class_name or its super-classes, that is non-virtual (non-Java-interface method); or, it returns Unresolved {missed_captures; unresolved_reason} where missed_captures is the set of classnames for which the hierarchy traversal needs to examine its members but which have not been captured and unresolved_reason is an additional information about the unresolved reasons which are for suppressing FP issues. method_exists adapted_procname methods should check if adapted_procname (procname but with its class potentially changed to some other_class) is among the methods of other_class.
val resolve_field_info :
t ->
Typ.Name.t ->
Fieldname.t ->
Struct.field_info optionresolve_field_info tenv class_name field tries to find the first field declaration that matches field name (ignoring its enclosing declared type), starting from class class_name.
val resolve_fieldname :
t ->
Typ.Name.t ->
string ->
Fieldname.t option * Typ.Name.Set.tSimilar to resolve_field_info, but returns the resolved field name and missed capture types.
val find_cpp_destructor : t -> Typ.Name.t -> Procname.t optionval find_cpp_constructor : t -> Typ.Name.t -> Procname.t listval get_hack_direct_used_traits_interfaces :
t ->
Typ.Name.t ->
([ `Interface | `Trait ] * HackClassName.t) listget_hack_direct_used_traits_interfaces tenv tname returns a list of the directly used traits and directly implemented interfaces of tname, each paired with `Trait or `Interface to indicate its kind
module SQLite : IBase.SqliteUtils.Data with type t = per_file