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
17 KiB

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>InferIR__Ident (InferIR.InferIR__Ident)</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__Ident</span></h1></header><p>Identifiers: program variables and logical variables</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>Program and logical variables.</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-equal"><a href="#val-equal" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>equal : <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> bool</code></div><div class="doc"><p>Equality for identifiers.</p></div></div><div class="spec type" id="type-name"><a href="#type-name" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>name</code><code></code><code></code></div><div class="doc"><p>Names used to replace strings.</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_name"><a href="#val-compare_name" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>compare_name : <a href="index.html#type-name">name</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-name">name</a> <span class="keyword">&#8209;&gt;</span> int</code></div><div class="doc"></div></div></details></div><div class="spec val" id="val-equal_name"><a href="#val-equal_name" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>equal_name : <a href="index.html#type-name">name</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-name">name</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>Equality for names.</p></div></div><div class="spec type" id="type-kind"><a href="#type-kind" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>kind</code><code></code><code></code></div><div class="doc"><p>Kind of identifiers.</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_kind"><a href="#val-compare_kind" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>compare_kind : <a href="index.html#type-kind">kind</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-kind">kind</a> <span class="keyword">&#8209;&gt;</span> int</code></div><div class="doc"></div></div></details></div><div class="spec val" id="val-equal_kind"><a href="#val-equal_kind" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>equal_kind : <a href="index.html#type-kind">kind</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-kind">kind</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>Equality for kind.</p></div></div><div class="spec module" id="module-Set"><a href="#module-Set" class="anchor"></a><div class="def module"><code><span class="keyword">module </span>Set : <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-Set">Set</a>.elt<span class="keyword"> = </span><a href="index.html#type-t">t</a></code></div><div class="doc"><p>Set for identifiers.</p></div></div><div class="spec module" id="module-Hash"><a href="#module-Hash" class="anchor"></a><div class="def module"><code><span class="keyword">module </span>Hash : <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-Hash">Hash</a>.key<span class="keyword"> = </span><a href="index.html#type-t">t</a></code></div><div class="doc"><p>Hash table with ident as key.</p></div></div><div class="spec module" id="module-Map"><a href="#module-Map" class="anchor"></a><div class="def module"><code><span class="keyword">module </span>Map : <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-Map">Map</a>.key<span class="keyword"> = </span><a href="index.html#type-t">t</a></code></div><div class="doc"><p>Map with ident as key.</p></div></div><div class="spec module" id="module-HashQueue"><a href="#module-HashQueue" class="anchor"></a><div class="def module"><code><span class="keyword">module </span>HashQueue : <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Hash_queue.S<span class="keyword"> with </span><span class="keyword">type </span><a href="index.html#module-HashQueue">HashQueue</a>.Key.t<span class="keyword"> = </span><a href="index.html#type-t">t</a></code></div><div class="doc"></div></div><div class="spec module" id="module-NameGenerator"><a href="#module-NameGenerator" class="anchor"></a><div class="def module"><code><span class="keyword">module </span><a href="NameGenerator/index.html">NameGenerator</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></div><div class="doc"></div></div><div class="spec val" id="val-idlist_to_idset"><a href="#val-idlist_to_idset" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>idlist_to_idset : <a href="index.html#type-t">t</a> list <span class="keyword">&#8209;&gt;</span> <a href="index.html#module-Set">Set</a>.t</code></div><div class="doc"><p>Convert an identifier list to an identifier set</p></div></div><div class="spec val" id="val-kprimed"><a href="#val-kprimed" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>kprimed : <a href="index.html#type-kind">kind</a></code></div><div class="doc"></div></div><div class="spec val" id="val-knormal"><a href="#val-knormal" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>knormal : <a href="index.html#type-kind">kind</a></code></div><div class="doc"></div></div><div class="spec val" id="val-kfootprint"><a href="#val-kfootprint" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>kfootprint : <a href="index.html#type-kind">kind</a></code></div><div class="doc"></div></div><div class="spec val" id="val-name_spec"><a href="#val-name_spec" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>name_spec : <a href="index.html#type-name">name</a></code></div><div class="doc"><p>Name used for spec variables</p></div></div><div class="spec val" id="val-name_return"><a href="#val-name_return" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>name_return : <a href="../InferIR/Mangled/index.html#type-t">InferIR.Mangled.t</a></code></div><div class="doc"><p>Name used for the return variable</p></div></div><div class="spec val" id="val-string_to_name"><a href="#val-string_to_name" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>string_to_name : string <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-name">name</a></code></div><div class="doc"><p>Convert a string to a name.</p></div></div><div class="spec val" id="val-name_to_string"><a href="#val-name_to_string" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>name_to_string : <a href="index.html#type-name">name</a> <span class="keyword">&#8209;&gt;</span> string</code></div><div class="doc"><p>Convert a name to a string.</p></div></div><div class="spec val" id="val-get_name"><a href="#val-get_name" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_name : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-name">name</a></code></div><div class="doc"><p>Name of the identifier.</p></div></div><div class="spec val" id="val-create"><a href="#val-create" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>create : <a href="index.html#type-kind">kind</a> <span class="keyword">&#8209;&gt;</span> int <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a></code></div><div class="doc"><p>Create an identifier with default name for the given kind</p></div></div><div class="spec val" id="val-create_normal"><a href="#val-create_normal" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>create_normal : <a href="index.html#type-name">name</a> <span class="keyword">&#8209;&gt;</span> int <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a></code></div><div class="doc"><p>Generate a normal identifier with the given name and stamp.</p></div></div><div class="spec val" id="val-create_none"><a href="#val-create_none" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>create_none : unit <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a></code></div><div class="doc"><p>Create a &quot;null&quot; identifier for situations where the IR requires an id that will never be read</p></div></div><div class="spec val" id="val-create_footprint"><a href="#val-create_footprint" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>create_footprint : <a href="index.html#type-name">name</a> <span class="keyword">&#8209;&gt;</span> int <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a></code></div><div class="doc"><p>Generate a footprint identifier with the given name and stamp.</p></div></div><div class="spec val" id="val-update_name_generator"><a href="#val-update_name_generator" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>update_name_generator : <a href="index.html#type-t">t</a> list <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Update the name generator so that the given id's are not generated again</p></div></div><div class="spec val" id="val-create_fresh"><a href="#val-create_fresh" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>create_fresh : <a href="index.html#type-kind">kind</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a></code></div><div class="doc"><p>Create a fresh identifier with default name for the given kind.</p></div></div><div class="spec val" id="val-create_path"><a href="#val-create_path" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>create_path : string <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a></code></div><div class="doc"><p>Generate a normal identifier whose name encodes a path given as a string.</p></div></div><div class="spec val" id="val-is_primed"><a href="#val-is_primed" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_primed : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>Check whether an identifier is primed or not.</p></div></div><div class="spec val" id="val-is_normal"><a href="#val-is_normal" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_normal : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>Check whether an identifier is normal or not.</p></div></div><div class="spec val" id="val-is_footprint"><a href="#val-is_footprint" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_footprint : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>Check whether an identifier is footprint or not.</p></div></div><div class="spec val" id="val-is_path"><a href="#val-is_path" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_path : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>Check whether an identifier represents a path or not.</p></div></div><div class="spec val" id="val-is_none"><a href="#val-is_none" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_none : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>Check whether an identifier is the special &quot;none&quot; identifier</p></div></div><div class="spec val" id="val-get_stamp"><a href="#val-get_stamp" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_stamp : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> int</code></div><div class="doc"><p>Get the stamp of the identifier</p></div></div><div class="spec val" id="val-set_stamp"><a href="#val-set_stamp" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>set_stamp : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> int <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a></code></div><div class="doc"><p>Set the stamp of the identifier</p></div></div><h3>Pretty Printing</h3><div class="spec val" id="val-pp_name"><a href="#val-pp_name" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pp_name : Format.formatter <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-name">name</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Pretty print a name.</p></div></div><div class="spec val" id="val-pp"><a href="#val-pp" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pp : 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"><p>Pretty print an identifier.</p></div></div><div class="spec val" id="val-to_string"><a href="#val-to_string" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>to_string : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> string</code></div><div class="doc"><p>Convert an identifier to a string.</p></div></div><div class="spec val" id="val-pp_list"><a href="#val-pp_list" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pp_list : Format.formatter <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a> list <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Pretty print a list of identifiers.</p></div></div><div class="spec val" id="val-hashqueue_of_sequence"><a href="#val-hashqueue_of_sequence" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>hashqueue_of_sequence : ?&#8288;init:unit <a href="index.html#module-HashQueue">HashQueue</a>.t <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a> <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Sequence.t <span class="keyword">&#8209;&gt;</span> unit <a href="index.html#module-HashQueue">HashQueue</a>.t</code></div><div class="doc"></div></div><div class="spec val" id="val-set_of_sequence"><a href="#val-set_of_sequence" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>set_of_sequence : ?&#8288;init:<a href="index.html#module-Set">Set</a>.t <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a> <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Sequence.t <span class="keyword">&#8209;&gt;</span> <a href="index.html#module-Set">Set</a>.t</code></div><div class="doc"></div></div></body></html>