package frama-c

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Functions. The AST should be computed before using this module (cf. Ast.compute).

val self : State.t

Getters

val mem : Cil_types.varinfo -> bool

Returns true is this variable is associated to some kernel function

  • raises Not_found

    if the given varinfo has no associated kernel function and is not a built-in.

Membership

val mem_name : string -> bool
  • returns

    true iff there is a function with such a name

  • since 22.0-Titanium
val mem_def_name : string -> bool
  • returns

    true iff there is a function definition with such a name

  • since 22.0-Titanium
val mem_decl_name : string -> bool
  • returns

    true iff there is a function declaration with such a name

  • since 22.0-Titanium

Searching

val find_by_name : string -> Cil_types.kernel_function
  • raises Not_found

    if there is no function of this name.

val find_all_by_orig_name : ?cmp:(Cil_types.kernel_function -> Cil_types.kernel_function -> int) -> string -> Cil_types.kernel_function list

find_all_by_orig_name ?cmp name returns the list of functions whose original name is name, sorted according to cmp. If cmp is None, the resulting order is unspecified.

  • since 23.0-Vanadium
val find_def_by_name : string -> Cil_types.kernel_function
  • raises Not_found

    if there is no function definition of this name.

val find_decl_by_name : string -> Cil_types.kernel_function
  • raises Not_found

    if there is no function declaration of this name.

  • since Aluminium-20160501

Iterators

val iter : (Cil_types.kernel_function -> unit) -> unit
val fold : (Cil_types.kernel_function -> 'a -> 'a) -> 'a -> 'a
val iter_on_fundecs : (Cil_types.fundec -> unit) -> unit

Setters

Functions of this section should not be called by casual users.

val add : Cil_types.cil_function -> unit

TODO: remove this function and replace all calls by:

val remove : Cil_types.varinfo -> unit

Removes the given varinfo, which must have already been removed from the AST. Warning: this is very dangerous.

  • since 18.0-Argon
val replace_by_declaration : Cil_types.funspec -> Cil_types.varinfo -> Cil_types.location -> unit

Note: if the varinfo is already registered and bound to a definition, the definition will be erased only if vdefined is false. Otherwise, you're trying to register a declaration for a varinfo that is supposed to be defined, which does not look very good.

val replace_by_definition : Cil_types.funspec -> Cil_types.fundec -> Cil_types.location -> unit

TODO: do not take a funspec as argument

val register : Cil_types.kernel_function -> unit
OCaml

Innovation. Community. Security.