summaryrefslogtreecommitdiffstats
path: root/docs/tutorial/OCamlLangImpl7.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorial/OCamlLangImpl7.html')
-rw-r--r--docs/tutorial/OCamlLangImpl7.html11
1 files changed, 8 insertions, 3 deletions
diff --git a/docs/tutorial/OCamlLangImpl7.html b/docs/tutorial/OCamlLangImpl7.html
index abda440..0776821 100644
--- a/docs/tutorial/OCamlLangImpl7.html
+++ b/docs/tutorial/OCamlLangImpl7.html
@@ -1384,14 +1384,15 @@ open Llvm
exception Error of string
-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
(* Create an alloca instruction in the entry block of the function. This
* is used for mutable variables etc. *)
let create_entry_block_alloca the_function var_name =
- let builder = builder_at (instr_begin (entry_block the_function)) in
+ let builder = builder_at context (instr_begin (entry_block the_function)) in
build_alloca double_type var_name builder
let rec codegen_expr = function
@@ -1815,6 +1816,8 @@ open Llvm_target
open Llvm_scalar_opts
let main () =
+ ignore (initialize_native_target ());
+
(* Install standard binary operators.
* 1 is the lowest precedence. *)
Hashtbl.add Parser.binop_precedence '=' 2;
@@ -1851,6 +1854,8 @@ let main () =
(* Simplify the control flow graph (deleting unreachable blocks, etc). *)
add_cfg_simplification the_fpm;
+ ignore (PassManager.initialize the_fpm);
+
(* Run the main "interpreter loop" now. *)
Toplevel.main_loop the_fpm the_execution_engine stream;
OpenPOWER on IntegriCloud