IR.ExpThe Smallfoot Intermediate Language: Expressions
NOTE: For doing substitutionson expressions, there are some functions in Sil.
type closure = {name : Procname.t;captured_vars : (t * Pvar.t * Typ.t * CapturedVar.capture_mode) list;}This records information about a sizeof(typ) expression.
nbytes represents the result of the evaluation of sizeof(typ) if it is statically known.
If typ is of the form Tarray elt (Some static_length), then dynamic_length is the number of elements of type elt in the array. The dynamic_length, tracked by symbolic execution, may differ from the static_length obtained from the type definition, e.g. when an array is over-allocated.
If typ is a struct type, the dynamic_length is that of the final extensible array, if any.
and t = | Var of Ident.tPure variable: it is not an lvalue
*)| UnOp of Unop.t * t * Typ.t optionUnary operator with type of the result if known
*)| BinOp of Binop.t * t * tBinary operator
*)| Exn of tException
*)| Closure of closureAnonymous function
*)| Const of Const.tConstants
*)| Cast of Typ.t * tType cast
*)| Lvar of Pvar.tThe address of a program variable
*)| Lfield of t * Fieldname.t * Typ.tA field offset, the type is the surrounding struct type
*)| Lindex of t * tAn array index offset: exp1[exp2]
| Sizeof of sizeof_dataProgram expressions.
val compare_sizeof_data : sizeof_data -> sizeof_data -> intval hash_fold_closure :
Ppx_hash_lib.Std.Hash.state ->
closure ->
Ppx_hash_lib.Std.Hash.stateval hash_closure : closure -> Ppx_hash_lib.Std.Hash.hash_valueval hash_fold_sizeof_data :
Ppx_hash_lib.Std.Hash.state ->
sizeof_data ->
Ppx_hash_lib.Std.Hash.stateval hash_sizeof_data : sizeof_data -> Ppx_hash_lib.Std.Hash.hash_valueval hash_fold_t :
Ppx_hash_lib.Std.Hash.state ->
t ->
Ppx_hash_lib.Std.Hash.stateval hash : t -> Ppx_hash_lib.Std.Hash.hash_valueval hash_normalize_sizeof_data : sizeof_data -> sizeof_dataval hash_normalize_sizeof_data_opt : sizeof_data option -> sizeof_data optionval hash_normalize_sizeof_data_list : sizeof_data list -> sizeof_data listval is_null_literal : t -> boolval is_this : t -> boolreturn true if exp is the special this/self expression
val is_zero : t -> boolval is_const : t -> boolTurn an expression representing a type into the type it represents If not a sizeof, return the default type if given, otherwise raise an exception
val get_undefined : bool -> tGet an expression "undefined", the boolean indicates whether the undefined value goest into the footprint
val pointer_arith : t -> boolChecks whether an expression denotes a location using pointer arithmetic. Currently, catches array - indexing expressions such as ai only.
val has_local_addr : t -> boolreturns true if the expression operates on address of local variable
val zero : tInteger constant 0
val null : tNull constant
val one : tInteger constant 1
val minus_one : tInteger constant -1
val float : float -> tCreate float constant
val bool : bool -> tCreate integer constant corresponding to the boolean value
all the program variables appearing in the expression
Fold over the expressions captured by this expression.
val pp_diff : ?print_types:bool -> IStdlib.Pp.env -> F.formatter -> t -> unitval pp : F.formatter -> t -> unitval pp_closure : F.formatter -> closure -> unitval to_string : t -> stringval d_exp : t -> unitdump an expression.
val pp_texp : IStdlib.Pp.env -> F.formatter -> t -> unitPretty print a type.
val pp_texp_full : IStdlib.Pp.env -> F.formatter -> t -> unitPretty print a type with all the details.
val d_texp_full : t -> unitDump a type expression with all the details.
val d_list : t list -> unitDump a list of expressions.
val is_cpp_closure : t -> boolval get_java_class_initializer :
Tenv.t ->
t ->
(Procname.t * Pvar.t * Fieldname.t * Typ.t) optionReturns the class initializer of the given expression in Java