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
11 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>PatternMatch (infer.Absint.PatternMatch)</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">Absint</a> &#x00BB; PatternMatch</nav><h1>Module <code>Absint.PatternMatch</code></h1></header><aside><p>Module for Pattern matching.</p></aside><dl><dt class="spec value" id="val-get_this_type_nonstatic_methods_only"><a href="#val-get_this_type_nonstatic_methods_only" class="anchor"></a><code><span class="keyword">val</span> get_this_type_nonstatic_methods_only : <a href="../../IR/ProcAttributes/index.html#type-t">IR.ProcAttributes.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 `this` type of a procedure. Should not be called on non-static methods, otherwise it can return a wrong type</p></dd></dl><dl><dt class="spec value" id="val-get_type_name"><a href="#val-get_type_name" class="anchor"></a><code><span class="keyword">val</span> get_type_name : <a href="../../IR/Typ/index.html#type-t">IR.Typ.t</a> <span>&#45;&gt;</span> string</code></dt><dd><p>Get the name of a type</p></dd></dl><dl><dt class="spec value" id="val-get_vararg_type_names"><a href="#val-get_vararg_type_names" class="anchor"></a><code><span class="keyword">val</span> get_vararg_type_names : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <a href="../../IR/Procdesc/Node/index.html#type-t">IR.Procdesc.Node.t</a> <span>&#45;&gt;</span> <a href="../../IR/Pvar/index.html#type-t">IR.Pvar.t</a> <span>&#45;&gt;</span> <span>string list</span></code></dt><dd><p>Get the type names of a variable argument</p></dd></dl><dl><dt class="spec value" id="val-is_subtype"><a href="#val-is_subtype" class="anchor"></a><code><span class="keyword">val</span> is_subtype : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <a href="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a> <span>&#45;&gt;</span> <a href="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a> <span>&#45;&gt;</span> bool</code></dt><dd><p>Is the type a transitive subtype of the typename?</p></dd></dl><dl><dt class="spec value" id="val-is_subtype_of_str"><a href="#val-is_subtype_of_str" class="anchor"></a><code><span class="keyword">val</span> is_subtype_of_str : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <a href="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> bool</code></dt><dd><p>Resolve <code>typ_str</code> in <code>tenv</code>, then check <code>typ</code> &lt;: <code>typ_str</code></p></dd></dl><div class="spec module" id="module-Java"><a href="#module-Java" class="anchor"></a><code><span class="keyword">module</span> <a href="Java/index.html">Java</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></div><dl><dt class="spec value" id="val-supertype_exists"><a href="#val-supertype_exists" class="anchor"></a><code><span class="keyword">val</span> supertype_exists : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <span>(<a href="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a> <span>&#45;&gt;</span> <a href="../../IR/Struct/index.html#type-t">IR.Struct.t</a> <span>&#45;&gt;</span> bool)</span> <span>&#45;&gt;</span> <a href="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a> <span>&#45;&gt;</span> bool</code></dt><dd><p>Holds iff the predicate holds on a supertype of the named type, including the type itself</p></dd></dl><dl><dt class="spec value" id="val-supertype_find_map_opt"><a href="#val-supertype_find_map_opt" class="anchor"></a><code><span class="keyword">val</span> supertype_find_map_opt : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <span>(<a href="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a> <span>&#45;&gt;</span> <span><span class="type-var">'a</span> option</span>)</span> <span>&#45;&gt;</span> <a href="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a> <span>&#45;&gt;</span> <span><span class="type-var">'a</span> option</span></code></dt><dd><p>Return the first non-None result found when applying the given function to supertypes of the named type, including the type itself</p></dd></dl><dl><dt class="spec value" id="val-proc_calls"><a href="#val-proc_calls" class="anchor"></a><code><span class="keyword">val</span> proc_calls : <span>(<a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> <span><a href="../../IR/ProcAttributes/index.html#type-t">IR.ProcAttributes.t</a> option</span>)</span> <span>&#45;&gt;</span> <a href="../../IR/Procdesc/index.html#type-t">IR.Procdesc.t</a> <span>&#45;&gt;</span> <span>(<a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> <a href="../../IR/ProcAttributes/index.html#type-t">IR.ProcAttributes.t</a> <span>&#45;&gt;</span> bool)</span> <span>&#45;&gt;</span> <span><span>(<a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> * <a href="../../IR/ProcAttributes/index.html#type-t">IR.ProcAttributes.t</a>)</span> list</span></code></dt><dd><p>Return the callees that satisfy <code>filter</code>.</p></dd></dl><dl><dt class="spec value" id="val-override_exists"><a href="#val-override_exists" class="anchor"></a><code><span class="keyword">val</span> override_exists : <span>?&#8288;check_current_type:bool</span> <span>&#45;&gt;</span> <span>(<a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> bool)</span> <span>&#45;&gt;</span> <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.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>Return true if applying the given predicate to an override of <code>procname</code> (including <code>procname</code> itself when <code>check_current_type</code> is true, which it is by default) returns true.</p></dd></dl><dl><dt class="spec value" id="val-override_iter"><a href="#val-override_iter" class="anchor"></a><code><span class="keyword">val</span> override_iter : <span>(<a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> unit)</span> <span>&#45;&gt;</span> <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.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>Apply the given predicate to procname and each override of <code>procname</code>. For the moment, this only works for Java</p></dd></dl><dl><dt class="spec value" id="val-lookup_attributes"><a href="#val-lookup_attributes" class="anchor"></a><code><span class="keyword">val</span> lookup_attributes : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.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/ProcAttributes/index.html#type-t">IR.ProcAttributes.t</a> option</span></code></dt><dt class="spec value" id="val-lookup_attributes_exn"><a href="#val-lookup_attributes_exn" class="anchor"></a><code><span class="keyword">val</span> lookup_attributes_exn : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> <a href="../../IR/ProcAttributes/index.html#type-t">IR.ProcAttributes.t</a></code></dt><dt class="spec value" id="val-type_name_get_annotation"><a href="#val-type_name_get_annotation" class="anchor"></a><code><span class="keyword">val</span> type_name_get_annotation : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <a href="../../IR/Typ/index.html#type-name">IR.Typ.name</a> <span>&#45;&gt;</span> <span><a href="../../IR/Annot/Item/index.html#type-t">IR.Annot.Item.t</a> option</span></code></dt><dt class="spec value" id="val-type_get_annotation"><a href="#val-type_get_annotation" class="anchor"></a><code><span class="keyword">val</span> type_get_annotation : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.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="../../IR/Annot/Item/index.html#type-t">IR.Annot.Item.t</a> option</span></code></dt><dt class="spec value" id="val-type_get_class_name"><a href="#val-type_get_class_name" class="anchor"></a><code><span class="keyword">val</span> type_get_class_name : <a href="../../IR/Typ/index.html#type-t">IR.Typ.t</a> <span>&#45;&gt;</span> <span><a href="../../IR/Typ/Name/index.html#type-t">IR.Typ.Name.t</a> option</span></code></dt><dd><p>Get the class name of the type</p></dd></dl><dl><dt class="spec value" id="val-type_is_class"><a href="#val-type_is_class" class="anchor"></a><code><span class="keyword">val</span> type_is_class : <a href="../../IR/Typ/index.html#type-t">IR.Typ.t</a> <span>&#45;&gt;</span> bool</code></dt><dd><p>Is the type a class type</p></dd></dl><dl><dt class="spec value" id="val-get_fields_nullified"><a href="#val-get_fields_nullified" class="anchor"></a><code><span class="keyword">val</span> get_fields_nullified : <a href="../../IR/Procdesc/index.html#type-t">IR.Procdesc.t</a> <span>&#45;&gt;</span> <a href="../../IR__Fieldname/index.html#module-Set">IR.Fieldname.Set</a>.t</code></dt><dd><p>return the set of instance fields that are assigned to a null literal in <code>procdesc</code></p></dd></dl><dl><dt class="spec value" id="val-has_same_signature"><a href="#val-has_same_signature" class="anchor"></a><code><span class="keyword">val</span> has_same_signature : <a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> <span><span>(<a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> bool)</span> <a href="../../IStdlib/index.html#module-IStd">IStdlib.IStd</a>.Staged.t</span></code></dt><dd><p>For a given <code>procname</code> checks if the method has the same method name, number, order and types of parameters.)</p></dd></dl><div class="spec module" id="module-ObjectiveC"><a href="#module-ObjectiveC" class="anchor"></a><code><span class="keyword">module</span> <a href="ObjectiveC/index.html">ObjectiveC</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></div><dl><dt class="spec value" id="val-is_entry_point"><a href="#val-is_entry_point" class="anchor"></a><code><span class="keyword">val</span> is_entry_point : <a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> bool</code></dt><dd><p>Does the function name correspond to a known entry point? Currently only matches <code>&quot;main&quot;</code></p></dd></dl></div></body></html>