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 specialized_with_aliasing_info = {
  1. orig_proc : Procname.t;
  2. aliases : Pvar.t list list;
    (*

    all the pvars in a same list are aliasing each other. e.g. aliases = [[x; y; z]; [a; b]] indicates that x, y and z alias each other and a and b as well

    *)
}
val compare_specialized_with_aliasing_info : specialized_with_aliasing_info -> specialized_with_aliasing_info -> int
type 'captured_var passed_closure =
  1. | Closure of Procname.t * 'captured_var list
  2. | Fields of (Fieldname.t * 'captured_var passed_closure) list
val compare_passed_closure : ('captured_var -> 'captured_var -> int) -> 'captured_var passed_closure -> 'captured_var passed_closure -> int
val equal_passed_closure : ('captured_var -> 'captured_var -> bool) -> 'captured_var passed_closure -> 'captured_var passed_closure -> bool
type specialized_with_closures_info = {
  1. orig_proc : Procname.t;
  2. formals_to_closures : CapturedVar.t passed_closure Pvar.Map.t;
}
val compare_specialized_with_closures_info : specialized_with_closures_info -> specialized_with_closures_info -> int
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_cpp_deleted : bool;
    (*

    true if the procedure is deleted

    *)
  16. is_cpp_implicit : bool;
    (*

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

    *)
  17. is_defined : bool;
    (*

    true if the procedure is defined, and not just declared

    *)
  18. is_java_synchronized_method : bool;
    (*

    the procedure is a Java synchronized method

    *)
  19. is_csharp_synchronized_method : bool;
    (*

    the procedure is a C# synchronized method

    *)
  20. is_hack_async : bool;
  21. is_hack_wrapper : bool;
    (*

    a generated wrapper for LSB or default parameters

    *)
  22. 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.

    *)
  23. is_no_return : bool;
    (*

    the procedure is known not to return

    *)
  24. is_objc_arc_on : bool;
    (*

    the ObjC procedure is compiled with ARC

    *)
  25. is_specialized : bool;
    (*

    the procedure is a clone specialized for dynamic dispatch handling

    *)
  26. is_synthetic_method : bool;
    (*

    the procedure is a synthetic method

    *)
  27. is_clang_variadic : bool;
    (*

    the procedure is variadic, only supported for Clang procedures

    *)
  28. 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

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

    __attribute__((sentinel(int, int)))

    *)
  30. specialized_with_aliasing_info : specialized_with_aliasing_info option;
    (*

    the procedure is a clone specialized with captured variables and paramaters sharing memory, with link to the original procedure, and a list of variables aliasing each other.

    *)
  31. specialized_with_closures_info : specialized_with_closures_info option;
    (*

    the procedure is a clone specialized with calls to concrete closures, with link to the original procedure, and a map that links the original formals to the elements of the closure used to specialize the procedure.

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

    the kind of method the procedure is

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

    location of this procedure in the source code

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

    location of this procedure is possibly instantiated

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

    source file where the procedure was captured

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

    name, type and attributes of local variables

    *)
  37. objc_accessor : objc_accessor_type option;
    (*

    type of ObjC accessor, if any

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

    name of the procedure

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

    return type

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

    annotations of return type

    *)
  41. has_added_return_param : bool;
    (*

    whether or not a return param was added

    *)
  42. is_ret_type_pod : bool;
    (*

    whether or not the return type is POD

    *)
  43. 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