Frama-C API - Globals
Operations on globals.
module Vars : sig ... endGlobals variables. The AST should be computed before using this module (cf. Ast.compute).
module Functions : sig ... endFunctions. The AST should be computed before using this module (cf. Ast.compute).
module FileIndex : sig ... endGlobals associated to filename.
module Syntactic_search : sig ... endTypes
module Types : sig ... endTypes, or type-related information.
Entry point
val entry_point : unit -> Cil_types.kernel_function * boolset_entry_point name lib sets Kernel.MainFunction to name and Kernel.LibEntry to lib. Moreover, clear the results of all the analysis which depend on Kernel.MainFunction or Kernel.LibEntry.
Comments
val get_comments_global : Cil_types.global -> string listGets a list of comments associated to the given global. This function is useful only when -keep-comments is on.
A comment is associated to a global if it occurs after the declaration/definition of the preceding one in the file, before the end of the current declaration/definition and does not occur in the definition of a function. Note that this function is experimental and may fail to associate comments properly. Use directly Cabshelper.Comments.get to retrieve comments in a given region. (see Globals.get_comments_stmt for retrieving comments associated to a statement).
val get_comments_stmt : Cil_types.stmt -> string listGets a list of comments associated to the given statement. This function is useful only when -keep-comments is on.
A comment is associated to a statement if it occurs after the preceding statement and before the current statement ends (except for the last statement in a block, to which statements occurring before the end of the block are associated). Note that this function is experimental and may fail to associate comments properly. Use directly Cabshelper.Comments.get to retrieve comments in a given region.
Getters
val get_annotation_name : Cil_types.global_annotation -> string optionReturns the name of the global annotation, when it exists (e.g. for axiomatics, predicates, etc), or None if no such name exists (e.g. for volatile blocks).
val get_name : Cil_types.global -> string optionReturns the name of the global, when it exists (e.g. for variables, functions, types, etc), or None if no such name exists (e.g. for assembly statements).
val get_statics : (Cil_types.kernel_function -> Cil_types.varinfo list) Stdlib.refval find_first_stmt : (Cil_types.kernel_function -> Cil_types.stmt) Stdlib.refval find_enclosing_block : (Cil_types.stmt -> Cil_types.block) Stdlib.refval find_all_enclosing_blocks : (Cil_types.stmt -> Cil_types.block list) Stdlib.refval find_englobing_kf : (Cil_types.stmt -> Cil_types.kernel_function) Stdlib.ref