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>InferIR__AccessPath (InferIR.InferIR__AccessPath)</title><linkrel="stylesheet"href="../../odoc.css"/><metacharset="utf-8"/><metaname="generator"content="odoc %%VERSION%%"/><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">InferIR</a>» InferIR__AccessPath</nav><h1>Module <code>InferIR__AccessPath</code></h1><p>Module for naming heap locations via the path used to access them (e.g., x.f.g, y<code>a</code>.b)</p></header><dl><dtclass="spec type"id="type-base"><ahref="#type-base"class="anchor"></a><code><spanclass="keyword">type</span> base</code><code> = <ahref="../InferIR/Var/index.html#type-t">InferIR.Var.t</a> * <ahref="../InferIR/Typ/index.html#type-t">InferIR.Typ.t</a></code></dt></dl><div><divclass="spec include"><divclass="doc"><dl><dtclass="spec value"id="val-compare_base"><ahref="#val-compare_base"class="anchor"></a><code><spanclass="keyword">val</span> compare_base : <ahref="index.html#type-base">base</a><span>-></span><ahref="index.html#type-base">base</a><span>-></span> int</code></dt></dl></div></div></div><dl><dtclass="spec type"id="type-access"><ahref="#type-access"class="anchor"></a><code><spanclass="keyword">type</span> access</code><code> = </code><tableclass="variant"><trid="type-access.ArrayAccess"class="anchored"><tdclass="def constructor"><ahref="#type-access.ArrayAccess"class="anchor"></a><code>| </code><code><spanclass="constructor">ArrayAccess</span><spanclass="keyword">of</span><ahref="../InferIR/Typ/index.html#type-t">InferIR.Typ.t</a> * <span><ahref="index.html#type-t">t</a> list</span></code></td><tdclass="doc"><p>array element type with list of access paths in index</p></td></tr><trid="type-access.FieldAccess"class="anchored"><tdclass="def constructor"><ahref="#type-access.FieldAccess"class="anchor"></a><code>| </code><code><spanclass="constructor">FieldAccess</span><spanclass="keyword">of</span><ahref="../InferIR/Typ/Fieldname/index.html#type-t">InferIR.Typ.Fieldname.t</a></code></td><tdclass="doc"><p>field name</p></td></tr></table></dt><dtclass="spec type"id="type-t"><ahref="#type-t"class="anchor"></a><code><spanclass="keyword">and</span> t</code><code> = <ahref="index.html#type-base">base</a> * <span><ahref="index.html#type-access">access</a> list</span></code></dt><dd><p>root var, and a list of accesses. closest to the root var is first that is, x.f.g is representedas (x, <code>f; g</code>)</p></dd></dl><div><divclass="spec include"><divclass="doc"><dl><dtclass="spec value"id="val-compare_access"><ahref="#val-compare_access"class="anchor"></a><code><spanclass="keyword">val</span> compare_access : <ahref="index.html#type-access">access</a><span>-></span><ahref="index.html#type-access">access</a><span>-></span> int</code></dt><dtclass="spec value"id="val-compare"><ahref="#val-compare"class="anchor"></a><code><spanclass="keyword">val</span> compare : <ahref="index.html#type-t">t</a><span>-></span><ahref="index.html#type-t">t</a><span>-></span> int</code></dt><dtclass="spec value"id="val-compare_access"><ahref="#val-compare_access"class="anchor"></a><code><spanclass="keyword">val</span> compare_access : <ahref="index.html#type-access">access</a><span>-></span><ahref="index.html#type-access">access</a><span>-></span> int</code></dt><dtclass="spec value"id="val-compare"><ahref="#val-compare"class="anchor"></a><code><spanclass="keyword">val</span> compare : <ahref="index.html#type-t">t</a><span>-></span><ahref="index.html#type-t">t</a><span>-></span> int</code></dt></dl></div></div></div><dl><dtclass="spec value"id="val-truncate"><ahref="#val-truncate"class="anchor"></a><code><spanclass="keyword">val</span> truncate : <ahref="index.html#type-t">t</a><span>-></span><ahref="index.html#type-t">t</a> * <span><ahref="index.html#type-access">access</a> option</span></code></dt><dd><p>remove and return the last access of the access path if the access list is non-empty. returns the original access path * None if the access list is empty</p></dd></dl><dl><dtclass="spec value"id="val-get_last_access"><ahref="#val-get_last_access"class="anchor"></a><code><spanclass="keyword">val</span> get_last_access : <ahref="index.html#type-t">t</a><span>-></span><span><ahref="index.html#type-access">access</a> option</span></code></dt><dd><p>get the last access in the list. returns None if the list is empty</p></dd></dl><dl><dtclass="spec value"id="val-get_field_and_annotation"><ahref="#val-get_field_and_annotation"class="anchor"></a><code><spanclass="keyword">val</span> get_field_and_annotation : <ahref="index.html#type-t">t</a><span>-></span><ahref="../InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a><span>-></span><span><span>(<ahref="../InferIR/Typ/Fieldname/index.html#type-t">InferIR.Typ.Fieldname.t</a> * <ahref="../InferIR/Annot/Item/index.html#type-t">InferIR.Annot.Item.t</a>)</span> option</span></code></dt><dd><p>get the field name and the annotation of the last access in the list of accesses if the list is non-empty and the last access is a field access</p></dd></dl><dl><dtclass="spec value"id="val-get_typ"><ahref="#val-get_typ"class="anchor"></a><code><spanclass="keyword">val</span> get_typ : <ahref="index.html#type-t">t</a><span>-></span><ahref="../InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a><span>-></span><span><ahref="../InferIR/Typ/index.html#type-t">InferIR.Typ.t</a> option</span></code></dt><dd><p>get the typ of the last access in the list of accesses if the list is non-empty, or the base if the list is empty. that is, for x.f.g, return typ(g), and for x, return typ(x)</p></dd></dl><dl><dtclass="spec value"id="val-base_of_pvar"><ahref="#val-base_of_pvar"class="anchor"></a><code><spanclass="keyword">val</span> base_of_pvar : <ahref="../InferIR/Pvar/index.html#type-t">InferIR.Pvar.t</a><span>-></span><ahref="../InferIR/Typ/index.html#type-t">InferIR.Typ.t</a><span>-></span><ahref="index.html#type-base">base</a></code></dt><dd><p>create a base from a pvar</p></dd></dl><dl><dtclass="spec value"id="val-of_pvar"><ahref="#val-of_pvar"class="anchor"></a><code><spanclass="keyword">val</span> of_pvar : <ahref="../InferIR/Pvar/index.html#type-t">InferIR.Pvar.t</a><span>-></span><ahref="../InferIR/Typ/index.html#type-t">InferIR.Typ.t</a><span>-></span><ahref="index.html#type-t">t</a></code></dt><dd><p>create an access path from a pvar</p></dd></dl><dl><dtclass="spec value"id="val-of_id"><ahref="#val-of_id"class="anchor"></a><code><spanclass="keyword">val</span> of_id : <ahref="../InferIR/Ident/index.html#type-t">InferIR.Ident.t</a><span>-></span><ahref="../InferIR/Typ/index.html#type-t">InferIR.Typ.t</a><span>-></span><ahref="index.html#type-t">t</a></code></dt><dd><p>create an access path from an ident</p></dd></dl><dl><dtclass="spec value"id="val-of_exp"><ahref="#val-of_exp"class="anchor"></a><code><spanclass="keyword">val</span> of_exp : <span>include_array_indexes:bool</span><span>-></span><ahref="../InferIR/Exp/index.html#type-t">InferIR.Exp.t</a><span>-></span><ahref="../InferIR/Typ/index.html#type-t">InferIR.Typ.t</a><span>-></span><span>f_resolve_id:<span>(<ahref="../InferIR/Var/index.html#type-t">InferIR.Var.t</a><span>-></span><span><ahref="index.html#type-t">t</a> option</span>)</span></span><span>-></span><span><ahref="index.html#type-t">t</a> list</span></code></dt><dd><p>extract the access paths that occur in <code>exp</code>, resolving identifiers using <code>f_resolve_id</code>. don't include index expressions in array accesses if <code>include_array_indexes</code> is false</p></dd></dl><dl><dtclass="spec value"id="val-of_lhs_exp"><ahref="#val-of_lhs_exp"class="anchor"></a><code><spanclass="keyword">val</span> of_lhs_exp : <span>include_array_indexes:bool</span><span>-></span><ahref="../InferIR/Exp/index.html#type-t">InferIR.Exp.t</a><span>-></span><ahref="../InferIR/Typ/index.html#type-t">InferIR.Typ.t</a><span>-></span><span>f_resolve_id:<span>(<ahref="../InferIR/Var/index.html#type-t">InferIR.Var.t</a><span>-></span><span><ahref="index.html#type-t">t</a> option</span>)</span></span><span>-></span><span><ahref="index.html#type-t">t</a> option</span></code></dt><dd><p>convert <code>lhs_exp</code> to an access path, resolving identifiers using <code>f_resolve_id</code></p></dd></dl><dl><dtclass="spec value"id="val-append"><ahref="#val-append"class="anchor"></a><code><spanclass="keyword">val</span> append : <ahref="index.html#type-t">t</a><span>-></span><span><ahref="index.html#type-access">access</a> list</span><span>-></span><ahref="index.html#type-t">t</a></code></dt><dd><p>append new accesses to an existing access path; e.g., `append_access x.f <code>g, h</code>` produces `x.f.g.h`</p></dd></dl><dl><dtclass="spec value"id="val-is_prefix"><ahref="#val-is_prefix"class="anchor"></a><code><spanclass="keyword">val</span> is_prefix : <ahref="index.html#type-t">t</a><span>-></span><ahref="index.html#type-t">t</a><span>-></span> bool</code></dt><dd><p>return true if <code>ap1</code> is a prefix of <code>ap2</code>. returns true for equal access paths</p></dd></dl><dl><dtclass="spec value"id="val-replace_prefix"><ahref="#val-replace_prefix"class="anchor"></a><code><spanclass="keyword">val</span> replace_prefix : <span>prefix:<ahref="index.html#type-t">t</a></span><span>-></span><ahref="index.html#type-t">t</a><span>-></span><ahref="index.html#type-t">t</a><span>-></span><span><ahref="index.html#type-t">t</a> option</span></code></dt><dtclass="spec value"id="val-inner_class_normalize"><ahref="#val-inner_class_normalize"class="anchor"></a><code><spanclass="keyword">val</span> inner_class_normalize : <ahref="index.html#type-t">t</a><span>-></span><ahref="index.html#type-t">t</a></code></dt><dd><p>transform an access path that starts on "this" of an inner class but which breaks out to access outer class fields to the outermost one. Cases handled (recursively):</p><ul><li>(this:InnerClass* ).(this$n:OuterClassAccessor).f. ... -> (this:OuterClass* ).f . ...</li><li>this$n.(this$m:OuterClassAccessor).f ... -> (this$m:OuterClass* ).f . ... (happens in ctrs only)</li><li>this$n.f ... -> this.f . ... (happens in ctrs only)</li></ul></dd></dl><dl><dtclass="spec value"id="val-equal"><ahref="#val-equal"class="anchor"></a><code><spanclass="keyword">val</span> equal : <ahref="index.html#type-t">t</a><span>-></span><ahref="index.html#type-t">t</a><span>-></span> bool</code></dt><dtclass="spec value"id="val-equal_base"><ahref="#val-equal_base"class="anchor"></a><code><spanclass="keyword">val</span> equal_base : <ahref="index.html#type-base">base</a><span>-></span><ahref="index.html#type-base">base</a><span>-></span> bool</code></dt><dtclass="spec value"id="val-pp"><ahref="#val-pp"class="anchor"></a><code><spanclass="keyword">val</span> pp : Stdlib.Format.formatter <span>-></span><ahref="index.html#type-t">t</a><span>-></span> unit</code></dt><dtclass="spec value"id="val-pp_base"><ahref="#val-pp_base"class="anchor"></a><code><spanclass="keyword">val</span> pp_base : Stdlib.Format.formatter <span>-></span><ahref="index.html#type-base">base</a><span>-></span> unit</code></dt><dtclass="spec value"id="val-pp_access"><ahref="#val-pp_access"class="anchor"></a><code><spanclass="keyword">val</span> pp_access : Stdlib.Format.formatter <span>-></span><ahref="index.html#type-access">access</a><span>-></span> unit</code></dt><dtclass="spec value"id="val-pp_access_list"><ahref="#val-pp_access_list"class="anchor"></a><code><spanclass="keyword">val</span> pp_access_list : Stdlib.Format.formatter <span>-></span><span><ahref="index.html#type-access">access</a> list</span><span>-></span> unit</code></dt></dl><divclass="spec module"id="module-Abs"><ahref="#module-Abs"class="anchor"></a><code><spanclass="keyword">module</span><ahref="Abs/index.html">Abs</a> : <spanclass="keyword">sig</span> ... <spanclass="keyword">end</span></code></div><divclass="spec module"id="module-BaseMap"><ahref="#module-BaseMap"class="anchor"></a><code><spanclass="keyword">module</span> BaseMap : <ahref="../../InferStdlib/InferStdlib/PrettyPrintable/index.html#module-type-PPMap">InferStdlib.PrettyPrintable.PPMap</a><spanclass="keyword">with</span><spanclass="keyword">type</span><ahref="../../InferStdlib/InferStdlib/PrettyPrintable/index.html#module-type-PPMap">PPMap</a>.key = <ahref="index.html#type-base">base</a></code></div></div></body></html>