Skip to content

Commit

Permalink
Fix up the ocaml kaleidoscope example as well.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
echristo committed Jul 12, 2010
1 parent 8b78d4b commit 688d580
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions examples/OCaml-Kaleidoscope/Chapter4/codegen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/OCaml-Kaleidoscope/Chapter5/codegen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/OCaml-Kaleidoscope/Chapter6/codegen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/OCaml-Kaleidoscope/Chapter7/codegen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 688d580

Please sign in to comment.