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.

5 lines
18 KiB

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>InferIR__Errlog (InferIR.InferIR__Errlog)</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__Errlog</span></h1></header><p>Module for error logs.</p><div class="spec type" id="type-node_tag"><a href="#type-node_tag" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>node_tag</code><code></code><code><span class="keyword"> = </span></code><table class="variant"><tr id="type-node_tag.Condition" class="anchored"><td class="def constructor"><a href="#type-node_tag.Condition" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Condition</span><span class="keyword"> of </span>bool</code></td></tr><tr id="type-node_tag.Exception" class="anchored"><td class="def constructor"><a href="#type-node_tag.Exception" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Exception</span><span class="keyword"> of </span><a href="../InferIR/Typ/index.html#type-name">InferIR.Typ.name</a></code></td></tr><tr id="type-node_tag.Procedure_start" class="anchored"><td class="def constructor"><a href="#type-node_tag.Procedure_start" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Procedure_start</span><span class="keyword"> of </span><a href="../InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a></code></td></tr><tr id="type-node_tag.Procedure_end" class="anchored"><td class="def constructor"><a href="#type-node_tag.Procedure_end" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Procedure_end</span><span class="keyword"> of </span><a href="../InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a></code></td></tr></table><code></code></div><div class="doc"></div></div><div class="spec type" id="type-loc_trace_elem"><a href="#type-loc_trace_elem" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>loc_trace_elem</code><code></code><code><span class="keyword"> = </span><span class="keyword">private </span></code><code>{</code><table class="record"><tr id="type-loc_trace_elem.lt_level" class="anchored"><td class="def field"><a href="#type-loc_trace_elem.lt_level" class="anchor"></a><code>lt_level : int;</code></td><td class="doc"><p>(** nesting level of procedure calls *)</p></td></tr><tr id="type-loc_trace_elem.lt_loc" class="anchored"><td class="def field"><a href="#type-loc_trace_elem.lt_loc" class="anchor"></a><code>lt_loc : <a href="../../InferBase/InferBase/Location/index.html#type-t">InferBase.Location.t</a>;</code></td><td class="doc"><p>(** source location at the current step in the trace *)</p></td></tr><tr id="type-loc_trace_elem.lt_description" class="anchored"><td class="def field"><a href="#type-loc_trace_elem.lt_description" class="anchor"></a><code>lt_description : string;</code></td><td class="doc"><p>(** description of the current step in the trace *)</p></td></tr><tr id="type-loc_trace_elem.lt_node_tags" class="anchored"><td class="def field"><a href="#type-loc_trace_elem.lt_node_tags" class="anchor"></a><code>lt_node_tags : <a href="index.html#type-node_tag">node_tag</a> list;</code></td><td class="doc"><p>(** tags describing the node at the current location *)</p></td></tr></table><code>}</code><code></code></div><div class="doc"><p>Element of a loc trace</p></div></div><div class="spec val" id="val-make_trace_element"><a href="#val-make_trace_element" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>make_trace_element : int <span class="keyword">&#8209;&gt;</span> <a href="../../InferBase/InferBase/Location/index.html#type-t">InferBase.Location.t</a> <span class="keyword">&#8209;&gt;</span> string <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-node_tag">node_tag</a> list <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-loc_trace_elem">loc_trace_elem</a></code></div><div class="doc"><p>build a loc_trace_elem from its constituents (unambiguously identified by their types).</p></div></div><div class="spec type" id="type-loc_trace"><a href="#type-loc_trace" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>loc_trace</code><code><span class="keyword"> = </span><a href="index.html#type-loc_trace_elem">loc_trace_elem</a> list</code><code></code></div><div class="doc"><p>Trace of locations</p></div></div><div class="spec val" id="val-compute_local_exception_line"><a href="#val-compute_local_exception_line" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>compute_local_exception_line : <a href="index.html#type-loc_trace">loc_trace</a> <span class="keyword">&#8209;&gt;</span> int option</code></div><div class="doc"><p>Look at all the trace steps and find those that are arising any exception,
then bind them to the closest step at level 0.
This extra information adds value to the report itself, and may avoid
digging into the trace to understand the cause of the report.</p></div></div><div class="spec type" id="type-node_id_key"><a href="#type-node_id_key" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>node_id_key</code><code></code><code><span class="keyword"> = </span><span class="keyword">private </span></code><code>{</code><table class="record"><tr id="type-node_id_key.node_id" class="anchored"><td class="def field"><a href="#type-node_id_key.node_id" class="anchor"></a><code>node_id : int;</code></td></tr><tr id="type-node_id_key.node_key" class="anchored"><td class="def field"><a href="#type-node_id_key.node_key" class="anchor"></a><code>node_key : <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Caml.Digest.t;</code></td></tr></table><code>}</code><code></code></div><div class="doc"></div></div><div class="spec type" id="type-err_key"><a href="#type-err_key" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>err_key</code><code></code><code><span class="keyword"> = </span><span class="keyword">private </span></code><code>{</code><table class="record"><tr id="type-err_key.err_kind" class="anchored"><td class="def field"><a href="#type-err_key.err_kind" class="anchor"></a><code>err_kind : <a href="../InferIR/Exceptions/index.html#type-err_kind">InferIR.Exceptions.err_kind</a>;</code></td></tr><tr id="type-err_key.in_footprint" class="anchored"><td class="def field"><a href="#type-err_key.in_footprint" class="anchor"></a><code>in_footprint : bool;</code></td></tr><tr id="type-err_key.err_name" class="anchored"><td class="def field"><a href="#type-err_key.err_name" class="anchor"></a><code>err_name : <a href="../../InferBase/InferBase/IssueType/index.html#type-t">InferBase.IssueType.t</a>;</code></td></tr><tr id="type-err_key.err_desc" class="anchored"><td class="def field"><a href="#type-err_key.err_desc" class="anchor"></a><code>err_desc : <a href="../InferIR/Localise/index.html#type-error_desc">InferIR.Localise.error_desc</a>;</code></td></tr><tr id="type-err_key.severity" class="anchored"><td class="def field"><a href="#type-err_key.severity" class="anchor"></a><code>severity : string;</code></td></tr></table><code>}</code><code></code></div><div class="doc"></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_err_key"><a href="#val-compare_err_key" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>compare_err_key : <a href="index.html#type-err_key">err_key</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-err_key">err_key</a> <span class="keyword">&#8209;&gt;</span> int</code></div><div class="doc"></div></div></details></div><div class="spec type" id="type-err_data"><a href="#type-err_data" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>err_data</code><code></code><code><span class="keyword"> = </span><span class="keyword">private </span></code><code>{</code><table class="record"><tr id="type-err_data.node_id_key" class="anchored"><td class="def field"><a href="#type-err_data.node_id_key" class="anchor"></a><code>node_id_key : <a href="index.html#type-node_id_key">node_id_key</a>;</code></td></tr><tr id="type-err_data.session" class="anchored"><td class="def field"><a href="#type-err_data.session" class="anchor"></a><code>session : int;</code></td></tr><tr id="type-err_data.loc" class="anchored"><td class="def field"><a href="#type-err_data.loc" class="anchor"></a><code>loc : <a href="../../InferBase/InferBase/Location/index.html#type-t">InferBase.Location.t</a>;</code></td></tr><tr id="type-err_data.loc_in_ml_source" class="anchored"><td class="def field"><a href="#type-err_data.loc_in_ml_source" class="anchor"></a><code>loc_in_ml_source : <a href="../../InferBase/InferBase/Logging/index.html#type-ocaml_pos">InferBase.Logging.ocaml_pos</a> option;</code></td></tr><tr id="type-err_data.loc_trace" class="anchored"><td class="def field"><a href="#type-err_data.loc_trace" class="anchor"></a><code>loc_trace : <a href="index.html#type-loc_trace">loc_trace</a>;</code></td></tr><tr id="type-err_data.err_class" class="anchored"><td class="def field"><a href="#type-err_data.err_class" class="anchor"></a><code>err_class : <a href="../InferIR/Exceptions/index.html#type-err_class">InferIR.Exceptions.err_class</a>;</code></td></tr><tr id="type-err_data.visibility" class="anchored"><td class="def field"><a href="#type-err_data.visibility" class="anchor"></a><code>visibility : <a href="../InferIR/Exceptions/index.html#type-visibility">InferIR.Exceptions.visibility</a>;</code></td></tr><tr id="type-err_data.linters_def_file" class="anchored"><td class="def field"><a href="#type-err_data.linters_def_file" class="anchor"></a><code>linters_def_file : string option;</code></td></tr><tr id="type-err_data.doc_url" class="anchored"><td class="def field"><a href="#type-err_data.doc_url" class="anchor"></a><code>doc_url : string option;</code></td><td class="doc"><p>(** url to documentation of the issue type *)</p></td></tr><tr id="type-err_data.access" class="anchored"><td class="def field"><a href="#type-err_data.access" class="anchor"></a><code>access : string option;</code></td></tr></table><code>}</code><code></code></div><div class="doc"><p>Data associated to a specific error</p></div></div><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>Type of the error log</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"></div></div><div class="spec val" id="val-empty"><a href="#val-empty" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>empty : unit <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a></code></div><div class="doc"><p>Empty error log</p></div></div><div class="spec type" id="type-iter_fun"><a href="#type-iter_fun" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>iter_fun</code><code><span class="keyword"> = </span><a href="index.html#type-err_key">err_key</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-err_data">err_data</a> <span class="keyword">&#8209;&gt;</span> unit</code><code></code></div><div class="doc"><p>type of the function to be passed to iter</p></div></div><div class="spec val" id="val-iter"><a href="#val-iter" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>iter : <a href="index.html#type-iter_fun">iter_fun</a> <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>Apply f to nodes and error names</p></div></div><div class="spec val" id="val-fold"><a href="#val-fold" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>fold : (<a href="index.html#type-err_key">err_key</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-err_data">err_data</a> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span>) <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span></code></div><div class="doc"></div></div><div class="spec val" id="val-pp_loc_trace_elem"><a href="#val-pp_loc_trace_elem" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pp_loc_trace_elem : Format.formatter <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-loc_trace_elem">loc_trace_elem</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"></div></div><div class="spec val" id="val-pp_loc_trace"><a href="#val-pp_loc_trace" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pp_loc_trace : Format.formatter <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-loc_trace">loc_trace</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"></div></div><div class="spec val" id="val-pp_errors"><a href="#val-pp_errors" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pp_errors : 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>Print errors from error log</p></div></div><div class="spec val" id="val-pp_warnings"><a href="#val-pp_warnings" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pp_warnings : 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>Print warnings from error log</p></div></div><div class="spec val" id="val-pp_html"><a href="#val-pp_html" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pp_html : <a href="../../InferBase/InferBase/SourceFile/index.html#type-t">InferBase.SourceFile.t</a> <span class="keyword">&#8209;&gt;</span> <a href="../../InferBase/InferBase/DB/Results_dir/index.html#type-path">InferBase.DB.Results_dir.path</a> <span class="keyword">&#8209;&gt;</span> 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>Print an error log in html format</p></div></div><div class="spec val" id="val-size"><a href="#val-size" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>size : (<a href="../InferIR/Exceptions/index.html#type-err_kind">InferIR.Exceptions.err_kind</a> <span class="keyword">&#8209;&gt;</span> bool <span class="keyword">&#8209;&gt;</span> bool) <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"><p>Return the number of elements in the error log which satisfy the filter.</p></div></div><div class="spec val" id="val-update"><a href="#val-update" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>update : <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> unit</code></div><div class="doc"><p>Update an old error log with a new one</p></div></div><div class="spec val" id="val-log_issue"><a href="#val-log_issue" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>log_issue : <a href="../InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">&#8209;&gt;</span> ?&#8288;clang_method_kind:string <span class="keyword">&#8209;&gt;</span> <a href="../InferIR/Exceptions/index.html#type-err_kind">InferIR.Exceptions.err_kind</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> <a href="../../InferBase/InferBase/Location/index.html#type-t">InferBase.Location.t</a> <span class="keyword">&#8209;&gt;</span> (int<span class="keyword"> * </span><a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Caml.Digest.t) <span class="keyword">&#8209;&gt;</span> int <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-loc_trace">loc_trace</a> <span class="keyword">&#8209;&gt;</span> ?&#8288;linters_def_file:string <span class="keyword">&#8209;&gt;</span> ?&#8288;doc_url:string <span class="keyword">&#8209;&gt;</span> ?&#8288;access:string <span class="keyword">&#8209;&gt;</span> exn <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"></div></div></body></html>