Module HilExp.AccessExpression

val array_offset : access_expression -> IR.Typ.t -> t option -> access_expression
val address_of : access_expression -> access_expression option

address_of doesn't always make sense, eg address_of (Dereference t) is None

val address_of_base : AccessPath.base -> access_expression
val to_access_path : access_expression -> AccessPath.t
val replace_base : remove_deref_after_base:bool -> AccessPath.base -> access_expression -> access_expression
val is_return_var : access_expression -> bool
val get_typ : access_expression -> IR.Tenv.t -> IR.Typ.t option
val pp : Stdlib.Format.formatter -> access_expression -> unit
val equal : access_expression -> access_expression -> bool
val to_accesses : access_expression -> access_expression * t option MemoryAccess.t list

return the base and a list of accesses equivalent to the input expression

val add_access : access_expression -> t option MemoryAccess.t -> access_expression option
val truncate : access_expression -> (access_expression * t option MemoryAccess.t) option

remove and return the prefix and the last access of the expression if it's a base; otherwise return None

append ~onto y replaces the base of y with onto itself; this makes sense if no Dereference (AddressOf _) instances are introduced

type nonrec t = private access_expression =
  1. | Base of AccessPath.base
  2. | FieldOffset of access_expression * IR.Fieldname.t
  3. | ArrayOffset of access_expression * IR.Typ.t * t option
  4. | AddressOf of access_expression
  5. | Dereference of access_expression
include Ppx_compare_lib.Comparable.S with type t := t
val compare : t Base__Ppx_compare_lib.compare
val fold_vars : (t, IR.Var.t, 'accum) IStdlib.IStd.Container.fold