[llvm-commits] [llvm] r135293 - /llvm/trunk/docs/tutorial/OCamlLangImpl3.html
Eli Friedman
eli.friedman at gmail.com
Fri Jul 15 13:03:30 PDT 2011
Author: efriedma
Date: Fri Jul 15 15:03:30 2011
New Revision: 135293
URL: http://llvm.org/viewvc/llvm-project?rev=135293&view=rev
Log:
A couple of minor fixes to the OCaml tutorial. PR10025 and PR10316. Patches by Damien Schoof!
Modified:
llvm/trunk/docs/tutorial/OCamlLangImpl3.html
Modified: llvm/trunk/docs/tutorial/OCamlLangImpl3.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl3.html?rev=135293&r1=135292&r2=135293&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/OCamlLangImpl3.html (original)
+++ llvm/trunk/docs/tutorial/OCamlLangImpl3.html Fri Jul 15 15:03:30 2011
@@ -95,8 +95,9 @@
<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 @@
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
More information about the llvm-commits
mailing list