diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
commit | cd749a9c07f1de2fb8affde90537efa4bc3e7c54 (patch) | |
tree | b21f6de4e08b89bb7931806bab798fc2a5e3a686 /docs/tutorial/OCamlLangImpl4.html | |
parent | 72621d11de5b873f1695f391eb95f0b336c3d2d4 (diff) | |
download | FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.zip FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.tar.gz |
Update llvm to r84119.
Diffstat (limited to 'docs/tutorial/OCamlLangImpl4.html')
-rw-r--r-- | docs/tutorial/OCamlLangImpl4.html | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/docs/tutorial/OCamlLangImpl4.html b/docs/tutorial/OCamlLangImpl4.html index ffa85d5..26f2532 100644 --- a/docs/tutorial/OCamlLangImpl4.html +++ b/docs/tutorial/OCamlLangImpl4.html @@ -206,6 +206,8 @@ add a set of optimizations to run. The code looks like this:</p> (* 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; </pre> @@ -222,7 +224,7 @@ requires a pointer to the <tt>the_module</tt> (through the <tt>the_module_provider</tt>) to construct itself. Once it is set up, we use a series of "add" calls to add a bunch of LLVM passes. The first pass is basically boilerplate, it adds a pass so that later optimizations know how the -data structures in the program are layed out. The +data structures in the program are laid out. The "<tt>the_execution_engine</tt>" variable is related to the JIT, which we will get to in the next section.</p> @@ -795,8 +797,9 @@ 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 let rec codegen_expr = function @@ -959,6 +962,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 '<' 10; @@ -991,6 +996,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; |