Module Goblint_lib.Cilfacade GoblintCil utilities.
module E = GoblintCil .Errormsg Cilfacade functions to avoid dependency cycles.
val get_labelLoc : GoblintCil .label -> GoblintCil .locationval get_labelsLoc : GoblintCil .label list -> GoblintCil .Cil.locationFollowing functions are similar to Cil versions, but return expression location instead of entire statement location, where possible.
val eloc_fallback :
eloc :GoblintCil .location ->
loc :GoblintCil .location ->
GoblintCil .locationval get_instrLoc : GoblintCil .instr -> GoblintCil .locationGet expression location for Cil.instr.
val get_stmtLoc : GoblintCil .stmt -> GoblintCil .Cil.locationGet expression location for Cil.stmt.
val create_var : GoblintCil .varinfo -> GoblintCil .varinfoCommand for assigning an id to a varinfo. All varinfos directly created by Goblint should be modified by this method
val isCharType : GoblintCil .Cil.typ -> boolIs character type (N1570 6.2.5.15)?
val isFloatType : GoblintCil .Cil.typ -> boolval isVLAType : GoblintCil .Cil.typ -> boolval is_first_field : GoblintCil .fieldinfo -> boolval init_options : unit -> unitval current_file : GoblintCil .file ref val parse : Fpath.t -> GoblintCil__ .Cil.fileval print : GoblintCil .file -> unitval rmTemps : GoblintCil__ .Cil.file -> unitval visitors : (string * (GoblintCil .fundec -> GoblintCil .cilVisitor) ) list ref val register_preprocess :
string ->
(GoblintCil .fundec -> GoblintCil .cilVisitor) ->
unitval do_preprocess : GoblintCil .file -> unitval getAST : Fpath.t -> GoblintCil__ .Cil.fileval getMergedAST : GoblintCil__ .Cil.file list -> GoblintCil__ .Cil.fileval callConstructors : GoblintCil .file -> GoblintCil .fileval in_section : (string -> bool) -> GoblintCil .attribute list -> boolval is_init : GoblintCil .attribute list -> boolval is_exit : GoblintCil .attribute list -> booltype startfuns =
GoblintCil .fundec list * GoblintCil .fundec list * GoblintCil .fundec list val getFirstStmt : GoblintCil .fundec -> GoblintCil .stmtval get_ikind : GoblintCil .Cil.typ -> GoblintCil .ikindval get_fkind : GoblintCil .Cil.typ -> GoblintCil .fkindval ptrdiff_ikind : unit -> GoblintCil .ikindval ptr_ikind : unit -> GoblintCil .ikindCil.typeOf, etc reimplemented to raise sensible exceptions instead of printing all errors directly...
type typeOfError = | RealImag_NonNumerical unexpected non-numerical type for argument to __real__/__imag__
| StartOf_NonArray typeOf: StartOf on a non-array
| Mem_NonPointer of GoblintCil .exptypeOfLval: Mem on a non-pointer (exp)
| Index_NonArray of GoblintCil .exp * GoblintCil .typtypeOffset: Index on a non-array
| Field_NonCompound of GoblintCil .fieldinfo * GoblintCil .typtypeOffset: Field on a non-compound
val stringLiteralType : GoblintCil .typ ref val typeOfRealAndImagComponents : GoblintCil .typ -> GoblintCil .typval isComplexFKind : GoblintCil .fkind -> boolval typeOf : GoblintCil .exp -> GoblintCil .typval typeOfInit : GoblintCil .init -> GoblintCil .typval typeOfLval : GoblintCil .lval -> GoblintCil .typval typeOffset : GoblintCil .typ -> GoblintCil .offset -> GoblintCil .typval mkCast : e :GoblintCil .exp -> newt :GoblintCil .typ -> GoblintCil .Cil.expval get_ikind_exp : GoblintCil .exp -> GoblintCil .ikindval get_fkind_exp : GoblintCil .exp -> GoblintCil .fkindval makeBinOp :
GoblintCil__ .Cil.binop ->
GoblintCil .exp ->
GoblintCil .exp ->
GoblintCil__ .Cil.expMake Cil.BinOp with correct implicit casts inserted.
val anoncomp_name_regexp : Str .regexpval split_anoncomp_name : string -> bool * string * intval pretty_typsig_like_typ :
unit ->
GoblintCil .typsig ->
GoblintCil__ .Pretty.docPretty-print typsig like typ, because d_typsig prints with CIL constructors.
Visitor to count locs appearing inside a fundec.
val countLoc : GoblintCil .fundec -> intCount the number of unique locations appearing in fundec fn. Uses Cilfacade.locs hashtable for intermediate computations
val fundec_return_type : GoblintCil .fundec -> GoblintCil .typmodule StmtH : sig ... end val pseudo_return_to_fun : GoblintCil .fundec StmtH.t val find_stmt_fundec : StmtH.key -> GoblintCil .fundecFind fundec which the stmt is in.
Find fundec by the function's varinfo (has the function name and type).
val find_name_fundec : StringH.key -> GoblintCil .fundecFind fundec by the function's name.
type varinfo_role = | Formal of GoblintCil .fundec| Local of GoblintCil .fundec| Function | Global Find the role of the varinfo.
val find_scope_fundec : VarinfoH.key -> GoblintCil .fundec optionFind the scope of the varinfo. If varinfo is a local or a formal argument of fundec, then returns Some fundec. If varinfo is a global or a function itself, then returns None.
Find the original name (in input source code) of the varinfo. If it was renamed by CIL, then returns the original name before renaming. If it wasn't renamed by CIL, then returns the same name. If it was inserted by CIL (or Goblint), then returns None.
module IntH : sig ... end val pseudo_return_stmt_sids : GoblintCil .stmt IntH.t val find_stmt_sid : IntH.key -> GoblintCil .stmtval reset_lazy : unit -> unitval stmt_pretty_short : unit -> GoblintCil .stmt -> GoblintCil__ .Pretty.docval add_function_declarations : GoblintCil .Cil.file -> unitGiven a Cil.file, reorders its globals, inserts function declarations before function definitions. This function may be used after a code transformation to ensure that the order of globals yields a compilable program.