Frama-C API - Info
exception that fun_assign_visible should raise to indicate that the corresponding assigns clause should be erased entirely
exception that fun_frees_visible or fun_allocates_visible should raise to indicate that the corresponding allocation clause should be erased entirely
val fct_info : proj -> Cil_types.kernel_function -> fct listThis function will be called for each function of the source program. A new function will be created for each element of the returned list.
val fct_name : Cil_types.varinfo -> fct -> stringuseful when we want to have several functions in the result for one source function. If it is not the case, you can return varinfo.vname. It is the responsibility of the user to given different names to different function.
val param_visible : fct -> int -> booltells if the n-th formal parameter is visible.
val body_visible : fct -> booltells if the body of a function definition is visible. True is most cases, but can be defined to be false when we want to export only the declaration of a function instead of its definition
val loc_var_visible : fct -> Cil_types.varinfo -> booltells if the local variable is visible.
val inst_visible : fct -> Cil_types.stmt -> booltells if the statement is visible.
val label_visible : fct -> Cil_types.stmt -> Cil_types.label -> booltells if the label is visible.
val annotation_visible : fct -> Cil_types.stmt -> Cil_types.code_annotation -> booltells if the annotation, attached to the given statement is visible.
val fun_precond_visible : fct -> Cil_types.predicate -> boolval fun_postcond_visible : fct -> Cil_types.predicate -> boolval fun_variant_visible : fct -> Cil_types.term -> boolval fun_frees_visible : fct -> Cil_types.identified_term -> boolval fun_allocates_visible : fct -> Cil_types.identified_term -> boolval fun_assign_visible : fct -> Cil_types.from -> booltrue if the assigned value (first component of the from) is visible
val fun_deps_visible : fct -> Cil_types.identified_term -> booltrue if the corresponding functional dependency is visible.
val called_info : (proj * fct) -> Cil_types.stmt -> (Cil_types.kernel_function * fct) optioncalled_info will be called only if the call statement is visible. If it returns None, the source call will be visible, else it will use the returned fct to know if the return value and the arguments are visible. The input fct parameter is the one of the caller function.
val res_call_visible : fct -> Cil_types.stmt -> booltells if the lvalue of the call has to be visible
val result_visible : Cil_types.kernel_function -> fct -> booltells if the function returns something or if the result is void. Notice that if this function returns true the function will have the same return type than the original function. So, if it was already void, it makes no difference if this function returns true or false.
- For a defined function, this should give the same result than
inst_visible fct_info (Kernel_function.find_return kf). res_call_visiblemust returnfalseifresult_visiblereturns false on the called function.
val cond_edge_visible : fct -> Cil_types.stmt -> bool * boolcond_edge_visible f s implies that s is an 'if' in f. The first returned boolean indicates that the 'then' edge is useful, the second one the 'else' is. Setting one or both to true will lead to the simplification in the 'if'.
