diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-07-15 20:03:30 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-07-15 20:03:30 +0000 |
commit | bc7d598cc1ef36a2505d8fd82e5c868070af9213 (patch) | |
tree | a8b2e3f1e09d35c161a6a06739a503cf393f9b06 | |
parent | 96a7db084f113c8908400767155510811f79985d (diff) | |
download | external_llvm-bc7d598cc1ef36a2505d8fd82e5c868070af9213.zip external_llvm-bc7d598cc1ef36a2505d8fd82e5c868070af9213.tar.gz external_llvm-bc7d598cc1ef36a2505d8fd82e5c868070af9213.tar.bz2 |
A couple of minor fixes to the OCaml tutorial. PR10025 and PR10316. Patches by Damien Schoof!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135293 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | docs/tutorial/OCamlLangImpl3.html | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/tutorial/OCamlLangImpl3.html b/docs/tutorial/OCamlLangImpl3.html index 45ee6e9..49b62bd 100644 --- a/docs/tutorial/OCamlLangImpl3.html +++ b/docs/tutorial/OCamlLangImpl3.html @@ -95,8 +95,9 @@ an undeclared parameter):</p> <pre> exception Error of string -let the_module = create_module (global_context ()) "my cool jit" -let builder = builder (global_context ()) +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 double_type = double_type context </pre> @@ -176,9 +177,9 @@ variables</a>.</p> let rhs_val = codegen_expr rhs in begin match op with - | '+' -> build_add lhs_val rhs_val "addtmp" builder - | '-' -> build_sub lhs_val rhs_val "subtmp" builder - | '*' -> build_mul lhs_val rhs_val "multmp" builder + | '+' -> build_fadd lhs_val rhs_val "addtmp" builder + | '-' -> build_fsub lhs_val rhs_val "subtmp" builder + | '*' -> build_fmul lhs_val rhs_val "multmp" builder | '<' -> (* Convert bool 0/1 to double 0.0 or 1.0 *) let i = build_fcmp Fcmp.Ult lhs_val rhs_val "cmptmp" builder in |