Frama-C API - Vars
Globals variables. The AST should be computed before using this module (cf. Ast.compute).
Getters
val find : Cil_types.varinfo -> Cil_types.initinfoval get_string_literal : Cil_types.varinfo -> Cil_types.str_literalRetrieve the (wide)string literal associated to a given varinfo. Fatal error if the variable does not have the corresponding attribute (see Ast_info.is_string_literal)
val add_string_literal : loc:Cil_types.location -> Cil_types.str_literal -> Cil_types.varinfoCreates a new global holding a (wide)string literal and insert it into the Ast, marking it as grown.
val find_from_astinfo : string -> Cil_types.syntactic_scope -> Cil_types.varinfoFinds a variable from its vname according to its localisation (which might be a local). If you wish to search for a symbol according to its original name in the source code and the syntactic scope in which it should appear, use Globals.Syntactic_search instead.
val get_astinfo : Cil_types.varinfo -> string * Cil_types.syntactic_scopeLinear in the number of locals and formals of the program.
Iterators
val iter : (Cil_types.varinfo -> Cil_types.initinfo -> unit) -> unitval fold : (Cil_types.varinfo -> Cil_types.initinfo -> 'a -> 'a) -> 'a -> 'aval iter_in_file_order : (Cil_types.varinfo -> Cil_types.initinfo -> unit) -> unitThe next four iterators iter on all global variables present in the AST, following the order in which they are declared/defined. The only exception is for variables that are both declared and defined. In this case, the declarations are skipped altogether.
val fold_in_file_order : (Cil_types.varinfo -> Cil_types.initinfo -> 'a -> 'a) -> 'a -> 'aval iter_in_file_rev_order : (Cil_types.varinfo -> Cil_types.initinfo -> unit) -> unitval fold_in_file_rev_order : (Cil_types.varinfo -> Cil_types.initinfo -> 'a -> 'a) -> 'a -> 'aSetters
Functions of this section should not be called by casual users.
exception AlreadyExists of Cil_types.varinfo * Cil_types.initinfoval add : Cil_types.varinfo -> Cil_types.initinfo -> unitval remove : Cil_types.varinfo -> unitRemoves the given varinfo, which must have already been removed from the AST. Warning: this is very dangerous.
val add_decl : Cil_types.varinfo -> unitval self : State.t