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>
<htmlxmlns="http://www.w3.org/1999/xhtml"><head><title>IR__Sil (infer.IR__Sil)</title><linkrel="stylesheet"href="../../odoc.css"/><metacharset="utf-8"/><metaname="generator"content="odoc 1.5.1"/><metaname="viewport"content="width=device-width,initial-scale=1.0"/><scriptsrc="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><divclass="content"><header><nav><ahref="../index.html">Up</a>–<ahref="../index.html">infer</a>» IR__Sil</nav><h1>Module <code>IR__Sil</code></h1><p>The Smallfoot Intermediate Language</p><navclass="toc"><ul><li><ahref="#programs-and-types">Programs and Types</a></li></ul></nav></header><divclass="spec module"id="module-F"><ahref="#module-F"class="anchor"></a><code><spanclass="keyword">module</span> F = Stdlib.Format</code></div><section><header><h3id="programs-and-types"><ahref="#programs-and-types"class="anchor"></a>Programs and Types</h3></header><dl><dtclass="spec type"id="type-if_kind"><ahref="#type-if_kind"class="anchor"></a><code><spanclass="keyword">type</span> if_kind</code><code> = </code><tableclass="variant"><trid="type-if_kind.Ik_bexp"class="anchored"><tdclass="def constructor"><ahref="#type-if_kind.Ik_bexp"class="anchor"></a><code>| </code><code><spanclass="constructor">Ik_bexp</span></code></td><tdclass="doc"><p>boolean expressions, and exp ? exp : exp</p></td></tr><trid="type-if_kind.Ik_dowhile"class="anchored"><tdclass="def constructor"><ahref="#type-if_kind.Ik_dowhile"class="anchor"></a><code>| </code><code><spanclass="constructor">Ik_dowhile</span></code></td></tr><trid="type-if_kind.Ik_for"class="anchored"><tdclass="def constructor"><ahref="#type-if_kind.Ik_for"class="anchor"></a><code>| </code><code><spanclass="constructor">Ik_for</span></code></td></tr><trid="type-if_kind.Ik_if"class="anchored"><tdclass="def constructor"><ahref="#type-if_kind.Ik_if"class="anchor"></a><code>| </code><code><spanclass="constructor">Ik_if</span></code></td></tr><trid="type-if_kind.Ik_land_lor"class="anchored"><tdclass="def constructor"><ahref="#type-if_kind.Ik_land_lor"class="anchor"></a><code>| </code><code><spanclass="constructor">Ik_land_lor</span></code></td><tdclass="doc"><p>obtained from translation of && or ||</p></td></tr><trid="type-if_kind.Ik_while"class="anchored"><tdclass="def constructor"><ahref="#type-if_kind.Ik_while"class="anchor"></a><code>| </code><code><spanclass="constructor">Ik_while</span></code></td></tr><trid="type-if_kind.Ik_switch"class="anchored"><tdclass="def constructor"><ahref="#type-if_kind.Ik_switch"class="anchor"></a><code>| </code><code><spanclass="constructor">Ik_switch</span></code></td></tr></table></dt><dd><p>Kind of prune instruction</p></dd></dl><div><divclass="spec include"><divclass="doc"><dl><dtclass="spec value"id="val-compare_if_kind"><ahref="#val-compare_if_kind"class="anchor"></a><code><spanclass="keyword">val</span> compare_if_kind : <ahref="index.html#type-if_kind">if_kind</a><span>-></span><ahref="index.html#type-if_kind">if_kind</a><span>-></span> int</code></dt><dtclass="spec value"id="val-equal_if_kind"><ahref="#val-equal_if_kind"class="anchor"></a><code><spanclass="keyword">val</span> equal_if_kind : <ahref="index.html#type-if_kind">if_kind</a><span>-></span><ahref="index.html#type-if_kind">if_kind</a><span>-></span> bool</code></dt></dl></div></div></div><dl><dtclass="spec type"id="type-instr_metadata"><ahref="#type-instr_metadata"class="anchor"></a><code><spanclass="keyword">type</span> instr_metadata</code><code> = </code><tableclass="variant"><trid="type-instr_metadata.Abstract"class="anchored"><tdclass="def constructor"><ahref="#type-instr_metadata.Abstract"class="anchor"></a><code>| </code><code><spanclass="constructor">Abstract</span><spanclass="keyword">of</span><ahref="../IBase/Location/index.html#type-t">IBase.Location.t</a></code></td><tdclass="doc"><p>a good place to apply abstraction, mostly used in the biabduction analysis</p></td></tr><trid="type-instr_metadata.ExitScope"class="anchored"><tdclass="def constructor"><ahref="#type-instr_metadata.ExitScope"class="anchor"></a><code>| </code><code><spanclass="constructor">ExitScope</span><spanclass="keyword">of</span><span><ahref="../IR/Var/index.html#type-t">IR.Var.t</a> list</span> * <ahref="../IBase/Location/index.html#type-t">IBase.Location.t</a></code></td><tdclass="doc"><p>remove temporaries and dead program variables</p></td></tr><trid="type-instr_metadata.Nullify"class="anchored"><tdclass="def constructor"><ahref="#type-instr_metadata.Nullify"class="anchor"></a><code>| </code><code><spanclass="constructor">Nullify</span><spanclass="keyword">of</span><ahref="../IR/Pvar/index.html#type-t">IR.Pvar.t</a> * <ahref="../IBase/Location/index.html#type-t">IBase.Location.t</a></code></td><tdclass="doc"><p>nullify stack variable</p></td></tr><trid="type-instr_metadata.Skip"class="anchored"><tdclass="def constructor"><ahref="#type-instr_metadata.Skip"class="anchor"></a><code>| </code><code><spanclass="constructor">Skip</span></code></td><tdclass="doc"><p>no-op</p></td></tr><trid="type-instr_metadata.VariableLifetimeBegins"class="anchored"><tdclass="def constructor"><ahref="#type-instr_metadata.VariableLifetimeBegins"class="anchor"></a><code>| </code><code><spanclass="constructor">VariableLifetimeBegins</span><spanclass="keyword">of</span><ahref="../IR/Pvar/index.html#type-t">IR.Pvar.t</a> * <ahref="../IR/Typ/index.html#type-t">IR.Typ.t</a> * <ahref="../IBase/Location/index.html#type-t">IBase.Location.t</a></code></td><tdclass="doc"><p>stack variable declared</p></td></tr></table></dt></dl><div><divclass="spec include"><divclass="doc"><dl><dtclass="spec value"id="val-compare_instr_metadata"><ahref="#val-compare_instr_metadata"class="anchor"></a><code><spanclass="keyword">val</span> compare_instr_metadata : <ahref="index.html#type-instr_metadata">instr_metadata</a><span>-></span><ahref="index.html#type-instr_metadata">instr_metadata</a><span>-></span> int</code></dt></dl></div></div></div><dl><dtclass="spec type"id="type-instr"><ahref="#type-instr"class="anchor"></a><code><spanclass="keyword">type</span> instr</code><code> = </code><tableclass="variant"><trid="type-instr.Load"class="anchored"><tdclass="def constructor"><ahref="#type-instr.Load"class="anchor"></a><code>| </code><code><spanclass="constructor">Load</span><spanclass="keyword">of</span></code><code>{</code><tableclass="record"><trid="type-instr.id"class="anchored"><tdclass="def field"><ahref="#type-instr.id"class="anchor"></a><code>id : <ahref="../IR/Ident/index.html#type-t">IR.Ident.t</a>;</code></td></tr><trid="type-instr.e"class="anchored"><tdclass="def field"><ahref="#type-instr.e"class="anchor"></a><code>e : <ahref="../IR/Exp/index.html#type-t">IR.Exp.t</a>;</code></td></tr><trid="type-instr.root_typ"class="anchored"><tdclass="def field"><ahref="#type-instr.root_typ"class="anchor"></a><code>root_typ : <ahref="../IR/Typ/index.html#type-t">IR.Typ.t</a>;</code></td></tr><trid="type-instr.typ"class="anchored"><tdclass="def field"><ahref="#type-instr.typ"class="anchor"></a><code>typ : <ahref="../IR/Typ/index.html#type-t">IR.Typ.t</a>;</code></td></tr><trid="type-instr.loc"class="anchored"><tdclass="def field"><ahref="#type-instr.loc"class="anchor"></a><code>loc : <ahref="../IBase/Location/index.html#type-t">IBase.Location.t</a>;</code></td></tr></table><code>}</code></td><tdclass="doc"><p>Load a value from the heap into an identifier.</p><p><code>id = *exp:typ(root_typ)</code> where</p><ul><li><code>exp</code> is an expression denoting a heap address</li><li><code>typ</code> is typ of <code>exp</code> and <code>id</code></li><li><code>root_typ</code> is the root type of <code>exp</code></li></ul><p>The <code>root_typ</code> is deprecated: it is broken in C/C++. We are removing <code>root_typ</code> in the future, so please use <code>typ</code> instead.</p></td></tr><trid="type-instr.Store"class="anchored"><tdclass="def constructor"><ahref="#type-instr.Store"class="anchor"></a><code>| </code><code><spanclass="constructor">Store</span><spanclass="keyword">of</span></code><code>{</code><tableclass="record"><trid="type-instr.e1"class="anchored"><tdclass="def field"><ahref="#type-instr.e1"class="anchor"></a><code>e1 : <ahref="../IR/Exp/index.html#type-t">IR.Exp.t</a>;</code></td></tr><trid="type-instr.root_typ"class="anchored"><tdclass="def field"><ahref="#type-instr.root_typ"class="anchor"></a><code>root_typ : <ahref="../IR/Typ/index.html#type-t">IR.Typ.t</a>;</code></td></tr><trid="type-instr.typ"class="anchored"><tdclass="def field"><ahref="#type-instr.typ"class="anchor"></a><code>typ : <ahref="../IR/Typ/index.html#type-t">IR.Typ.t</a>;</code></td></tr><trid="type-instr.e2"class="anchored"><tdclass="def field"><ahref="#type-instr.e2"class="anchor"></a><code>e2 : <ahref="../IR/Exp/index.html#type-t">IR.Exp.t</a>;</code></td></tr><trid="type-instr.loc"class="anchored"><tdclass="def field"><ahref="#type-instr.loc"class="anchor"></a><code>loc : <ahref="../IBase/Location/index.html#type-t">IBase.Location.t</a>;</code></td></tr></table><code>}</code></td><tdclass="doc"><p>Store the value of an expression into the heap.</p><p><code>*exp1:typ(root_typ) = exp2</code> where</p><ul><li><code>exp1</code> is an expression denoting a heap address</li><li><code>typ</code> is typ of <code>*exp1</code> and <code>exp2</code></li><li><code>root_typ</code> is the root type of <code>exp1</code></li><li><code>exp2</code> is the expression whose value is stored.</li></ul><p>The <code>root_typ</code> is deprecated: it is broken in C/C++. We are removing <code>root_typ</code> in the future, so please use <code>typ</code> instead.</p></td></tr><trid="type-instr.Prune"class="anchored"><tdclass="def constructor"><ahref="#type-instr.Prune"class="anchor"></a><code>| </code><code><spanclass="constructor">Prune</span><spanclass="keyword">of</span><ahref="../IR/Exp/index.html#type-t">IR.Exp.t</a> * <ahref="../IBase/Location/index.html#type-t">IBase.Location.t</a> * bool * <ahref="index.html#type-if_kind">if_kind</a></code></td><tdclass="doc"><p>prune the state based on <code>exp=1</code>, the boolean indicates whether true branch</p></td></tr><trid="type-instr.Call"class="anchored"><tdclass="def constructor"><ahref="#type-instr.Call"class="anchor"></a><code>| </code><code><spanclass="constructor">Call</span><spanclass="keyword">of</span><ahref="../IR/Ident/index.html#type-t">IR.Ident.t</a> * <ahref="../IR/Typ/index.html#type-t">IR.Typ.t</a> * <ahref="../IR/Exp/index.html#type-t">IR.Exp.t</a> * <span><span>(<ahref="../IR/Exp/index.html#type-t">IR.Exp.t</a> * <ahref="../IR/Typ/index.html#type-t">IR.Typ.t</a>)</span> list</span> * <ahref="../IBase/Location/index.html#type-t">IBase.Location.t</a> * <ahref="../IR/CallFlags/index.html#type-t">IR.CallFlags.t</a></code></td><tdclass="doc"><p><code>Call ((ret_id, ret_typ), e_fun, arg_ts, loc, call_flags)</code> represents an instruction <code>ret_id = e_fun(arg_ts);</code></p></td></tr><trid="type-instr.Metadata"class="anchored"><tdclass="def constructor"><ahref="#type-instr.Metadata"class="anchor"></a><code>| </code><code><spanclass="constructor">Metadata</span><spanclass="keyword">of</span><ahref="index.html#type-instr_metadata">instr_metadata</a></code></td><tdclass="doc"><p>hints about the program that are not strictly needed to understand its semantics, for instance information about its original syntactic structure</p></td></tr></table></dt><dd><p>An instruction.</p></dd></dl><div><divclass="spec include"><divclass="doc"><dl><dtclass="spec value"id="val-compare_instr"><ahref="#val-compare_instr"class="anchor"></a><code><spanclass="keyword">val</span> compare_instr : <ahref="index.html#type-instr">instr</a><span>-></span><ahref="index.html#type-instr">instr</a><span>-></span> int</code></dt></dl></div></div></div><dl><dtclass="spec value"id="val-equal_instr"><ahref="#val-equal_instr"class="anchor"></a><code><spanclass="keyword">val</span> equal_instr : <ahref="index.html#type-instr">instr</a><span>-></span><ahref="index.html#type-instr">instr</a><span>-></span> bool</code></dt><dtclass="spec value"id="val-skip_instr"><ahref="#val-skip_instr"class="anchor"></a><code><spanclass="keyword">val</span> skip_instr : <ahref="index.html#type-instr">instr</a></code></dt><dtclass="spec value"id="val-instr_is_auxiliary"><ahref="#val-instr_is_auxiliary"class="anchor"></a><code><spanclass="keyword">val</span> instr_is_auxiliary : <ahref="index.html#type-instr">instr</a><span>-></span> bool</code></dt><dd><p>Check if an instruction is auxiliary, or if it comes from source instructions.</p></dd></dl><dl><dtclass="spec value"id="val-location_of_instr"><ahref="#val-location_of_instr"class="anchor"></a><code><spanclass="keyword">val</span> location_of_instr : <ahref="index.html#type-instr">instr</a><span>-></span><ahref="../IBase/Location/index.html#type-t">IBase.Location.t</a></code></dt><dd><p>Get the location of the instruction</p></dd></dl><dl><dtclass="spec value"id="val-exps_of_instr"><ahref="#val-exps_of_instr"class="anchor"></a><code><spanclass="keyword">val</span> exps_of_instr : <ahref="index.html#type-instr">instr</a><span>-></span><span><ahref="../IR/Exp/index.html#type-t">IR.Exp.t</a> list</span></code></dt><dd><p>get the expressions occurring in the instruction</p></dd></dl><dl><dtclass="spec value"id="val-if_kind_to_string"><ahref="#val-if_kind_to_string"class="anchor"></a><code><spanclass="keyword">val</span> if_kind_to_string : <ahref="index.html#type-if_kind">if_kind</a><span>-></span> string</code></dt><dd><p>Pretty print an if_kind</p></dd></dl><dl><dtclass="spec value"id="val-pp_instr_metadata"><ahref="#val-pp_instr_metadata"class="anchor"></a><code><spanclass="keyword">val</span> pp_instr_metadata : <ahref="../IStdlib/Pp/index.html#type-env">IStdlib.Pp.env</a><span>-></span><ahref="index.html#module-F">F</a>.formatter <span>-></span><ahref="index.html#type-instr_metadata">instr_metadata</a><span>-></span> unit</code></dt><dtclass="spec value"id="val-pp_instr"><ahref="#val-pp_instr"class="anchor"></a><code><spanclass="keyword">val</span> pp_instr : <span>print_types:bool</span><span>-></span><ahref="../IStdlib/Pp/index.html#type-env">IStdlib.Pp.env</a><span>-></span><ahref="index.html#module-F">F</a>.formatter <span>-></span><ahref="index.html#type-instr">instr</a><span>-></span> unit</code></dt><dd><p>Pretty print an instruction.</p></dd></dl><dl><dtclass="spec value"id="val-d_instr"><ahref="#val-d_instr"class="anchor"></a><code><spanclass="keyword">val</span> d_instr : <ahref="index.html#type-instr">instr</a><span>-></span> unit</code></dt><dd><p>Dump an instruction.</p></dd></dl></section></div></body></html>