IR.TenvModule for Type Environments.
val create : unit -> tCreate a new type environment.
val 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
val load_global : unit -> t optionLoad the global type environment (Java)
val store_global : normalize:bool -> t -> unitSave a global type environment (Java/Hack)
val 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 resolve_method :
method_exists:(Procname.t -> Procname.t list -> bool) ->
t ->
Typ.Name.t ->
Procname.t ->
MethodInfo.t option * Typ.Name.Set.tresolve_method ~method_exists tenv class_name procname return a pair (info_opt, missed_captures) where info_opt tries to resolve procname to a method in class_name or its super-classes, that is non-virtual (non-Java-interface method). missed_captures is the set of classnames for which the hierarchy traversal would have need to examine its members but the class was not captured. 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 optionSimilar to resolve_field_info, but returns the resolved field name.
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 : t -> Typ.Name.t -> HackClassName.t listmodule SQLite : IBase.SqliteUtils.Data with type t = per_file