<div class="doc_text">
-<p><b>Note:</b> the ocaml bindings already use <tt>LLVMFoldingBuilder</tt>.<p>
+<p><b>Note:</b> the default <tt>IRBuilder</tt> now always includes the constant
+folding optimisations below.<p>
<p>
Our demonstration for Chapter 3 is elegant and easy to extend. Unfortunately,
<div class="doc_code">
<pre>
let codegen_func the_fpm = function
- ...
+ ...
try
let ret_val = codegen_expr body in
...
let main () =
...
- <b>
- (* Create the JIT. *)
+ <b>(* Create the JIT. *)
let the_module_provider = ModuleProvider.create Codegen.the_module in
- let the_execution_engine = ExecutionEngine.create the_module_provider in</b>
+ let the_execution_engine = ExecutionEngine.create the_module_provider in</b>
...
</pre>
</div>
LLVM JIT and optimizer. To build this example, use:
</p>
+<div class="doc_code">
+<pre>
+# Compile
+ocamlbuild toy.byte
+# Run
+./toy.byte
+</pre>
+</div>
+
+<p>Here is the code:</p>
+
<dl>
<dt>_tags:</dt>
<dd class="doc_code">