Module InferIR__Procdesc

module Node : sig ... end

node of the control flow graph

module IdMap : InferStdlib.IStd.Caml.Map.S with type IdMap.key = Node.id

Map with node id keys.

module NodeHash : InferStdlib.IStd.Caml.Hashtbl.S with type NodeHash.key = Node.t

Hash table with nodes as keys.

module NodeMap : InferStdlib.IStd.Caml.Map.S with type NodeMap.key = Node.t

Map over nodes.

module NodeSet : InferStdlib.IStd.Caml.Set.S with type NodeSet.elt = Node.t

Set of nodes.

procedure descriptions

type t

proc description

include sig ... end
val compare : t ‑> t ‑> int
val append_locals : t ‑> InferIR.ProcAttributes.var_data list ‑> unit

append a list of new local variables to the existing list of local variables

val compute_distance_to_exit_node : t ‑> unit

Compute the distance of each node to the exit node, if not computed already

val create_node : t ‑> InferBase.Location.t ‑> Node.nodekind ‑> InferIR.Sil.instr list ‑> Node.t

Create a new cfg node with the given location, kind, list of instructions, and add it to the procdesc.

val did_preanalysis : t ‑> bool

true if we ran the preanalysis on the CFG associated with t

val fold_instrs : t ‑> init:'accum ‑> f:('accum ‑> Node.t ‑> InferIR.Sil.instr ‑> 'accum) ‑> 'accum

fold over all nodes and their instructions

val find_map_instrs : t ‑> f:(InferIR.Sil.instr ‑> 'a option) ‑> 'a option
val from_proc_attributes : InferIR.ProcAttributes.t ‑> t

Use Cfg.create_proc_desc if you are adding a proc desc to a cfg

val get_access : t ‑> InferIR.PredSymb.access

Return the visibility attribute

val get_attributes : t ‑> InferIR.ProcAttributes.t

Get the attributes of the procedure.

val get_captured : t ‑> (InferIR.Mangled.t * InferIR.Typ.t) list

Return name and type of block's captured variables

val get_exit_node : t ‑> Node.t
val get_formals : t ‑> (InferIR.Mangled.t * InferIR.Typ.t) list

Return name and type of formal parameters

val get_loc : t ‑> InferBase.Location.t

Return loc information for the procedure

val get_locals : t ‑> InferIR.ProcAttributes.var_data list

Return name and type and attributes of local variables

val get_nodes : t ‑> Node.t list
val get_nodes_num : t ‑> int
val get_proc_name : t ‑> InferIR.Typ.Procname.t
val get_ret_type : t ‑> InferIR.Typ.t

Return the return type of the procedure and type string

val get_ret_var : t ‑> InferIR.Pvar.t
val get_start_node : t ‑> Node.t
val is_defined : t ‑> bool

Return true iff the procedure is defined, and not just declared

val is_java_synchronized : t ‑> bool

Return true if the procedure signature has the Java synchronized keyword

val iter_instrs : (Node.t ‑> InferIR.Sil.instr ‑> unit) ‑> t ‑> unit

iterate over all nodes and their instructions

val replace_instrs : t ‑> f:(InferIR.Sil.instr ‑> InferIR.Sil.instr) ‑> unit

Map and replace the instructions to be executed

val iter_nodes : (Node.t ‑> unit) ‑> t ‑> unit

iterate over all the nodes of a procedure

val fold_nodes : t ‑> init:'accum ‑> f:('accum ‑> Node.t ‑> 'accum) ‑> 'accum

fold over all the nodes of a procedure

val fold_slope_range : Node.t ‑> Node.t ‑> init:'accum ‑> f:('accum ‑> Node.t ‑> 'accum) ‑> 'accum

fold between two nodes or until we reach a branching structure

val set_succs_exn_only : Node.t ‑> Node.t list ‑> unit
val node_set_succs_exn : t ‑> Node.t ‑> Node.t list ‑> Node.t list ‑> unit

Set the successor nodes and exception nodes, and build predecessor links

val set_exit_node : t ‑> Node.t ‑> unit

Set the exit node of the procedure

val set_start_node : t ‑> Node.t ‑> unit
val signal_did_preanalysis : t ‑> unit

indicate that we have performed preanalysis on the CFG assoociated with t

val is_loop_head : t ‑> Node.t ‑> bool
val pp_signature : Format.formatter ‑> t ‑> unit
val pp_local : Format.formatter ‑> InferIR.ProcAttributes.var_data ‑> unit
val is_specialized : t ‑> bool
val is_captured_var : t ‑> InferIR.Pvar.t ‑> bool

true if pvar is a captured variable of a cpp lambda or obcj block

val has_modify_in_block_attr : t ‑> InferIR.Pvar.t ‑> bool
val specialize_types : t ‑> InferIR.Typ.Procname.t ‑> (InferIR.Exp.t * InferIR.Typ.t) list ‑> t

Creates a copy of a procedure description and a list of type substitutions of the form (name, typ) where name is a parameter. The resulting procdesc is isomorphic but all the type of the parameters are replaced in the instructions according to the list. The virtual calls are also replaced to match the parameter types

val specialize_with_block_args : t ‑> InferIR.Typ.Procname.t ‑> InferIR.Exp.closure option list ‑> t

Creates a copy of a procedure description given a list of possible closures that are passed as arguments to the method. The resulting procdesc is isomorphic but a) the block parameters are replaces with the closures b) the parameters of the method are extended with parameters for the captured variables in the closures

val is_connected : t ‑> (unit, [ `Join | `Other ]) InferStdlib.IStd.Result.t

checks whether a cfg for the given procdesc is connected or not