[llvm-commits] [llvm] r108121 - in /llvm/trunk/examples/OCaml-Kaleidoscope: Chapter4/codegen.ml Chapter5/codegen.ml Chapter6/codegen.ml Chapter7/codegen.ml
Eric Christopher
echristo at apple.com
Sun Jul 11 19:32:45 PDT 2010
Author: echristo
Date: Sun Jul 11 21:32:44 2010
New Revision: 108121
URL: http://llvm.org/viewvc/llvm-project?rev=108121&view=rev
Log:
Fix up the ocaml kaleidoscope example as well.
Note that the example currently doesn't appear to work.
Modified:
llvm/trunk/examples/OCaml-Kaleidoscope/Chapter4/codegen.ml
llvm/trunk/examples/OCaml-Kaleidoscope/Chapter5/codegen.ml
llvm/trunk/examples/OCaml-Kaleidoscope/Chapter6/codegen.ml
llvm/trunk/examples/OCaml-Kaleidoscope/Chapter7/codegen.ml
Modified: llvm/trunk/examples/OCaml-Kaleidoscope/Chapter4/codegen.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/OCaml-Kaleidoscope/Chapter4/codegen.ml?rev=108121&r1=108120&r2=108121&view=diff
==============================================================================
--- llvm/trunk/examples/OCaml-Kaleidoscope/Chapter4/codegen.ml (original)
+++ llvm/trunk/examples/OCaml-Kaleidoscope/Chapter4/codegen.ml Sun Jul 11 21:32:44 2010
@@ -22,9 +22,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
Modified: llvm/trunk/examples/OCaml-Kaleidoscope/Chapter5/codegen.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/OCaml-Kaleidoscope/Chapter5/codegen.ml?rev=108121&r1=108120&r2=108121&view=diff
==============================================================================
--- llvm/trunk/examples/OCaml-Kaleidoscope/Chapter5/codegen.ml (original)
+++ llvm/trunk/examples/OCaml-Kaleidoscope/Chapter5/codegen.ml Sun Jul 11 21:32:44 2010
@@ -22,9 +22,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
Modified: llvm/trunk/examples/OCaml-Kaleidoscope/Chapter6/codegen.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/OCaml-Kaleidoscope/Chapter6/codegen.ml?rev=108121&r1=108120&r2=108121&view=diff
==============================================================================
--- llvm/trunk/examples/OCaml-Kaleidoscope/Chapter6/codegen.ml (original)
+++ llvm/trunk/examples/OCaml-Kaleidoscope/Chapter6/codegen.ml Sun Jul 11 21:32:44 2010
@@ -31,9 +31,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
Modified: llvm/trunk/examples/OCaml-Kaleidoscope/Chapter7/codegen.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/OCaml-Kaleidoscope/Chapter7/codegen.ml?rev=108121&r1=108120&r2=108121&view=diff
==============================================================================
--- llvm/trunk/examples/OCaml-Kaleidoscope/Chapter7/codegen.ml (original)
+++ llvm/trunk/examples/OCaml-Kaleidoscope/Chapter7/codegen.ml Sun Jul 11 21:32:44 2010
@@ -60,9 +60,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