<p>The <tt>Codegen.builder</tt> object is a helper object that makes it easy to
generate LLVM instructions. Instances of the <a
<p>The <tt>Codegen.builder</tt> object is a helper object that makes it easy to
generate LLVM instructions. Instances of the <a
class keep track of the current place to insert instructions and has methods to
create new instructions.</p>
class keep track of the current place to insert instructions and has methods to
create new instructions.</p>
constants of <em>A</em>rbitrary <em>P</em>recision). This code basically just
creates and returns a <tt>ConstantFP</tt>. Note that in the LLVM IR
that constants are all uniqued together and shared. For this reason, the API
constants of <em>A</em>rbitrary <em>P</em>recision). This code basically just
creates and returns a <tt>ConstantFP</tt>. Note that in the LLVM IR
that constants are all uniqued together and shared. For this reason, the API
somewhere and its value is available. In practice, the only values that can be
in the <tt>Codegen.named_values</tt> map are function arguments. This code
simply checks to see that the specified name is in the map (if not, an unknown
somewhere and its value is available. In practice, the only values that can be
in the <tt>Codegen.named_values</tt> map are function arguments. This code
simply checks to see that the specified name is in the map (if not, an unknown
do is specify what instruction to create (e.g. with <tt>Llvm.create_add</tt>),
which operands to use (<tt>lhs</tt> and <tt>rhs</tt> here) and optionally
provide a name for the generated instruction.</p>
do is specify what instruction to create (e.g. with <tt>Llvm.create_add</tt>),
which operands to use (<tt>lhs</tt> and <tt>rhs</tt> here) and optionally
provide a name for the generated instruction.</p>
first, we want to allow 'extern'ing a function more than once, as long as the
prototypes for the externs match (since all arguments have the same type, we
just have to check that the number of arguments match). Second, we want to
first, we want to allow 'extern'ing a function more than once, as long as the
prototypes for the externs match (since all arguments have the same type, we
just have to check that the number of arguments match). Second, we want to
support</a> in the next chapter. Also note that the code is very literally
transcribed, no optimizations are being performed. We will
<a href="OCamlLangImpl4.html#trivialconstfold">add optimizations</a> explicitly
support</a> in the next chapter. Also note that the code is very literally
transcribed, no optimizations are being performed. We will
<a href="OCamlLangImpl4.html#trivialconstfold">add optimizations</a> explicitly
-let the_module = create_module "my cool jit"
-let builder = builder ()
+let context = global_context ()
+let the_module = create_module context "my cool jit"
+let builder = builder context
let named_values:(string, llvalue) Hashtbl.t = Hashtbl.create 10
let rec codegen_expr = function
let named_values:(string, llvalue) Hashtbl.t = Hashtbl.create 10
let rec codegen_expr = function