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.

2 lines
6.7 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>CallGraph (infer.Backend.CallGraph)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> <a href="../../index.html">infer</a> &#x00BB; <a href="../index.html">Backend</a> &#x00BB; CallGraph</nav><h1>Module <code>Backend.CallGraph</code></h1></header><div class="spec module" id="module-F"><a href="#module-F" class="anchor"></a><code><span class="keyword">module</span> F = Stdlib.Format</code></div><div class="spec module-type" id="module-type-NodeSig"><a href="#module-type-NodeSig" class="anchor"></a><code><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-NodeSig/index.html">NodeSig</a> = <span class="keyword">sig</span> ... <span class="keyword">end</span></code></div><div class="spec module" id="module-Node"><a href="#module-Node" class="anchor"></a><code><span class="keyword">module</span> <a href="Node/index.html">Node</a> : <a href="index.html#module-type-NodeSig">NodeSig</a></code></div><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code></dt></dl><dl><dt class="spec value" id="val-reset"><a href="#val-reset" class="anchor"></a><code><span class="keyword">val</span> reset : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p>empty the graph and shrink it to its initial size</p></dd></dl><dl><dt class="spec value" id="val-create"><a href="#val-create" class="anchor"></a><code><span class="keyword">val</span> create : int <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>create n</code> makes an empty graph with initial capacity <code>n</code> which grows as required</p></dd></dl><dl><dt class="spec value" id="val-n_procs"><a href="#val-n_procs" class="anchor"></a><code><span class="keyword">val</span> n_procs : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> int</code></dt><dd><p>number of procedures in graph</p></dd></dl><dl><dt class="spec value" id="val-mem"><a href="#val-mem" class="anchor"></a><code><span class="keyword">val</span> mem : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> int <span>&#45;&gt;</span> bool</code></dt><dd><p>is an int <code>id</code> the index of a node in the graph?</p></dd></dl><dl><dt class="spec value" id="val-mem_procname"><a href="#val-mem_procname" class="anchor"></a><code><span class="keyword">val</span> mem_procname : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> bool</code></dt><dd><p>is there a node for <code>procname</code> in the graph?</p></dd></dl><dl><dt class="spec value" id="val-flag"><a href="#val-flag" class="anchor"></a><code><span class="keyword">val</span> flag : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-flag_reachable"><a href="#val-flag_reachable" class="anchor"></a><code><span class="keyword">val</span> flag_reachable : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p>flag all nodes reachable from the node of the given procname, if it exists</p></dd></dl><dl><dt class="spec value" id="val-iter_unflagged_leaves"><a href="#val-iter_unflagged_leaves" class="anchor"></a><code><span class="keyword">val</span> iter_unflagged_leaves : <span>f:<span>(<a href="Node/index.html#type-t">Node.t</a> <span>&#45;&gt;</span> unit)</span></span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p>iterate over all leaves that have their flag set to false</p></dd></dl><dl><dt class="spec value" id="val-remove"><a href="#val-remove" class="anchor"></a><code><span class="keyword">val</span> remove : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-to_dotty"><a href="#val-to_dotty" class="anchor"></a><code><span class="keyword">val</span> to_dotty : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> unit</code></dt><dd><p>output call graph in dotty format with the given filename in results dir</p></dd></dl><dl><dt class="spec value" id="val-add_edge"><a href="#val-add_edge" class="anchor"></a><code><span class="keyword">val</span> add_edge : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span>pname:<a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a></span> <span>&#45;&gt;</span> <span>successor_pname:<a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a></span> <span>&#45;&gt;</span> unit</code></dt><dd><p>add an edge from <code>pname</code> to <code>successor_pname</code> in the graph, creating a node for <code>pname</code> if there isn't one already</p></dd></dl><dl><dt class="spec value" id="val-create_node"><a href="#val-create_node" class="anchor"></a><code><span class="keyword">val</span> create_node : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> <span><a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>create a new node with edges from <code>pname</code> to <code>successor_pnames</code> in the graph</p></dd></dl><dl><dt class="spec value" id="val-fold_flagged"><a href="#val-fold_flagged" class="anchor"></a><code><span class="keyword">val</span> fold_flagged : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span>f:<span>(<a href="Node/index.html#type-t">Node.t</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> <span class="type-var">'a</span>)</span></span> <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> <span class="type-var">'a</span></code></dt><dd><p>perform a fold over the nodes in the graph with flag set to true</p></dd></dl><dl><dt class="spec value" id="val-default_initial_capacity"><a href="#val-default_initial_capacity" class="anchor"></a><code><span class="keyword">val</span> default_initial_capacity : int</code></dt><dd><p>reasonable minimum capacity for the graph that is prime</p></dd></dl></div></body></html>