IR.PvarProgram variables.
type translation_unit = IBase.SourceFile.t optionType for program variables. There are 4 kinds of variables:
x | callee is distinguished from x)include Ppx_compare_lib.Comparable.S with type t := tval compare : t Base__Ppx_compare_lib.compareval yojson_of_t : t -> Ppx_yojson_conv_lib.Yojson.Safe.tComparison considering all pvars named 'this'/'self' to be equal
val get_declaring_function : t -> Procname.t optionif not a global, return function declaring var
val d : t -> unitDump a program variable.
val get_ret_pvar : Procname.t -> tget_ret_pvar proc_name retuns the return pvar associated with the procedure name
val get_ret_param_pvar : Procname.t -> tget_ret_param_pvar proc_name retuns the return_param pvar associated with the procedure name
val get_simplified_name : t -> stringGet a simplified version of the name component of a program variable.
val is_abduced : t -> boolCheck if the pvar is an abduced return var or param passed by ref
val is_callee : t -> boolCheck if the pvar is a callee var
val is_global : t -> boolCheck if the pvar is a global var or a static local var
val is_static_local : t -> boolCheck if the pvar is a static variable declared inside a function
val is_constant_array : t -> boolCheck if the pvar has a constant array type
val is_const : t -> boolCheck if the pvar has a const type
val is_local : t -> boolCheck if the pvar is a (non-static) local var
val is_seed : t -> boolCheck if the pvar is a seed var
val is_return : t -> boolCheck if the pvar is a return var
val is_this : t -> boolCheck if a pvar is the special "this" var
val is_self : t -> boolCheck if a pvar is the special "self" var
val is_artificial : t -> boolCheck if a pvar is an artificial variable related coroutine, "__promise" or "__coro_frame"
val is_frontend_tmp : t -> boolreturn true if pvar is a temporary variable generated by the frontend
val is_clang_tmp : t -> boolreturn true if pvar is a temporary variable generated by clang
val is_ssa_frontend_tmp : t -> boolreturn true if pvar is a temporary variable generated by the frontend and is only assigned once on a non-looping control-flow path
val is_cpp_temporary : t -> boolreturn true if this pvar represents a C++ temporary object (see http://en.cppreference.com/w/cpp/language/lifetime)
val is_cpp_unnamed_param : t -> boolreturn true if this pvar represents an unnamed parameter
val is_gmock_param : t -> boolreturn true if the parameter is for mock methods of GoogleTest
val is_objc_static_local_of_proc_name : string -> t -> boolCheck if a pvar is a local static in objc
val is_block_pvar : t -> boolCheck if a pvar is a local pointing to a block in objc
In case of a temporary variable, returns the id used to create it, or None otherwise.
val mk : Mangled.t -> Procname.t -> tmk name proc_name creates a program var with the given function name
val mk_abduced_ref_param : Procname.t -> int -> IBase.Location.t -> tcreate an abduced variable for a parameter passed by reference
val mk_abduced_ret : Procname.t -> IBase.Location.t -> tcreate an abduced return variable for a call to proc_name at loc
val mk_callee : Mangled.t -> Procname.t -> tmk_callee name proc_name creates a program var for a callee function with the given function name
val mk_global :
?is_constexpr:bool ->
?is_ice:bool ->
?is_pod:bool ->
?is_static_local:bool ->
?is_static_global:bool ->
?is_constant_array:bool ->
?is_const:bool ->
?translation_unit:IBase.SourceFile.t ->
?template_args:Typ.template_spec_info ->
Mangled.t ->
tcreate a global variable with the given name
val mk_tmp : string -> Procname.t -> tcreate a fresh temporary variable local to procedure pname. for use in the frontends only!
val pp : IStdlib.Pp.env -> F.formatter -> t -> unitPretty print a program variable.
val pp_value : F.formatter -> t -> unitPretty print a pvar which denotes a value, not an address
val pp_value_non_verbose : F.formatter -> t -> unitNon-verbose version of pp_value
val pp_translation_unit : F.formatter -> translation_unit -> unitval to_callee : Procname.t -> t -> tTurn an ordinary program variable into a callee program variable
val to_string : t -> stringConvert a pvar to string.
val get_translation_unit : t -> translation_unitGet the translation unit corresponding to a global. Raises Invalid_arg if not a global.
val is_compile_constant : t -> boolIs the variable's value a compile-time constant? Always (potentially incorrectly) returns false for non-globals.
val is_ice : t -> boolIs the variable's type an integral constant expression? Always (potentially incorrectly) returns false for non-globals.
val is_pod : t -> boolIs the variable's type a "Plain Old Data" type (C++)? Always (potentially incorrectly) returns true for non-globals.
val get_initializer_pname : t -> Procname.t optionGet the procname of the initializer function for the given global variable
val get_template_args : t -> Typ.template_spec_infomodule Set : IStdlib.PrettyPrintable.PPSet with type elt = tmodule Map : IStdlib.PrettyPrintable.PPMap with type key = t