Module InferModules.CAst_utils

val dummy_source_range : unit -> InferGenerated.Clang_ast_t.source_range
val dummy_stmt_info : unit -> InferGenerated.Clang_ast_t.stmt_info
val get_fresh_pointer : unit -> InferGenerated.Clang_ast_t.pointer
val get_decl : InferGenerated.Clang_ast_t.pointer -> InferGenerated.Clang_ast_t.decl option
val get_decl_opt : InferGenerated.Clang_ast_t.pointer option -> InferGenerated.Clang_ast_t.decl option
val get_stmt : InferGenerated.Clang_ast_t.pointer -> InferGenerated.Clang_ast_t.source_range -> InferGenerated.Clang_ast_t.stmt option
val get_stmt_exn : InferGenerated.Clang_ast_t.pointer -> InferGenerated.Clang_ast_t.source_range -> InferGenerated.Clang_ast_t.stmt
val get_stmt_opt : InferGenerated.Clang_ast_t.pointer option -> InferGenerated.Clang_ast_t.source_range -> InferGenerated.Clang_ast_t.stmt option
val get_decl_opt_with_decl_ref : InferGenerated.Clang_ast_t.decl_ref option -> InferGenerated.Clang_ast_t.decl option
val get_property_of_ivar : InferGenerated.Clang_ast_t.pointer -> InferGenerated.Clang_ast_t.decl option
val update_sil_types_map : InferGenerated.Clang_ast_t.type_ptr -> InferIR.Typ.desc -> unit
val update_enum_map : InferGenerated.Clang_ast_t.pointer -> InferIR.Exp.t -> unit
val add_enum_constant : InferGenerated.Clang_ast_t.pointer -> InferGenerated.Clang_ast_t.pointer option -> unit
val get_enum_constant_exp : InferGenerated.Clang_ast_t.pointer -> InferGenerated.Clang_ast_t.pointer option * InferIR.Exp.t option
val get_qualified_name : ?⁠linters_mode:bool -> InferGenerated.Clang_ast_t.named_decl_info -> InferIR.QualifiedCppName.t

returns sanitized, fully qualified name given name info

val get_unqualified_name : InferGenerated.Clang_ast_t.named_decl_info -> string

returns sanitized unqualified name given name info

val get_class_name_from_member : InferGenerated.Clang_ast_t.named_decl_info -> InferIR.QualifiedCppName.t

returns qualified class name given member name info

val get_type : InferGenerated.Clang_ast_t.type_ptr -> InferGenerated.Clang_ast_t.c_type option

looks up clang pointer to type and returns c_type. It requires type_ptr to be `TPtr.

val get_desugared_type : InferGenerated.Clang_ast_t.type_ptr -> InferGenerated.Clang_ast_t.c_type option

looks up clang pointer to type and resolves any sugar around it. See get_type for more info and restrictions

val get_decl_from_typ_ptr : InferGenerated.Clang_ast_t.type_ptr -> InferGenerated.Clang_ast_t.decl option

returns declaration of the type for certain types (RecordType, ObjCInterfaceType and None for others

val name_of_typedef_type_info : InferGenerated.Clang_ast_t.typedef_type_info -> InferIR.QualifiedCppName.t
val name_opt_of_typedef_qual_type : InferGenerated.Clang_ast_t.qual_type -> InferIR.QualifiedCppName.t option
type qual_type_to_sil_type = InferIR.Tenv.t -> InferGenerated.Clang_ast_t.qual_type -> InferIR.Typ.t
type procname_from_decl = ?⁠tenv:InferIR.Tenv.t -> ?⁠block_return_type:InferGenerated.Clang_ast_t.qual_type -> ?⁠outer_proc:InferIR.Typ.Procname.t -> InferGenerated.Clang_ast_t.decl -> InferIR.Typ.Procname.t
val qual_type_of_decl_ptr : InferGenerated.Clang_ast_t.pointer -> InferGenerated.Clang_ast_t.qual_type
val add_type_from_decl_ref_opt : qual_type_to_sil_type -> InferIR.Tenv.t -> InferGenerated.Clang_ast_t.decl_ref option -> bool -> unit
val add_type_from_decl_ref_list : qual_type_to_sil_type -> InferIR.Tenv.t -> InferGenerated.Clang_ast_t.decl_ref list -> unit
val get_function_decl_with_body : InferGenerated.Clang_ast_t.pointer -> InferGenerated.Clang_ast_t.decl option
val get_info_from_decl_ref : InferGenerated.Clang_ast_t.decl_ref -> InferGenerated.Clang_ast_t.named_decl_info * InferGenerated.Clang_ast_t.pointer * InferGenerated.Clang_ast_t.qual_type
val exists_eventually_st : ('a -> InferGenerated.Clang_ast_t.stmt -> bool) -> 'a -> InferGenerated.Clang_ast_t.stmt -> bool
val is_syntactically_global_var : InferGenerated.Clang_ast_t.decl -> bool

true if a declaration is a global variable

val is_static_local_var : InferGenerated.Clang_ast_t.decl -> bool

true if a declaration is a static local variable

val is_const_expr_var : InferGenerated.Clang_ast_t.decl -> bool

true if a declaration is a constexpr variable

val generate_key_stmt : InferGenerated.Clang_ast_t.stmt -> string

Generates a key for a statement based on its sub-statements and the statement tag.

val generate_key_decl : InferGenerated.Clang_ast_t.decl -> string

Generates a key for a declaration based on its name and the declaration tag.

val get_super_if : InferGenerated.Clang_ast_t.decl option -> InferGenerated.Clang_ast_t.decl option

Given an objc impl or interface decl, returns the objc interface decl of the superclass, if any.

val get_impl_decl_info : InferGenerated.Clang_ast_t.decl -> InferGenerated.Clang_ast_t.obj_c_implementation_decl_info option
val get_super_ObjCImplementationDecl : InferGenerated.Clang_ast_t.obj_c_implementation_decl_info -> InferGenerated.Clang_ast_t.decl option

Given an objc impl decl info, return its super class implementation decl

val is_objc_if_descendant : ?⁠blacklist:string list -> InferGenerated.Clang_ast_t.decl option -> string list -> bool

Recursively go up the inheritance hierarchy of a given ObjCInterfaceDecl. Returns true if the passed in decl is an objc interface decl that's an eventual descendant of one of the classes passed in. Ancestors param is a list of strings that represent the class names. Will short-circuit on NSObject and NSProxy since those are known to be common base classes. The list of classes to short-circuit on can be overridden via specifying the named `blacklist` argument.

val qual_type_to_objc_interface : InferGenerated.Clang_ast_t.qual_type -> InferGenerated.Clang_ast_t.decl option
val is_objc_factory_method : class_decl:InferGenerated.Clang_ast_t.decl option -> method_decl:InferGenerated.Clang_ast_t.decl option -> bool

A class method that returns an instance of the class is a factory method.

val name_of_decl_ref_opt : InferGenerated.Clang_ast_t.decl_ref option -> string option
val sil_annot_of_type : InferGenerated.Clang_ast_t.qual_type -> InferIR.Annot.Item.t
val type_of_decl : InferGenerated.Clang_ast_t.decl -> InferGenerated.Clang_ast_t.type_ptr option
val get_record_fields : InferGenerated.Clang_ast_t.decl -> InferGenerated.Clang_ast_t.decl list
val get_cxx_base_classes : InferGenerated.Clang_ast_t.decl -> InferGenerated.Clang_ast_t.type_ptr list
val get_cxx_virtual_base_classes : InferGenerated.Clang_ast_t.decl -> InferGenerated.Clang_ast_t.type_ptr list
val is_std_vector : InferGenerated.Clang_ast_t.qual_type -> bool
val has_block_attribute : InferGenerated.Clang_ast_t.decl -> bool
val is_implicit_decl : InferGenerated.Clang_ast_t.decl -> bool
val get_superclass_curr_class_objc_from_decl : InferGenerated.Clang_ast_t.decl -> InferGenerated.Clang_ast_t.decl_ref option