Module IR.ProcAttributes

module F = Stdlib.Format

Attributes of a procedure.

type access =
  1. | Default
  2. | Public
  3. | Private
  4. | Protected

Visibility modifiers.

val compare_access : access -> access -> int
val equal_access : access -> access -> bool
type objc_accessor_type =
  1. | Objc_getter of Struct.field
  2. | Objc_setter of Struct.field
type var_data = {
  1. name : Mangled.t;
  2. typ : Typ.t;
  3. modify_in_block : bool;
    (*

    __block attribute of Objective-C variables, means that it will be modified inside a block

    *)
  4. is_constexpr : bool;
  5. is_declared_unused : bool;
    (*

    variable declared with attribute unused

    *)
  6. is_structured_binding : bool;
    (*

    variable declared by structured binding

    *)
  7. has_cleanup_attribute : bool;
    (*

    variable declared with attribute cleanup, only set in clang frontend

    *)
  8. tmp_id : Ident.t option;
    (*

    the tmp id used to build the variable name in case of a temp variable, None otherwise.

    *)
}
type block_as_arg_attributes = {
  1. passed_to : Procname.t;
  2. passed_as_noescape_block : bool;
}
val compare_block_as_arg_attributes : block_as_arg_attributes -> block_as_arg_attributes -> int
val equal_block_as_arg_attributes : block_as_arg_attributes -> block_as_arg_attributes -> bool
type t = {
  1. access : access;
    (*

    visibility access

    *)
  2. captured : CapturedVar.t list;
    (*

    name, type, and mode of variables captured in blocks and lambdas

    *)
  3. mutable changed : bool;
    (*

    true if proc has changed since last analysis

    *)
  4. exceptions : string list;
    (*

    exceptions thrown by the procedure

    *)
  5. formals : (Mangled.t * Typ.t * Annot.Item.t) list;
    (*

    name, type, and annotation of formal parameters

    *)
  6. const_formals : int list;
    (*

    list of indices of formals that are const-qualified

    *)
  7. reference_formals : int list;
    (*

    list of indices of formals that are passed by reference

    *)
  8. is_abstract : bool;
    (*

    the procedure is abstract

    *)
  9. is_biabduction_model : bool;
    (*

    the procedure is a model for the biabduction analysis

    *)
  10. is_bridge_method : bool;
    (*

    the procedure is a bridge method

    *)
  11. is_cpp_const_member_fun : bool;
    (*

    true if the procedure is a const function

    *)
  12. is_cpp_copy_assignment : bool;
    (*

    true if the procedure is a copy assignment

    *)
  13. is_cpp_copy_ctor : bool;
    (*

    true if the procedure is a copy constructor

    *)
  14. is_cpp_move_ctor : bool;
    (*

    true if the procedure is a move constructor

    *)
  15. is_static_ctor : bool;
    (*

    true if the procedure has the constructor attribute

    *)
  16. is_cpp_deleted : bool;
    (*

    true if the procedure is deleted

    *)
  17. is_cpp_implicit : bool;
    (*

    returns false if the declaration exists in code and true if it was created implicitly by the compiler

    *)
  18. is_defined : bool;
    (*

    true if the procedure is defined, and not just declared

    *)
  19. is_java_synchronized_method : bool;
    (*

    the procedure is a Java synchronized method

    *)
  20. is_csharp_synchronized_method : bool;
    (*

    the procedure is a C# synchronized method

    *)
  21. is_async : bool;
  22. is_closure_wrapper : bool;
    (*

    the wrapper we insert for each closure

    *)
  23. is_hack_wrapper : bool;
    (*

    a generated wrapper for LSB or default parameters

    *)
  24. block_as_arg_attributes : block_as_arg_attributes option;
    (*

    Present if the procedure is an Objective-C block that has been passed to the given method in a position annotated with the NS_NOESCAPE attribute.

    *)
  25. is_no_return : bool;
    (*

    the procedure is known not to return

    *)
  26. is_objc_arc_on : bool;
    (*

    the ObjC procedure is compiled with ARC

    *)
  27. is_specialized : bool;
    (*

    the procedure is a clone specialized for dynamic dispatch handling

    *)
  28. is_synthetic_method : bool;
    (*

    the procedure is a synthetic method

    *)
  29. is_clang_variadic : bool;
    (*

    the procedure is variadic, only supported for Clang procedures

    *)
  30. hack_variadic_position : int option;
    (*

    the procedure is variadic and Some n means the variadic vector is composed of the arguments n, n+1, ..., length formals -1

    *)
  31. python_args : string list;
    (*

    each python function has a list of parameters that we store as a special ProcAttribute while list formals will only contain dict parameters like Python locals

    *)
  32. sentinel_attr : (int * int) option;
    (*

    __attribute__((sentinel(int, int)))

    *)
  33. clang_method_kind : ClangMethodKind.t;
    (*

    the kind of method the procedure is

    *)
  34. loc : IBase.Location.t;
    (*

    location of this procedure in the source code

    *)
  35. loc_instantiated : IBase.Location.t option;
    (*

    location of this procedure is possibly instantiated

    *)
  36. translation_unit : IBase.SourceFile.t;
    (*

    source file where the procedure was captured

    *)
  37. mutable locals : var_data list;
    (*

    name, type and attributes of local variables

    *)
  38. objc_accessor : objc_accessor_type option;
    (*

    type of ObjC accessor, if any

    *)
  39. proc_name : Procname.t;
    (*

    name of the procedure

    *)
  40. ret_type : Typ.t;
    (*

    return type

    *)
  41. ret_annots : Annot.Item.t;
    (*

    annotations of return type

    *)
  42. has_added_return_param : bool;
    (*

    whether or not a return param was added

    *)
  43. is_ret_type_pod : bool;
    (*

    whether or not the return type is POD

    *)
  44. is_ret_constexpr : bool;
    (*

    whether the (C++) function or method is declared as constexpr

    *)
}
val default : IBase.SourceFile.t -> Procname.t -> t

Create a proc_attributes with default values.

val default_var_data : Pvar.t -> Typ.t -> var_data
val pp : Stdlib.Format.formatter -> t -> unit
val get_access : t -> access

Return the visibility attribute

val get_loc : t -> IBase.Location.t

Return loc information for the procedure

val get_loc_instantiated : t -> IBase.Location.t option

Return instantiated loc information for the procedure

val get_proc_name : t -> Procname.t
val get_pvar_formals : t -> (Pvar.t * Typ.t) list

Return pvar and type of formal parameters

val get_passed_by_value_formals : t -> (Pvar.t * Typ.t) list

Return pvar and type of formal parameters that are passed by value

val get_passed_by_ref_formals : t -> (Pvar.t * Typ.t) list

Return pvar and type of formal parameters that are passed by reference

val get_pointer_formals : t -> (Pvar.t * Typ.t) list

Return pvar and type of formal parameters that are passed as pointer, i.e. T*

val to_return_type : t -> Typ.t

the return type from method signature, taking into account if the procedure has added return parameter

val get_this : t -> Pvar.t option

if the procedures is an instance method then this is its self or this variable

val pp_block_as_arg_attributes : F.formatter -> block_as_arg_attributes -> unit
module SQLite : IBase.SqliteUtils.Data with type t = t