mirror of
https://github.com/c-cube/moonpool.git
synced 2026-01-22 09:16:51 -05:00
14 lines
7.9 KiB
HTML
14 lines
7.9 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Compile_common (ocaml.Compile_common)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.1.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../index.html">Index</a> » <a href="../index.html">ocaml</a> » Compile_common</nav><header class="odoc-preamble"><h1>Module <code><span>Compile_common</span></code></h1><p>Common compilation pipeline between bytecode and native.</p></header><div class="odoc-tocs"><nav class="odoc-toc odoc-local-toc"><ul><li><a href="#initialization">Initialization</a></li><li><a href="#interfaces">Interfaces</a></li><li><a href="#implementations">Implementations</a></li></ul></nav></div><div class="odoc-content"><h3 id="initialization"><a href="#initialization" class="anchor"></a>Initialization</h3><div class="odoc-spec"><div class="spec type anchored" id="type-info"><a href="#type-info" class="anchor"></a><code><span><span class="keyword">type</span> info</span><span> = </span><span>{</span></code><ol><li id="type-info.target" class="def record field anchored"><a href="#type-info.target" class="anchor"></a><code><span>target : <a href="../Unit_info/index.html#type-t">Unit_info.t</a>;</span></code></li><li id="type-info.env" class="def record field anchored"><a href="#type-info.env" class="anchor"></a><code><span>env : <a href="../Env/index.html#type-t">Env.t</a>;</span></code></li><li id="type-info.ppf_dump" class="def record field anchored"><a href="#type-info.ppf_dump" class="anchor"></a><code><span>ppf_dump : <a href="../Stdlib/Format/index.html#type-formatter">Stdlib.Format.formatter</a>;</span></code></li><li id="type-info.tool_name" class="def record field anchored"><a href="#type-info.tool_name" class="anchor"></a><code><span>tool_name : string;</span></code></li><li id="type-info.native" class="def record field anchored"><a href="#type-info.native" class="anchor"></a><code><span>native : bool;</span></code></li></ol><code><span>}</span></code></div><div class="spec-doc"><p>Information needed to compile a file.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_info"><a href="#val-with_info" class="anchor"></a><code><span><span class="keyword">val</span> with_info :
|
||
<span><span class="label">native</span>:bool <span class="arrow">-></span></span>
|
||
<span><span class="label">tool_name</span>:string <span class="arrow">-></span></span>
|
||
<span><span class="label">dump_ext</span>:string <span class="arrow">-></span></span>
|
||
<span><a href="../Unit_info/index.html#type-t">Unit_info.t</a> <span class="arrow">-></span></span>
|
||
<span><span>(<span><a href="#type-info">info</a> <span class="arrow">-></span></span> <span class="type-var">'a</span>)</span> <span class="arrow">-></span></span>
|
||
<span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>with_info ~native ~tool_name ~dump_ext unit_info k</code> invokes its continuation <code>k</code> with an <code>info</code> structure passed as input, after initializing various global variables. This info structure and the initialized global state are not valid anymore after the continuation returns.</p><p>Due to current implementation limitations in the compiler, it is unsafe to try to compile several distinct compilation units by calling <code>with_info</code> several times.</p></div></div><h3 id="interfaces"><a href="#interfaces" class="anchor"></a>Interfaces</h3><div class="odoc-spec"><div class="spec value anchored" id="val-parse_intf"><a href="#val-parse_intf" class="anchor"></a><code><span><span class="keyword">val</span> parse_intf : <span><a href="#type-info">info</a> <span class="arrow">-></span></span> <a href="../Parsetree/index.html#type-signature">Parsetree.signature</a></span></code></div><div class="spec-doc"><p><code>parse_intf info</code> parses an interface (usually an <code>.mli</code> file).</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-typecheck_intf"><a href="#val-typecheck_intf" class="anchor"></a><code><span><span class="keyword">val</span> typecheck_intf :
|
||
<span><a href="#type-info">info</a> <span class="arrow">-></span></span>
|
||
<span><a href="../Parsetree/index.html#type-signature">Parsetree.signature</a> <span class="arrow">-></span></span>
|
||
<a href="../Misc/index.html#type-alerts">Misc.alerts</a> * <a href="../Typedtree/index.html#type-signature">Typedtree.signature</a></span></code></div><div class="spec-doc"><p><code>typecheck_intf info parsetree</code> typechecks an interface and returns the typedtree of the associated signature.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-emit_signature"><a href="#val-emit_signature" class="anchor"></a><code><span><span class="keyword">val</span> emit_signature : <span><a href="#type-info">info</a> <span class="arrow">-></span></span> <span><a href="../Misc/index.html#type-alerts">Misc.alerts</a> <span class="arrow">-></span></span> <span><a href="../Typedtree/index.html#type-signature">Typedtree.signature</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>emit_signature info parsetree typedtree</code> emits the <code>.cmi</code> file containing the given signature.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-interface"><a href="#val-interface" class="anchor"></a><code><span><span class="keyword">val</span> interface : <span><a href="#type-info">info</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>The complete compilation pipeline for interfaces.</p></div></div><h3 id="implementations"><a href="#implementations" class="anchor"></a>Implementations</h3><div class="odoc-spec"><div class="spec value anchored" id="val-parse_impl"><a href="#val-parse_impl" class="anchor"></a><code><span><span class="keyword">val</span> parse_impl : <span><a href="#type-info">info</a> <span class="arrow">-></span></span> <a href="../Parsetree/index.html#type-structure">Parsetree.structure</a></span></code></div><div class="spec-doc"><p><code>parse_impl info</code> parses an implementation (usually an <code>.ml</code> file).</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-typecheck_impl"><a href="#val-typecheck_impl" class="anchor"></a><code><span><span class="keyword">val</span> typecheck_impl : <span><a href="#type-info">info</a> <span class="arrow">-></span></span> <span><a href="../Parsetree/index.html#type-structure">Parsetree.structure</a> <span class="arrow">-></span></span> <a href="../Typedtree/index.html#type-implementation">Typedtree.implementation</a></span></code></div><div class="spec-doc"><p><code>typecheck_impl info parsetree</code> typechecks an implementation and returns the typedtree of the associated module, its public interface, and a coercion against that public interface.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-implementation"><a href="#val-implementation" class="anchor"></a><code><span><span class="keyword">val</span> implementation :
|
||
<span><a href="#type-info">info</a> <span class="arrow">-></span></span>
|
||
<span><span class="label">backend</span>:<span>(<span><a href="#type-info">info</a> <span class="arrow">-></span></span> <span><a href="../Typedtree/index.html#type-implementation">Typedtree.implementation</a> <span class="arrow">-></span></span> unit)</span> <span class="arrow">-></span></span>
|
||
unit</span></code></div><div class="spec-doc"><p>The complete compilation pipeline for implementations.</p></div></div></div></body></html>
|