search for: temp_ti

Displaying 4 results from an estimated 4 matches for "temp_ti".

Did you mean: temp_t
2007 Nov 26
2
[LLVMdev] Fibonacci example in OCaml
On Nov 26, 2007, at 00:47, Jon Harrop wrote: > Here is a complete 104-line native code compiler for a tiny subset > of OCaml that is expressive enough to compile an external Fibonacci > program: > > [...] > > I was kind of hoping that function pointers would just magically > work, so this: > > do (if 1 <= 2 then fib else fib) 40 > > would run, but
2007 Nov 26
0
[LLVMdev] Fibonacci example in OCaml
On Monday 26 November 2007 16:21, Gordon Henriksen wrote: > Try 'Llvm_analysis.assert_valid_module m;' before you write bitcode to > figure out where things went awry. ('dump_module m;' may also help.) > GIGO applies (but garbage-in/segfault-out is more likely). Ok, thanks for the tip. > Unfortunately, even if the bindings were more strongly typed, it would > still
2007 Nov 26
0
[LLVMdev] Fibonacci example in OCaml
Here is a complete 104-line native code compiler for a tiny subset of OCaml that is expressive enough to compile an external Fibonacci program: type expr = | Int of int | Var of string | BinOp of [ `Add | `Sub | `Leq ] * expr * expr | If of expr * expr * expr | Apply of expr * expr type defn = | LetRec of string * string * expr open Camlp4.PreCast;; let expr = Gram.Entry.mk
2007 Nov 25
2
[LLVMdev] Fibonacci example in OCaml
Here's my translation of the Fibonacci example into OCaml: open Printf open Llvm let build_fib m = let fibf = define_function "fib" (function_type i32_type [| i32_type |]) m in let bb = builder_at_end (entry_block fibf) in let one = const_int i32_type 1 and two = const_int i32_type 2 in let argx = param fibf 0 in set_value_name "AnArg" argx; let