From 688d58033a077dd05be830cd23f8d416ce1be59d Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Mon, 12 Jul 2010 02:32:44 +0000 Subject: Fix up the ocaml kaleidoscope example as well. Note that the example currently doesn't appear to work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108121 91177308-0d34-0410-b5e6-96231b3b80d8 --- examples/OCaml-Kaleidoscope/Chapter4/codegen.ml | 6 +++--- examples/OCaml-Kaleidoscope/Chapter5/codegen.ml | 6 +++--- examples/OCaml-Kaleidoscope/Chapter6/codegen.ml | 6 +++--- examples/OCaml-Kaleidoscope/Chapter7/codegen.ml | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'examples') diff --git a/examples/OCaml-Kaleidoscope/Chapter4/codegen.ml b/examples/OCaml-Kaleidoscope/Chapter4/codegen.ml index 69d0928b1b..8957f4c610 100644 --- a/examples/OCaml-Kaleidoscope/Chapter4/codegen.ml +++ b/examples/OCaml-Kaleidoscope/Chapter4/codegen.ml @@ -22,9 +22,9 @@ let rec codegen_expr = function 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 diff --git a/examples/OCaml-Kaleidoscope/Chapter5/codegen.ml b/examples/OCaml-Kaleidoscope/Chapter5/codegen.ml index e0db2d2c86..e4570a6575 100644 --- a/examples/OCaml-Kaleidoscope/Chapter5/codegen.ml +++ b/examples/OCaml-Kaleidoscope/Chapter5/codegen.ml @@ -22,9 +22,9 @@ let rec codegen_expr = function 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 diff --git a/examples/OCaml-Kaleidoscope/Chapter6/codegen.ml b/examples/OCaml-Kaleidoscope/Chapter6/codegen.ml index e00edf294f..9667435944 100644 --- a/examples/OCaml-Kaleidoscope/Chapter6/codegen.ml +++ b/examples/OCaml-Kaleidoscope/Chapter6/codegen.ml @@ -31,9 +31,9 @@ let rec codegen_expr = function 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 diff --git a/examples/OCaml-Kaleidoscope/Chapter7/codegen.ml b/examples/OCaml-Kaleidoscope/Chapter7/codegen.ml index e8fac32f5b..e66396eb6a 100644 --- a/examples/OCaml-Kaleidoscope/Chapter7/codegen.ml +++ b/examples/OCaml-Kaleidoscope/Chapter7/codegen.ml @@ -60,9 +60,9 @@ let rec codegen_expr = function 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 -- cgit v1.2.3-18-g5258