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
5.9 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>Callbacks (infer.Backend.Callbacks)</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">Backend</a> &#x00BB; Callbacks</nav><h1>Module <code>Backend.Callbacks</code></h1></header><aside><p>Module to register and invoke checkers' callbacks.</p></aside><dl><dt class="spec type" id="type-proc_callback_args"><a href="#type-proc_callback_args" class="anchor"></a><code><span class="keyword">type</span> proc_callback_args</code><code> = </code><code>{</code><table class="record"><tr id="type-proc_callback_args.summary" class="anchored"><td class="def field"><a href="#type-proc_callback_args.summary" class="anchor"></a><code>summary : <a href="../Summary/index.html#type-t">Summary.t</a>;</code></td></tr><tr id="type-proc_callback_args.exe_env" class="anchored"><td class="def field"><a href="#type-proc_callback_args.exe_env" class="anchor"></a><code>exe_env : <a href="../../Absint/Exe_env/index.html#type-t">Absint.Exe_env.t</a>;</code></td></tr></table><code>}</code></dt><dd><p>Type of a procedure callback:</p><ul><li>List of all the procedures the callback will be called on.</li><li>get_proc_desc to get a proc desc from a proc name</li><li>Type environment.</li><li>Procedure for the callback to act on.</li></ul></dd></dl><dl><dt class="spec type" id="type-proc_callback_t"><a href="#type-proc_callback_t" class="anchor"></a><code><span class="keyword">type</span> proc_callback_t</code><code> = <a href="index.html#type-proc_callback_args">proc_callback_args</a> <span>&#45;&gt;</span> <a href="../Summary/index.html#type-t">Summary.t</a></code></dt><dt class="spec type" id="type-file_callback_args"><a href="#type-file_callback_args" class="anchor"></a><code><span class="keyword">type</span> file_callback_args</code><code> = </code><code>{</code><table class="record"><tr id="type-file_callback_args.procedures" class="anchored"><td class="def field"><a href="#type-file_callback_args.procedures" class="anchor"></a><code>procedures : <span><a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> list</span>;</code></td></tr><tr id="type-file_callback_args.source_file" class="anchored"><td class="def field"><a href="#type-file_callback_args.source_file" class="anchor"></a><code>source_file : <a href="../../IBase/SourceFile/index.html#type-t">IBase.SourceFile.t</a>;</code></td></tr><tr id="type-file_callback_args.exe_env" class="anchored"><td class="def field"><a href="#type-file_callback_args.exe_env" class="anchor"></a><code>exe_env : <a href="../../Absint/Exe_env/index.html#type-t">Absint.Exe_env.t</a>;</code></td></tr></table><code>}</code></dt><dt class="spec type" id="type-file_callback_t"><a href="#type-file_callback_t" class="anchor"></a><code><span class="keyword">type</span> file_callback_t</code><code> = <a href="index.html#type-file_callback_args">file_callback_args</a> <span>&#45;&gt;</span> <a href="../../Absint/IssueLog/index.html#type-t">Absint.IssueLog.t</a></code></dt><dd><p>Result is a list of additional issues found at this stage (complementary to issues generated on per-procedure analysis stage)</p></dd></dl><dl><dt class="spec value" id="val-register_procedure_callback"><a href="#val-register_procedure_callback" class="anchor"></a><code><span class="keyword">val</span> register_procedure_callback : <span>checker_name:string</span> <span>&#45;&gt;</span> <span>?&#8288;dynamic_dispatch:bool</span> <span>&#45;&gt;</span> <a href="../../IBase/Language/index.html#type-t">IBase.Language.t</a> <span>&#45;&gt;</span> <a href="index.html#type-proc_callback_t">proc_callback_t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p>Register a procedure callback (see details above)</p></dd></dl><dl><dt class="spec value" id="val-register_file_callback"><a href="#val-register_file_callback" class="anchor"></a><code><span class="keyword">val</span> register_file_callback : <span>checker_name:string</span> <span>&#45;&gt;</span> <a href="../../IBase/Language/index.html#type-t">IBase.Language.t</a> <span>&#45;&gt;</span> <a href="index.html#type-file_callback_t">file_callback_t</a> <span>&#45;&gt;</span> <span>issue_dir:<a href="../../IBase/ResultsDirEntryName/index.html#type-id">IBase.ResultsDirEntryName.id</a></span> <span>&#45;&gt;</span> unit</code></dt><dd><p>Register a file callback (see details above). <code>issues_dir</code> must be unique for this type of checker.</p></dd></dl><dl><dt class="spec value" id="val-iterate_procedure_callbacks"><a href="#val-iterate_procedure_callbacks" class="anchor"></a><code><span class="keyword">val</span> iterate_procedure_callbacks : <a href="../../Absint/Exe_env/index.html#type-t">Absint.Exe_env.t</a> <span>&#45;&gt;</span> <a href="../Summary/index.html#type-t">Summary.t</a> <span>&#45;&gt;</span> <a href="../Summary/index.html#type-t">Summary.t</a></code></dt><dd><p>Invoke all registered procedure callbacks on the given procedure.</p></dd></dl><dl><dt class="spec value" id="val-iterate_file_callbacks_and_store_issues"><a href="#val-iterate_file_callbacks_and_store_issues" class="anchor"></a><code><span class="keyword">val</span> iterate_file_callbacks_and_store_issues : <span><a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> list</span> <span>&#45;&gt;</span> <a href="../../Absint/Exe_env/index.html#type-t">Absint.Exe_env.t</a> <span>&#45;&gt;</span> <a href="../../IBase/SourceFile/index.html#type-t">IBase.SourceFile.t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p>Invoke all registered file callbacks on a file, and store produced errors in a corresponding directory. Guaranteed to be called after all procedure-level callbacks are invoked</p></dd></dl></div></body></html>