You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
23 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>InferIR__Procdesc (InferIR.InferIR__Procdesc)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><meta name="generator" content="doc-ock-html v1.0.0-1-g1fc9bf0"/></head><body><nav id="top"><a href="../index.html">Up</a> &mdash; <span class="package">package <a href="../index.html">InferIR</a></span></nav><header><h1><span class="keyword">Module</span> <span class="module-path">InferIR__Procdesc</span></h1></header><div class="spec module" id="module-Node"><a href="#module-Node" class="anchor"></a><div class="def module"><code><span class="keyword">module </span><a href="Node/index.html">Node</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></div><div class="doc"><p>node of the control flow graph</p></div></div><div class="spec module" id="module-IdMap"><a href="#module-IdMap" class="anchor"></a><div class="def module"><code><span class="keyword">module </span>IdMap : <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Caml.Map.S<span class="keyword"> with </span><span class="keyword">type </span><a href="index.html#module-IdMap">IdMap</a>.key<span class="keyword"> = </span><a href="Node/index.html#type-id">Node.id</a></code></div><div class="doc"><p>Map with node id keys.</p></div></div><div class="spec module" id="module-NodeHash"><a href="#module-NodeHash" class="anchor"></a><div class="def module"><code><span class="keyword">module </span>NodeHash : <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Caml.Hashtbl.S<span class="keyword"> with </span><span class="keyword">type </span><a href="index.html#module-NodeHash">NodeHash</a>.key<span class="keyword"> = </span><a href="Node/index.html#type-t">Node.t</a></code></div><div class="doc"><p>Hash table with nodes as keys.</p></div></div><div class="spec module" id="module-NodeMap"><a href="#module-NodeMap" class="anchor"></a><div class="def module"><code><span class="keyword">module </span>NodeMap : <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Caml.Map.S<span class="keyword"> with </span><span class="keyword">type </span><a href="index.html#module-NodeMap">NodeMap</a>.key<span class="keyword"> = </span><a href="Node/index.html#type-t">Node.t</a></code></div><div class="doc"><p>Map over nodes.</p></div></div><div class="spec module" id="module-NodeSet"><a href="#module-NodeSet" class="anchor"></a><div class="def module"><code><span class="keyword">module </span>NodeSet : <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Caml.Set.S<span class="keyword"> with </span><span class="keyword">type </span><a href="index.html#module-NodeSet">NodeSet</a>.elt<span class="keyword"> = </span><a href="Node/index.html#type-t">Node.t</a></code></div><div class="doc"><p>Set of nodes.</p></div></div><p>procedure descriptions</p><div class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>t</code><code></code><code></code></div><div class="doc"><p>proc description</p></div></div><div class="spec include"><div class="doc"></div><details open="open"><summary><span class="def"><code><span class="keyword">include </span><span class="keyword">sig</span> ... <span class="keyword">end</span></code></span></summary><div class="spec val" id="val-compare"><a href="#val-compare" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>compare : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> int</code></div><div class="doc"></div></div></details></div><div class="spec val" id="val-append_locals"><a href="#val-append_locals" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>append_locals : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/ProcAttributes/index.html#type-var_data">InferIR.ProcAttributes.var_data</a> list <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>append a list of new local variables to the existing list of local variables</p></div></div><div class="spec val" id="val-compute_distance_to_exit_node"><a href="#val-compute_distance_to_exit_node" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>compute_distance_to_exit_node : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Compute the distance of each node to the exit node, if not computed already</p></div></div><div class="spec val" id="val-create_node"><a href="#val-create_node" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>create_node : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../../InferBase/InferBase/Location/index.html#type-t">InferBase.Location.t</a> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-nodekind">Node.nodekind</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Sil/index.html#type-instr">InferIR.Sil.instr</a> list <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a></code></div><div class="doc"><p>Create a new cfg node with the given location, kind, list of instructions,
and add it to the procdesc.</p></div></div><div class="spec val" id="val-did_preanalysis"><a href="#val-did_preanalysis" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>did_preanalysis : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>true if we ran the preanalysis on the CFG associated with <code class="code">t</code></p></div></div><div class="spec val" id="val-fold_instrs"><a href="#val-fold_instrs" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>fold_instrs : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> init:<span class="type-var">'accum</span> <span class="keyword">&#8209;&gt;</span> f:(<span class="type-var">'accum</span> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Sil/index.html#type-instr">InferIR.Sil.instr</a> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'accum</span>) <span class="keyword">&#8209;&gt;</span> <span class="type-var">'accum</span></code></div><div class="doc"><p>fold over all nodes and their instructions</p></div></div><div class="spec val" id="val-find_map_instrs"><a href="#val-find_map_instrs" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>find_map_instrs : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> f:(<a href="../InferIR/Sil/index.html#type-instr">InferIR.Sil.instr</a> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> option) <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> option</code></div><div class="doc"></div></div><div class="spec val" id="val-from_proc_attributes"><a href="#val-from_proc_attributes" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>from_proc_attributes : <a href="../InferIR/ProcAttributes/index.html#type-t">InferIR.ProcAttributes.t</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a></code></div><div class="doc"><p>Use <code class="code">Cfg.create_proc_desc</code> if you are adding a proc desc to a cfg</p></div></div><div class="spec val" id="val-get_access"><a href="#val-get_access" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_access : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/PredSymb/index.html#type-access">InferIR.PredSymb.access</a></code></div><div class="doc"><p>Return the visibility attribute</p></div></div><div class="spec val" id="val-get_attributes"><a href="#val-get_attributes" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_attributes : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/ProcAttributes/index.html#type-t">InferIR.ProcAttributes.t</a></code></div><div class="doc"><p>Get the attributes of the procedure.</p></div></div><div class="spec val" id="val-get_captured"><a href="#val-get_captured" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_captured : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> (<a href="../InferIR/Mangled/index.html#type-t">InferIR.Mangled.t</a><span class="keyword"> * </span><a href="../InferIR/Typ/index.html#type-t">InferIR.Typ.t</a>) list</code></div><div class="doc"><p>Return name and type of block's captured variables</p></div></div><div class="spec val" id="val-get_exit_node"><a href="#val-get_exit_node" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_exit_node : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a></code></div><div class="doc"></div></div><div class="spec val" id="val-get_formals"><a href="#val-get_formals" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_formals : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> (<a href="../InferIR/Mangled/index.html#type-t">InferIR.Mangled.t</a><span class="keyword"> * </span><a href="../InferIR/Typ/index.html#type-t">InferIR.Typ.t</a>) list</code></div><div class="doc"><p>Return name and type of formal parameters</p></div></div><div class="spec val" id="val-get_loc"><a href="#val-get_loc" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_loc : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../../InferBase/InferBase/Location/index.html#type-t">InferBase.Location.t</a></code></div><div class="doc"><p>Return loc information for the procedure</p></div></div><div class="spec val" id="val-get_locals"><a href="#val-get_locals" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_locals : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/ProcAttributes/index.html#type-var_data">InferIR.ProcAttributes.var_data</a> list</code></div><div class="doc"><p>Return name and type and attributes of local variables</p></div></div><div class="spec val" id="val-get_nodes"><a href="#val-get_nodes" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_nodes : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a> list</code></div><div class="doc"></div></div><div class="spec val" id="val-get_nodes_num"><a href="#val-get_nodes_num" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_nodes_num : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> int</code></div><div class="doc"></div></div><div class="spec val" id="val-get_proc_name"><a href="#val-get_proc_name" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_proc_name : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a></code></div><div class="doc"></div></div><div class="spec val" id="val-get_ret_type"><a href="#val-get_ret_type" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_ret_type : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Typ/index.html#type-t">InferIR.Typ.t</a></code></div><div class="doc"><p>Return the return type of the procedure and type string</p></div></div><div class="spec val" id="val-get_ret_var"><a href="#val-get_ret_var" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_ret_var : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Pvar/index.html#type-t">InferIR.Pvar.t</a></code></div><div class="doc"></div></div><div class="spec val" id="val-get_start_node"><a href="#val-get_start_node" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_start_node : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a></code></div><div class="doc"></div></div><div class="spec val" id="val-is_defined"><a href="#val-is_defined" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_defined : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>Return <code class="code">true</code> iff the procedure is defined, and not just declared</p></div></div><div class="spec val" id="val-is_java_synchronized"><a href="#val-is_java_synchronized" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_java_synchronized : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>Return <code class="code">true</code> if the procedure signature has the Java synchronized keyword</p></div></div><div class="spec val" id="val-iter_instrs"><a href="#val-iter_instrs" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>iter_instrs : (<a href="Node/index.html#type-t">Node.t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Sil/index.html#type-instr">InferIR.Sil.instr</a> <span class="keyword">&#8209;&gt;</span> unit) <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>iterate over all nodes and their instructions</p></div></div><div class="spec val" id="val-replace_instrs"><a href="#val-replace_instrs" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>replace_instrs : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> f:(<a href="../InferIR/Sil/index.html#type-instr">InferIR.Sil.instr</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Sil/index.html#type-instr">InferIR.Sil.instr</a>) <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Map and replace the instructions to be executed</p></div></div><div class="spec val" id="val-iter_nodes"><a href="#val-iter_nodes" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>iter_nodes : (<a href="Node/index.html#type-t">Node.t</a> <span class="keyword">&#8209;&gt;</span> unit) <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>iterate over all the nodes of a procedure</p></div></div><div class="spec val" id="val-fold_nodes"><a href="#val-fold_nodes" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>fold_nodes : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> init:<span class="type-var">'accum</span> <span class="keyword">&#8209;&gt;</span> f:(<span class="type-var">'accum</span> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'accum</span>) <span class="keyword">&#8209;&gt;</span> <span class="type-var">'accum</span></code></div><div class="doc"><p>fold over all the nodes of a procedure</p></div></div><div class="spec val" id="val-fold_slope_range"><a href="#val-fold_slope_range" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>fold_slope_range : <a href="Node/index.html#type-t">Node.t</a> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a> <span class="keyword">&#8209;&gt;</span> init:<span class="type-var">'accum</span> <span class="keyword">&#8209;&gt;</span> f:(<span class="type-var">'accum</span> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'accum</span>) <span class="keyword">&#8209;&gt;</span> <span class="type-var">'accum</span></code></div><div class="doc"><p>fold between two nodes or until we reach a branching structure</p></div></div><div class="spec val" id="val-set_succs_exn_only"><a href="#val-set_succs_exn_only" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>set_succs_exn_only : <a href="Node/index.html#type-t">Node.t</a> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a> list <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"></div></div><div class="spec val" id="val-node_set_succs_exn"><a href="#val-node_set_succs_exn" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>node_set_succs_exn : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a> list <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a> list <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Set the successor nodes and exception nodes, and build predecessor links</p></div></div><div class="spec val" id="val-set_exit_node"><a href="#val-set_exit_node" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>set_exit_node : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Set the exit node of the procedure</p></div></div><div class="spec val" id="val-set_start_node"><a href="#val-set_start_node" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>set_start_node : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"></div></div><div class="spec val" id="val-signal_did_preanalysis"><a href="#val-signal_did_preanalysis" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>signal_did_preanalysis : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>indicate that we have performed preanalysis on the CFG assoociated with <code class="code">t</code></p></div></div><div class="spec val" id="val-is_loop_head"><a href="#val-is_loop_head" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_loop_head : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="Node/index.html#type-t">Node.t</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"></div></div><div class="spec val" id="val-pp_signature"><a href="#val-pp_signature" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pp_signature : Format.formatter <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"></div></div><div class="spec val" id="val-pp_local"><a href="#val-pp_local" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pp_local : Format.formatter <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/ProcAttributes/index.html#type-var_data">InferIR.ProcAttributes.var_data</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"></div></div><div class="spec val" id="val-is_specialized"><a href="#val-is_specialized" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_specialized : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"></div></div><div class="spec val" id="val-is_captured_var"><a href="#val-is_captured_var" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_captured_var : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Pvar/index.html#type-t">InferIR.Pvar.t</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>true if pvar is a captured variable of a cpp lambda or obcj block</p></div></div><div class="spec val" id="val-has_modify_in_block_attr"><a href="#val-has_modify_in_block_attr" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>has_modify_in_block_attr : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Pvar/index.html#type-t">InferIR.Pvar.t</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"></div></div><div class="spec val" id="val-specialize_types"><a href="#val-specialize_types" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>specialize_types : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">&#8209;&gt;</span> (<a href="../InferIR/Exp/index.html#type-t">InferIR.Exp.t</a><span class="keyword"> * </span><a href="../InferIR/Typ/index.html#type-t">InferIR.Typ.t</a>) list <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a></code></div><div class="doc"><p>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</p></div></div><div class="spec val" id="val-specialize_with_block_args"><a href="#val-specialize_with_block_args" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>specialize_with_block_args : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Exp/index.html#type-closure">InferIR.Exp.closure</a> option list <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a></code></div><div class="doc"><p>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</p></div></div><div class="spec val" id="val-is_connected"><a href="#val-is_connected" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_connected : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> (unit, [ `Join | `Other ]) <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Result.t</code></div><div class="doc"><p>checks whether a cfg for the given procdesc is connected or not</p></div></div></body></html>