Module InferIR__HilExp
module Access : sig ... end
type t
=
|
AccessExpression of access_expression
access path (e.g., x.f.g or x
i
)|
UnaryOperator of InferIR.Unop.t * t * InferIR.Typ.t option
Unary operator with type of the result if known
|
BinaryOperator of InferIR.Binop.t * t * t
Binary operator
|
Exception of t
Exception
|
Closure of InferIR.Typ.Procname.t * (InferIR.AccessPath.base * t) list
Name of function + environment
|
Constant of InferIR.Const.t
Constants
|
Cast of InferIR.Typ.t * t
Type cast
|
Sizeof of InferIR.Typ.t * t option
C-style sizeof(), and also used to treate a type as an expression. Refer to
Exp
module for canonical documentationand access_expression
= private
|
Base of InferIR.AccessPath.base
|
FieldOffset of access_expression * InferIR.Typ.Fieldname.t
field access
|
ArrayOffset of access_expression * InferIR.Typ.t * t option
array access
|
AddressOf of access_expression
"address of" operator
&
|
Dereference of access_expression
"dereference" operator
*
val compare : t -> t -> int
val compare_access_expression : access_expression -> access_expression -> int
module AccessExpression : sig ... end
val pp : F.formatter -> t -> unit
val get_typ : InferIR.Tenv.t -> t -> InferIR.Typ.t option
Get the type of the expression. Warning: not fully implemented
val of_sil : include_array_indexes:bool -> f_resolve_id:(InferIR.Var.t -> AccessExpression.t option) -> add_deref:bool -> InferIR.Exp.t -> InferIR.Typ.t -> t
Convert SIL expression to HIL expression
val get_access_exprs : t -> AccessExpression.t list
Get all the access paths used in the given HIL expression, including duplicates if a path is used more than once.
val is_null_literal : t -> bool
val is_int_zero : t -> bool
val eval : t -> InferIR.Const.t option
val ignore_cast : t -> t
val access_expr_of_exp : include_array_indexes:bool -> f_resolve_id:(InferIR.Var.t -> AccessExpression.t option) -> InferIR.Exp.t -> InferIR.Typ.t -> access_expression option
best effort translating a SIL expression to an access path, not semantics preserving in particular in the presence of pointer arithmetic