Module IR.HilExp
module Access : sig ... endtype t=|AccessExpression of access_expressionaccess path (e.g., x.f.g or x
i)|UnaryOperator of Unop.t * t * Typ.t optionUnary operator with type of the result if known
|BinaryOperator of Binop.t * t * tBinary operator
|Exception of tException
|Closure of Procname.t * (AccessPath.base * t) listName of function + environment
|Constant of Const.tConstants
|Cast of Typ.t * tType cast
|Sizeof of Typ.t * t optionC-style sizeof(), and also used to treate a type as an expression. Refer to
Expmodule for canonical documentationand access_expression= private|Base of AccessPath.base|FieldOffset of access_expression * Fieldname.tfield access
|ArrayOffset of access_expression * Typ.t * t optionarray access
|AddressOf of access_expression"address of" operator
&|Dereference of access_expression"dereference" operator
*
val compare : t -> t -> intval compare_access_expression : access_expression -> access_expression -> int
module AccessExpression : sig ... endval pp : F.formatter -> t -> unitval get_typ : Tenv.t -> t -> Typ.t optionGet the type of the expression. Warning: not fully implemented
val of_sil : include_array_indexes:bool -> f_resolve_id:(Var.t -> AccessExpression.t option) -> add_deref:bool -> Exp.t -> Typ.t -> tConvert SIL expression to HIL expression
val get_access_exprs : t -> AccessExpression.t listGet 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 -> boolval is_int_zero : t -> boolval eval : t -> Const.t optionval eval_boolean_exp : AccessExpression.t -> t -> bool optioneval_boolean_exp var expreturnsSome bool_valueif the given boolean expressionexpevaluates tobool_valuewhenvaris set to true. Return None if it has free variables that stop us from evaluating it, or is not a boolean expression.
val ignore_cast : t -> tval access_expr_of_exp : include_array_indexes:bool -> f_resolve_id:(Var.t -> AccessExpression.t option) -> Exp.t -> Typ.t -> access_expression optionbest effort translating a SIL expression to an access path, not semantics preserving in particular in the presence of pointer arithmetic