Module InferIR__AccessPath

Module for naming heap locations via the path used to access them (e.g., x.f.g, ya.b)

type base = InferIR.Var.t * InferIR.Typ.t
include sig ... end
val compare_base : base ‑> base ‑> int
type access =
| ArrayAccess of InferIR.Typ.t * t list

(** array element type with list of access paths in index *)

| FieldAccess of InferIR.Typ.Fieldname.t

(** field name *)

type t = base * access list

root var, and a list of accesses. closest to the root var is first that is, x.f.g is representedas (x, f; g)

include sig ... end
val compare_access : access ‑> access ‑> int
val compare : t ‑> t ‑> int
val compare_access : access ‑> access ‑> int
val compare : t ‑> t ‑> int
val truncate : t ‑> t * access option

remove and return the last access of the access path if the access list is non-empty. returns the original access path * None if the access list is empty

val get_last_access : t ‑> access option

get the last access in the list. returns None if the list is empty

val get_field_and_annotation : t ‑> InferIR.Tenv.t ‑> (InferIR.Typ.Fieldname.t * InferIR.Annot.Item.t) option

get the field name and the annotation of the last access in the list of accesses if the list is non-empty and the last access is a field access

val get_typ : t ‑> InferIR.Tenv.t ‑> InferIR.Typ.t option

get the typ of the last access in the list of accesses if the list is non-empty, or the base if the list is empty. that is, for x.f.g, return typ(g), and for x, return typ(x)

val base_of_pvar : InferIR.Pvar.t ‑> InferIR.Typ.t ‑> base

create a base from a pvar

val of_pvar : InferIR.Pvar.t ‑> InferIR.Typ.t ‑> t

create an access path from a pvar

val of_id : InferIR.Ident.t ‑> InferIR.Typ.t ‑> t

create an access path from an ident

val of_exp : include_array_indexes:bool ‑> InferIR.Exp.t ‑> InferIR.Typ.t ‑> f_resolve_id:(InferIR.Var.t ‑> t option) ‑> t list

extract the access paths that occur in exp, resolving identifiers using f_resolve_id. don't include index expressions in array accesses if include_array_indexes is false

val of_lhs_exp : include_array_indexes:bool ‑> InferIR.Exp.t ‑> InferIR.Typ.t ‑> f_resolve_id:(InferIR.Var.t ‑> t option) ‑> t option

convert lhs_exp to an access path, resolving identifiers using f_resolve_id

val append : t ‑> access list ‑> t

append new accesses to an existing access path; e.g., `append_access x.f g, h` produces `x.f.g.h`

val is_prefix : t ‑> t ‑> bool

return true if ap1 is a prefix of ap2. returns true for equal access paths

val inner_class_normalize : t ‑> t

transform an access path that starts on "this" of an inner class but which breaks out to access outer class fields to the outermost one. Cases handled (recursively):

val equal : t ‑> t ‑> bool
val equal_base : base ‑> base ‑> bool
val equal_access : access ‑> access ‑> bool
val equal_access_list : access list ‑> access list ‑> bool
val pp : Format.formatter ‑> t ‑> unit
val pp_base : Format.formatter ‑> base ‑> unit
val pp_access : Format.formatter ‑> access ‑> unit
module Abs : sig ... end
module BaseMap : InferStdlib.PrettyPrintable.PPMap with type PPMap.key = base