Commits

Jacques-Pascal Deplaix  committed 13d687b

Begin the module LLVM_types

  • Participants
  • Parent commits 30fdfcf

Comments (0)

Files changed (2)

File LLVM_types.ml

+type 'a t = {data : 'a}
+
+type llvm_int = [`Int of (int * Big_int.big_int option)]
+type 'a llvm_array = [`Array of (int * 'a)]
+type 'a llvm_pointer = [`Pointer of ('a * int option)]
+type ('a, 'b) llvm_function_pointer = [`Function_pointer of ('a array * 'b * int option)]
+
+let int i x = {data = `Int (i, x)}
+let array i x = {data = `Array (i, x)}
+let pointer t x = {data = `Pointer (t, x)}
+let function_pointer params return_type x = {data = `Function_pointer (params, return_type, x)}

File LLVM_types.mli

+type 'a t
+
+type llvm_int = [`Int of (int * Big_int.big_int option)]
+type 'a llvm_array = [`Array of (int * 'a)]
+type 'a llvm_pointer = [`Pointer of ('a * int option)]
+type ('a, 'b) llvm_function_pointer = [`Function_pointer of ('a array * 'b * int option)]
+
+val int : int -> Big_int.big_int option -> llvm_int t
+val array : int -> 'a -> 'a llvm_array t
+val pointer : 'a -> int option -> 'a llvm_pointer t
+val function_pointer : 'a array -> 'b -> int option -> ('a, 'b) llvm_function_pointer t