Module InferIR__Tenv

Module for Type Environments.

type t

Type for type environment.

val create : unit -> t

Create a new type environment.

val load : InferBase.SourceFile.t -> t option

Load a type environment for a source file

val store_debug_file_for_source : InferBase.SourceFile.t -> t -> unit
val read : InferBase.DB.filename -> t option

read and return a type environment from the given file

val load_global : unit -> t option

load the global type environment (Java)

val store_global : t -> unit

save a global type environment (Java)

val lookup : t -> InferIR.Typ.Name.t -> InferIR.Typ.Struct.t option

Look up a name in the global type environment.

val mk_struct : t -> ?⁠default:InferIR.Typ.Struct.t -> ?⁠fields:InferIR.Typ.Struct.fields -> ?⁠statics:InferIR.Typ.Struct.fields -> ?⁠methods:InferIR.Typ.Procname.t list -> ?⁠exported_objc_methods:InferIR.Typ.Procname.t list -> ?⁠supers:InferIR.Typ.Name.t list -> ?⁠annots:InferIR.Annot.Item.t -> InferIR.Typ.Name.t -> InferIR.Typ.Struct.t

Construct a struct_typ, normalizing field types

val add_field : t -> InferIR.Typ.Name.t -> InferIR.Typ.Struct.field -> unit

Add a field to a given struct in the global type environment.

val pp : Stdlib.Format.formatter -> t -> unit

print a type environment

type per_file =
| Global
| FileLocal of t
val pp_per_file : Stdlib.Format.formatter -> per_file -> unit

print per file type environment

val merge : src:t -> dst:t -> unit

Merge src into dst possibly overwriting pre existing procs in dst.

val merge_per_file : src:per_file -> dst:per_file -> per_file

Best-effort merge of src into dst. If a procedure is both in dst and src, the one in dst will get overwritten.

module SQLite : InferBase.SqliteUtils.Data with type t = per_file