Module 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 = {
  1. pvar : IR.Pvar.t;
  2. typ : IR.Typ.t;
  3. qual_type : ATDGenerated.Clang_ast_t.qual_type;
  4. 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

    *)
}
val pp_var_to_destroy : Stdlib.Format.formatter -> var_to_destroy -> unit
type curr_class =
  1. | ContextClsDeclPtr of int
  2. | ContextNoCls
val compare_curr_class : curr_class -> curr_class -> int
type str_node_map = (string, IR.Procdesc.Node.t) Stdlib.Hashtbl.t
type t = {
  1. translation_unit_context : CFrontend_config.translation_unit_context;
  2. tenv : IR.Tenv.t;
  3. cfg : IR.Cfg.t;
  4. procdesc : IR.Procdesc.t;
  5. immediate_curr_class : curr_class;
  6. return_param_typ : IR.Typ.t option;
  7. outer_context : t option;
    (*

    in case of objc blocks, the context of the method containing the block

    *)
  8. mutable blocks_static_vars : (IR.Pvar.t * IR.Typ.t) list IR.Procname.Map.t;
  9. label_map : str_node_map;
  10. 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

    *)
  11. temporary_names : (ATDGenerated.Clang_ast_t.pointer, IR.Pvar.t * IR.Typ.t) Stdlib.Hashtbl.t;
  12. 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 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