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
12 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>HilExp (infer.Absint.HilExp)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.2"/><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">Absint</a> &#x00BB; HilExp</nav><h1>Module <code>Absint.HilExp</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" id="module-Access"><a href="#module-Access" class="anchor"></a><code><span class="keyword">module</span> <a href="Access/index.html">Access</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></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><code> = </code><table class="variant"><tr id="type-t.AccessExpression" class="anchored"><td class="def constructor"><a href="#type-t.AccessExpression" class="anchor"></a><code>| </code><code><span class="constructor">AccessExpression</span> <span class="keyword">of</span> <a href="index.html#type-access_expression">access_expression</a></code></td><td class="doc"><p>access path (e.g., x.f.g or x<code>i</code>)</p></td></tr><tr id="type-t.UnaryOperator" class="anchored"><td class="def constructor"><a href="#type-t.UnaryOperator" class="anchor"></a><code>| </code><code><span class="constructor">UnaryOperator</span> <span class="keyword">of</span> <a href="../../IR/Unop/index.html#type-t">IR.Unop.t</a> * <a href="index.html#type-t">t</a> * <span><a href="../../IR/Typ/index.html#type-t">IR.Typ.t</a> option</span></code></td><td class="doc"><p>Unary operator with type of the result if known</p></td></tr><tr id="type-t.BinaryOperator" class="anchored"><td class="def constructor"><a href="#type-t.BinaryOperator" class="anchor"></a><code>| </code><code><span class="constructor">BinaryOperator</span> <span class="keyword">of</span> <a href="../../IR/Binop/index.html#type-t">IR.Binop.t</a> * <a href="index.html#type-t">t</a> * <a href="index.html#type-t">t</a></code></td><td class="doc"><p>Binary operator</p></td></tr><tr id="type-t.Exception" class="anchored"><td class="def constructor"><a href="#type-t.Exception" class="anchor"></a><code>| </code><code><span class="constructor">Exception</span> <span class="keyword">of</span> <a href="index.html#type-t">t</a></code></td><td class="doc"><p>Exception</p></td></tr><tr id="type-t.Closure" class="anchored"><td class="def constructor"><a href="#type-t.Closure" class="anchor"></a><code>| </code><code><span class="constructor">Closure</span> <span class="keyword">of</span> <a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> * <span><span>(<a href="../AccessPath/index.html#type-base">AccessPath.base</a> * <a href="index.html#type-t">t</a>)</span> list</span></code></td><td class="doc"><p>Name of function + environment</p></td></tr><tr id="type-t.Constant" class="anchored"><td class="def constructor"><a href="#type-t.Constant" class="anchor"></a><code>| </code><code><span class="constructor">Constant</span> <span class="keyword">of</span> <a href="../../IR/Const/index.html#type-t">IR.Const.t</a></code></td><td class="doc"><p>Constants</p></td></tr><tr id="type-t.Cast" class="anchored"><td class="def constructor"><a href="#type-t.Cast" class="anchor"></a><code>| </code><code><span class="constructor">Cast</span> <span class="keyword">of</span> <a href="../../IR/Typ/index.html#type-t">IR.Typ.t</a> * <a href="index.html#type-t">t</a></code></td><td class="doc"><p>Type cast</p></td></tr><tr id="type-t.Sizeof" class="anchored"><td class="def constructor"><a href="#type-t.Sizeof" class="anchor"></a><code>| </code><code><span class="constructor">Sizeof</span> <span class="keyword">of</span> <a href="../../IR/Typ/index.html#type-t">IR.Typ.t</a> * <span><a href="index.html#type-t">t</a> option</span></code></td><td class="doc"><p>C-style sizeof(), and also used to treate a type as an expression. Refer to <code>Exp</code> module for canonical documentation</p></td></tr></table></dt><dt class="spec type" id="type-access_expression"><a href="#type-access_expression" class="anchor"></a><code><span class="keyword">and</span> access_expression</code><code> = <span class="keyword">private</span> </code><table class="variant"><tr id="type-access_expression.Base" class="anchored"><td class="def constructor"><a href="#type-access_expression.Base" class="anchor"></a><code>| </code><code><span class="constructor">Base</span> <span class="keyword">of</span> <a href="../AccessPath/index.html#type-base">AccessPath.base</a></code></td></tr><tr id="type-access_expression.FieldOffset" class="anchored"><td class="def constructor"><a href="#type-access_expression.FieldOffset" class="anchor"></a><code>| </code><code><span class="constructor">FieldOffset</span> <span class="keyword">of</span> <a href="index.html#type-access_expression">access_expression</a> * <a href="../../IR/Fieldname/index.html#type-t">IR.Fieldname.t</a></code></td><td class="doc"><p>field access</p></td></tr><tr id="type-access_expression.ArrayOffset" class="anchored"><td class="def constructor"><a href="#type-access_expression.ArrayOffset" class="anchor"></a><code>| </code><code><span class="constructor">ArrayOffset</span> <span class="keyword">of</span> <a href="index.html#type-access_expression">access_expression</a> * <a href="../../IR/Typ/index.html#type-t">IR.Typ.t</a> * <span><a href="index.html#type-t">t</a> option</span></code></td><td class="doc"><p>array access</p></td></tr><tr id="type-access_expression.AddressOf" class="anchored"><td class="def constructor"><a href="#type-access_expression.AddressOf" class="anchor"></a><code>| </code><code><span class="constructor">AddressOf</span> <span class="keyword">of</span> <a href="index.html#type-access_expression">access_expression</a></code></td><td class="doc"><p>&quot;address of&quot; operator <code>&amp;</code></p></td></tr><tr id="type-access_expression.Dereference" class="anchored"><td class="def constructor"><a href="#type-access_expression.Dereference" class="anchor"></a><code>| </code><code><span class="constructor">Dereference</span> <span class="keyword">of</span> <a href="index.html#type-access_expression">access_expression</a></code></td><td class="doc"><p>&quot;dereference&quot; operator <code>*</code></p></td></tr></table></dt></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-compare"><a href="#val-compare" class="anchor"></a><code><span class="keyword">val</span> compare : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> int</code></dt><dt class="spec value" id="val-compare_access_expression"><a href="#val-compare_access_expression" class="anchor"></a><code><span class="keyword">val</span> compare_access_expression : <a href="index.html#type-access_expression">access_expression</a> <span>&#45;&gt;</span> <a href="index.html#type-access_expression">access_expression</a> <span>&#45;&gt;</span> int</code></dt></dl></div></div></div><div class="spec module" id="module-AccessExpression"><a href="#module-AccessExpression" class="anchor"></a><code><span class="keyword">module</span> <a href="AccessExpression/index.html">AccessExpression</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></div><dl><dt class="spec value" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span class="keyword">val</span> pp : <a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-get_typ"><a href="#val-get_typ" class="anchor"></a><code><span class="keyword">val</span> get_typ : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span><a href="../../IR/Typ/index.html#type-t">IR.Typ.t</a> option</span></code></dt><dd><p>Get the type of the expression. Warning: not fully implemented</p></dd></dl><dl><dt class="spec value" id="val-of_sil"><a href="#val-of_sil" class="anchor"></a><code><span class="keyword">val</span> of_sil : <span>include_array_indexes:bool</span> <span>&#45;&gt;</span> <span>f_resolve_id:<span>(<a href="../../IR/Var/index.html#type-t">IR.Var.t</a> <span>&#45;&gt;</span> <span><a href="AccessExpression/index.html#type-t">AccessExpression.t</a> option</span>)</span></span> <span>&#45;&gt;</span> <span>add_deref:bool</span> <span>&#45;&gt;</span> <a href="../../IR/Exp/index.html#type-t">IR.Exp.t</a> <span>&#45;&gt;</span> <a href="../../IR/Typ/index.html#type-t">IR.Typ.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Convert SIL expression to HIL expression</p></dd></dl><dl><dt class="spec value" id="val-get_access_exprs"><a href="#val-get_access_exprs" class="anchor"></a><code><span class="keyword">val</span> get_access_exprs : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span><a href="AccessExpression/index.html#type-t">AccessExpression.t</a> list</span></code></dt><dd><p>Get all the access paths used in the given HIL expression, including duplicates if a path is used more than once.</p></dd></dl><dl><dt class="spec value" id="val-is_null_literal"><a href="#val-is_null_literal" class="anchor"></a><code><span class="keyword">val</span> is_null_literal : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-is_int_zero"><a href="#val-is_int_zero" class="anchor"></a><code><span class="keyword">val</span> is_int_zero : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-eval"><a href="#val-eval" class="anchor"></a><code><span class="keyword">val</span> eval : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span><a href="../../IR/Const/index.html#type-t">IR.Const.t</a> option</span></code></dt><dt class="spec value" id="val-eval_boolean_exp"><a href="#val-eval_boolean_exp" class="anchor"></a><code><span class="keyword">val</span> eval_boolean_exp : <a href="AccessExpression/index.html#type-t">AccessExpression.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span>bool option</span></code></dt><dd><p><code>eval_boolean_exp var exp</code> returns <code>Some bool_value</code> if the given boolean expression <code>exp</code> evaluates to <code>bool_value</code> when <code>var</code> is set to true. Return None if it has free variables that stop us from evaluating it, or is not a boolean expression.</p></dd></dl><dl><dt class="spec value" id="val-ignore_cast"><a href="#val-ignore_cast" class="anchor"></a><code><span class="keyword">val</span> ignore_cast : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-access_expr_of_exp"><a href="#val-access_expr_of_exp" class="anchor"></a><code><span class="keyword">val</span> access_expr_of_exp : <span>include_array_indexes:bool</span> <span>&#45;&gt;</span> <span>f_resolve_id:<span>(<a href="../../IR/Var/index.html#type-t">IR.Var.t</a> <span>&#45;&gt;</span> <span><a href="AccessExpression/index.html#type-t">AccessExpression.t</a> option</span>)</span></span> <span>&#45;&gt;</span> <a href="../../IR/Exp/index.html#type-t">IR.Exp.t</a> <span>&#45;&gt;</span> <a href="../../IR/Typ/index.html#type-t">IR.Typ.t</a> <span>&#45;&gt;</span> <span><a href="index.html#type-access_expression">access_expression</a> option</span></code></dt><dd><p>best effort translating a SIL expression to an access path, not semantics preserving in particular in the presence of pointer arithmetic</p></dd></dl></div></body></html>