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

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (infer.index)</title><link rel="stylesheet" href="../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc %%VERSION%%"/><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> infer</nav><nav class="toc"><ul><li><a href="#library-infer">Library infer</a><ul><li><a href="#absint/">absint/</a></li><li><a href="#backend/">backend/</a></li><li><a href="#checkers/">checkers/</a></li><li><a href="#clang/">clang/</a><ul><li><a href="#general-structure">General structure</a></li><li><a href="#format-of-the-ast">Format of the AST</a></li><li><a href="#hacking-on-the-.atd-file">Hacking on the <code>.atd</code> file</a></li></ul></li><li><a href="#eradicate/">eradicate/</a></li><li><a href="#java/">java/</a></li><li><a href="#infer-executable">infer executable</a></li></ul></li></ul></nav></header><h2 id="library-infer"><a href="#library-infer" class="anchor"></a>Library infer</h2><p>These are the modules used by infer that are not packaged into sub-libraries.</p><p>The entry point of this library is the module: <a href="InferModules/index.html"><code>InferModules</code></a>.</p><p>The modules are split into several directories in the source tree of infer.</p><h3 id="absint/"><a href="#absint/" class="anchor"></a>absint/</h3><p>Code + utilities for the Infer.AI abstract interpretation framework. Start at <a href="InferModules/AbstractInterpreter/index.html"><code>InferModules.AbstractInterpreter</code></a>.</p><h3 id="backend/"><a href="#backend/" class="anchor"></a>backend/</h3><p>The backend is responsible for the analysis of a project starting from an intermediate representation stored in the results directory, typically <code>infer-out</code>.</p><p>The entry point for the analysis is the module <a href="InferModules/InferAnalyze/index.html"><code>InferModules.InferAnalyze</code></a>.</p><p>The module <a href="InferModules/InferPrint/index.html"><code>InferModules.InferPrint</code></a> is used to export the analysis results.</p><h3 id="checkers/"><a href="#checkers/" class="anchor"></a>checkers/</h3><p>Transfer functions, abstract domains, and checker configuration.</p><h3 id="clang/"><a href="#clang/" class="anchor"></a>clang/</h3><p>This is the frontend for the clang compiler. The main entry point is <a href="InferModules/ClangWrapper/index.html"><code>InferModules.ClangWrapper</code></a>.</p><h4 id="general-structure"><a href="#general-structure" class="anchor"></a>General structure</h4><ol><li>Given a compilation command from the build system, sanitize it, attach <code>ASTExporter</code> clang plugin to the relevant commands and run it.</li><li>Parse the AST (Abstract Syntax Tree) from the Biniou format into an OCaml data structure.</li><li>If enabled, invoke translation to <code>SIL</code> via <a href="InferModules/CFrontend/index.html"><code>InferModules.CFrontend</code></a>.</li><li>If enabled, invoke linters via <a href="InferModules/CFrontend_checkers_main/index.html"><code>InferModules.CFrontend_checkers_main</code></a>. More on linters here: <a href="http://fbinfer.com/docs/linters.html">http://fbinfer.com/docs/linters.html</a>.</li></ol><h4 id="format-of-the-ast"><a href="#format-of-the-ast" class="anchor"></a>Format of the AST</h4><p>The OCaml data type is defined in <code>atd</code> format. The <code>clang_ast_t.atd</code> file is generated from the comments in the <a href="https://github.com/facebook/facebook-clang-plugins/blob/master/libtooling/ASTExporter.h"><code>ASTExporter.h</code></a> file.</p><p>For more information, refer to the relevant documentation in <code>facebook-clang-plugins</code>:</p><ul><li><a href="https://github.com/facebook/facebook-clang-plugins/blob/master/libtooling/ATD_GUIDELINES.md"><code>libtooling/ATD_GUIDELINES.md</code></a></li><li><a href="https://github.com/facebook/facebook-clang-plugins/blob/master/clang-ocaml/READM