ClangFrontend.CContext
Contains current class and current method to be translated as well as local variables, and the cfg, and tenv corresponding to the current file.
module StmtMap = ClangPointers.Map
type cxx_temporary = {
pvar : IR.Pvar.t;
typ : IR.Typ.t;
qual_type : ATDGenerated.Clang_ast_t.qual_type;
marker : (IR.Pvar.t * IR.Sil.if_kind) option;
Some (m, _)
means that creating pvar
should also set m
to 1
so that we know whether pvar
needs to be destroyed after the current full-expression
}
type var_to_destroy =
| VarDecl of ATDGenerated.Clang_ast_t.decl_info
* ATDGenerated.Clang_ast_t.named_decl_info
* ATDGenerated.Clang_ast_t.qual_type
* ATDGenerated.Clang_ast_t.var_decl_info
| CXXTemporary of cxx_temporary
val pp_var_to_destroy : Stdlib.Format.formatter -> var_to_destroy -> unit
val compare_curr_class : curr_class -> curr_class -> int
type str_node_map = (string, IR.Procdesc.Node.t) Stdlib.Hashtbl.t
type t = {
translation_unit_context : CFrontend_config.translation_unit_context;
tenv : IR.Tenv.t;
cfg : IR.Cfg.t;
procdesc : IR.Procdesc.t;
immediate_curr_class : curr_class;
return_param_typ : IR.Typ.t option;
outer_context : t option;
in case of objc blocks, the context of the method containing the block
*)mutable blocks_static_vars : (IR.Pvar.t * IR.Typ.t) list IR.Procname.Map.t;
label_map : str_node_map;
vars_to_destroy : var_to_destroy list StmtMap.t;
mapping from a statement to a list of variables, that go out of scope after the end of the statement
*)temporary_names : (ATDGenerated.Clang_ast_t.pointer, IR.Pvar.t * IR.Typ.t)
Stdlib.Hashtbl.t;
temporaries_constructor_markers : (IR.Pvar.t * IR.Typ.t) IR.Pvar.Map.t;
In order to know when to destruct C++ temporaries created in expressions containing conditionals (e.g. to hold the object created by X()
in b?foo(X()):goo()
), we associate "markers" to each one of them, set to true if and only if the temporary has been created. This is the map associating each such C++ temporary with its marker variable.
}
val get_curr_class : t -> curr_class
val get_curr_class_typename :
ATDGenerated.Clang_ast_t.stmt_info ->
t ->
IR.Typ.Name.t
val get_curr_class_decl_ptr :
ATDGenerated.Clang_ast_t.stmt_info ->
curr_class ->
ATDGenerated.Clang_ast_t.pointer
val is_objc_method : t -> bool
val is_objc_class_method : t -> bool
val create_context :
CFrontend_config.translation_unit_context ->
IR.Tenv.t ->
IR.Cfg.t ->
IR.Procdesc.t ->
curr_class ->
IR.Typ.t option ->
t option ->
t
val add_block_static_var : t -> IR.Procname.t -> (IR.Pvar.t * IR.Typ.t) -> unit
val get_outer_procname : t -> IR.Procname.t
module CXXTemporarySet :
IStdlib.PrettyPrintable.PPSet with type elt = cxx_temporary