Commits

camlspotter committed 48751a6

cleanup

  • Participants
  • Parent commits b37f27e

Comments (0)

Files changed (3)

-open Llvm
 open Ltype.Base
 
-module M : sig
-  type ('a, 'final, 'res) t
-  val gep_gen : ([ `int of int | `llvalue of Llvm.llvalue] list -> 'x) -> (('a pointer, 'final, 'x) t -> 'b) -> 'b
-  val end_ : ('a, 'a, 'z) t -> 'z
-  val pos_const : int -> ([> `container of 'a], 'final, 'res) t -> (('a, 'final, 'res) t -> 'b) -> 'b
-  val pos : Llvm.llvalue -> ([> `container of 'a], 'final, 'res) t -> (('a, 'final, 'res) t -> 'b) -> 'b
-  val mem0 : (('a0 * _) struct_, 'final, 'res) t -> (('a0, 'final, 'res) t -> 'b) -> 'b
-  val mem1 : ((_ * ('a1 * _)) struct_, 'final, 'res) t -> (('a1, 'final, 'res) t -> 'b) -> 'b
-  val mem2 : ((_ * (_ * ('a2 * _))) struct_, 'final, 'res) t -> (('a2, 'final, 'res) t -> 'b) -> 'b
-  val mem3 : ((_ * (_ * (_ * ('a3 * _)))) struct_, 'final, 'res) t -> (('a3, 'final, 'res) t -> 'b) -> 'b
-  val mem4 : ((_ * (_ * (_ * (_ * ('a4 * _))))) struct_, 'final, 'res) t -> (('a4, 'final, 'res) t -> 'b) -> 'b
-  val mem5 : ((_ * (_ * (_ * (_ * (_ * ('a5 * _)))))) struct_, 'final, 'res) t -> (('a5, 'final, 'res) t -> 'b) -> 'b
-  val mem6 : ((_ * (_ * (_ * (_ * (_ * (_ * ('a6 * _))))))) struct_, 'final, 'res) t -> (('a6, 'final, 'res) t -> 'b) -> 'b
-  val mem7 : ((_ * (_ * (_ * (_ * (_ * (_ * (_ * ('a7 * _)))))))) struct_, 'final, 'res) t -> (('a7, 'final, 'res) t -> 'b) -> 'b
-  val mem8 : ((_ * (_ * (_ * (_ * (_ * (_ * (_ * (_ * ('a8 * _))))))))) struct_, 'final, 'res) t -> (('a8, 'final, 'res) t -> 'b) -> 'b
-  val mem9 : ((_ * (_ * (_ * (_ * (_ * (_ * (_ * (_ * (_ * ('a9 * _)))))))))) struct_, 'final, 'res) t -> (('a9, 'final, 'res) t -> 'b) -> 'b
-end = struct
-  type ('a, 'final, 'res) t = { k : [`int of int | `llvalue of llvalue] list -> 'res; 
-                                rev : [`int of int | `llvalue of llvalue] list; 
-                              }
-  let gep_gen k f = f { rev = []; k = k; }
-  let end_ st = st.k (List.rev st.rev)
-    
-  let pos_const (n : int) st k = k { st with rev = `int n::st.rev }
-  let pos (n : llvalue) st k = k { st with rev = `llvalue n::st.rev }
-  let mem0 st k = k { st with rev = `int 0  :: st.rev }
-  let mem1 st k = k { st with rev = `int 1  :: st.rev }
-  let mem2 st k = k { st with rev = `int 2  :: st.rev }
-  let mem3 st k = k { st with rev = `int 3  :: st.rev }
-  let mem4 st k = k { st with rev = `int 4  :: st.rev }
-  let mem5 st k = k { st with rev = `int 5  :: st.rev }
-  let mem6 st k = k { st with rev = `int 6  :: st.rev }
-  let mem7 st k = k { st with rev = `int 7  :: st.rev }
-  let mem8 st k = k { st with rev = `int 8  :: st.rev }
-  let mem9 st k = k { st with rev = `int 9  :: st.rev }
-end
-
-include M
+type ('a, 'final, 'res) t = { k : [`int of int | `llvalue of Llvm.llvalue] list -> 'res; 
+                              rev : [`int of int | `llvalue of Llvm.llvalue] list; 
+                            }
+let gep_gen k f = f { rev = []; k = k; }
+let end_ st = st.k (List.rev st.rev)
+  
+let pos_const (n : int) st k = k { st with rev = `int n::st.rev }
+let pos (n : Llvm.llvalue) st k = k { st with rev = `llvalue n::st.rev }
+let mem0 st k = k { st with rev = `int 0  :: st.rev }
+let mem1 st k = k { st with rev = `int 1  :: st.rev }
+let mem2 st k = k { st with rev = `int 2  :: st.rev }
+let mem3 st k = k { st with rev = `int 3  :: st.rev }
+let mem4 st k = k { st with rev = `int 4  :: st.rev }
+let mem5 st k = k { st with rev = `int 5  :: st.rev }
+let mem6 st k = k { st with rev = `int 6  :: st.rev }
+let mem7 st k = k { st with rev = `int 7  :: st.rev }
+let mem8 st k = k { st with rev = `int 8  :: st.rev }
+let mem9 st k = k { st with rev = `int 9  :: st.rev }
       : 'unsafe pointer v m = 
     unsafeM (Llvm.build_gep !<v (Array.of_list (List.map (!<) xs)) name)
 
-  module Gep : sig
-    type ('a, 'final, 'res) t = ('a, 'final, 'res) Gep.t
-    val gep_gen : ?name:string -> ('a pointer v -> 'b m) -> 'c pointer v -> (('c pointer, 'a, 'b m) t -> 'f) -> 'f
-    val end_ : ('a, 'a, 'res m) t -> 'res m
-    val pos_const : int -> ([> `container of 'a], 'final, 'res) t -> (('a, 'final, 'res) t -> 'b) -> 'b
-    val pos : i32 v -> ([> `container of 'a], 'final, 'res) t -> (('a, 'final, 'res) t -> 'b) -> 'b
-    val mem0 : (('a0 * _) struct_, 'final, 'res) t -> (('a0, 'final, 'res) t -> 'b) -> 'b
-    val mem1 : ((_ * ('a1 * _)) struct_, 'final, 'res) t -> (('a1, 'final, 'res) t -> 'b) -> 'b
-    val mem2 : ((_ * (_ * ('a2 * _))) struct_, 'final, 'res) t -> (('a2, 'final, 'res) t -> 'b) -> 'b
-    val mem3 : ((_ * (_ * (_ * ('a3 * _)))) struct_, 'final, 'res) t -> (('a3, 'final, 'res) t -> 'b) -> 'b
-    val mem4 : ((_ * (_ * (_ * (_ * ('a4 * _))))) struct_, 'final, 'res) t -> (('a4, 'final, 'res) t -> 'b) -> 'b
-    val mem5 : ((_ * (_ * (_ * (_ * (_ * ('a5 * _)))))) struct_, 'final, 'res) t -> (('a5, 'final, 'res) t -> 'b) -> 'b
-    val mem6 : ((_ * (_ * (_ * (_ * (_ * (_ * ('a6 * _))))))) struct_, 'final, 'res) t -> (('a6, 'final, 'res) t -> 'b) -> 'b
-    val mem7 : ((_ * (_ * (_ * (_ * (_ * (_ * (_ * ('a7 * _)))))))) struct_, 'final, 'res) t -> (('a7, 'final, 'res) t -> 'b) -> 'b
-    val mem8 : ((_ * (_ * (_ * (_ * (_ * (_ * (_ * (_ * ('a8 * _))))))))) struct_, 'final, 'res) t -> (('a8, 'final, 'res) t -> 'b) -> 'b
-    val mem9 : ((_ * (_ * (_ * (_ * (_ * (_ * (_ * (_ * (_ * ('a9 * _)))))))))) struct_, 'final, 'res) t -> (('a9, 'final, 'res) t -> 'b) -> 'b
-  end = struct
+  module Gep = struct
     include Gep
     let gep_gen ?name cont v = gep_gen (fun lst ->
       let lst = List.map (function
             gep_store v ~dst:pointer (Gep.pos_const 0) Gep.mem2 Gep.end_ : i32 v m 
   *)
   module Gep : sig
-    type ('a, 'final, 'res) t = ('a, 'final, 'res) Gep.t
-    val gep_gen : ?name:string -> ('a pointer v -> 'b m) -> 'c pointer v -> (('c pointer, 'a, 'b m) t -> 'f) -> 'f
+    type ('a, 'final, 'res) t
     val end_ : ('a, 'a, 'res m) t -> 'res m
     val pos_const : int -> ([> `container of 'a], 'final, 'res) t -> (('a, 'final, 'res) t -> 'b) -> 'b
     val pos : i32 v -> ([> `container of 'a], 'final, 'res) t -> (('a, 'final, 'res) t -> 'b) -> 'b