summaryrefslogtreecommitdiffstats
path: root/llvm/docs/tutorial
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-07-15 20:03:30 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-07-15 20:03:30 +0000
commit063fd270ed6f6ba0a8b5807832d4a9460427ca48 (patch)
treec627b0327c0b4ca6c3b592db007278a90f6d73c4 /llvm/docs/tutorial
parentf660248238023bbb44deed53068d9f56e74fd1c6 (diff)
downloadbcm5719-llvm-063fd270ed6f6ba0a8b5807832d4a9460427ca48.tar.gz
bcm5719-llvm-063fd270ed6f6ba0a8b5807832d4a9460427ca48.zip
A couple of minor fixes to the OCaml tutorial. PR10025 and PR10316. Patches by Damien Schoof!
llvm-svn: 135293
Diffstat (limited to 'llvm/docs/tutorial')
-rw-r--r--llvm/docs/tutorial/OCamlLangImpl3.html11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/docs/tutorial/OCamlLangImpl3.html b/llvm/docs/tutorial/OCamlLangImpl3.html
index 45ee6e9ffc3..49b62bd6c19 100644
--- a/llvm/docs/tutorial/OCamlLangImpl3.html
+++ b/llvm/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
- | '+' -&gt; build_add lhs_val rhs_val "addtmp" builder
- | '-' -&gt; build_sub lhs_val rhs_val "subtmp" builder
- | '*' -&gt; build_mul lhs_val rhs_val "multmp" builder
+ | '+' -&gt; build_fadd lhs_val rhs_val "addtmp" builder
+ | '-' -&gt; build_fsub lhs_val rhs_val "subtmp" builder
+ | '*' -&gt; build_fmul lhs_val rhs_val "multmp" builder
| '&lt;' -&gt;
(* Convert bool 0/1 to double 0.0 or 1.0 *)
let i = build_fcmp Fcmp.Ult lhs_val rhs_val "cmptmp" builder in
OpenPOWER on IntegriCloud