Eva.BuiltinsRegister OCaml builtins to be used by the cvalue domain instead of analysing the body of some C functions.
type builtin_type = unit -> Eva_ast.typ * Eva_ast.typ listCan the results of a builtin be cached? See Eval for more details.
type full_result = {c_values : (Frama_c_kernel.Cvalue.V.t option * Frama_c_kernel.Cvalue.Model.t)
list;A list of results, consisting of:
c_clobbered : Frama_c_kernel.Base.SetLattice.t;An over-approximation of the bases in which addresses of local variables might have been written
*)c_assigns : (Assigns.t * Frama_c_kernel.Memory_zone.t) option;If not None:
cacheable : cacheable;Can this result of the function call be cached with memexec?
*)}type call_result = | States of Frama_c_kernel.Cvalue.Model.t listA disjunctive list of post-states at the end of the C function. Can only be used if these results can be cached and reused for other calls with the same entry state, and if the C function:
| Result of Frama_c_kernel.Cvalue.V.t listA disjunctive list of resulting values. The specification is used to compute the post-state, in which the result is replaced by the values computed by the builtin. Can only be used in the same condition than States above.
| Full of full_resultSee full_result type.
The result of a builtin can be given in different forms.
type builtin =
Frama_c_kernel.Cvalue.Model.t ->
(Eva_ast.exp * Frama_c_kernel.Cvalue.V.t) list ->
call_resultType of a cvalue builtin, whose arguments are:
val register_builtin :
string ->
?replace:string ->
?typ:builtin_type ->
builtin ->
unitregister_builtin name ?replace ?typ f registers the function f as a builtin to be used instead of the C function of name name. If replace is provided, the builtin is also used instead of the C function of name replace, unless option -eva-builtin-auto is disabled. If typ is provided, consistency between the expected typ and the type of the C function is checked before using the builtin.
unregister_builtin name unregisters a builtin previously registered with register_builtinname. If there is no builtin with this name, this function has no effect.