Commits

camlspotter committed 82bb41b

module space clean up

  • Participants
  • Parent commits 923bdef

Comments (0)

Files changed (13)

-open Ltype.Base
+open Ltype
 
 type ('a, 'final, 'res) t = 
     { k : [`int of int | `llvalue of Llvm.llvalue] list -> 'res; 
 (** Type-safe GEP tools *)
 
-open Ltype.Base
+open Ltype
 
 type ('a, 'final, 'res) t
   (** GEP phantom *)
   let func name (ty_ret : 'ret typ) (args : ('args, (string * Llvm.lltype)) P.ts) 
       (f : ('args -> 'ret) pointer v -> 'args vs -> 'ret v m) : ('args -> 'ret) pointer v m =
     Format.eprintf "Creating function %s@." name;
-    let lty = function_ ty_ret (Ltype.Base.WithString.types args) in
+    let lty = function_ ty_ret (Ltype.WithString.types args) in
     let lv_f = match Module.Function.lookup name with
       | Some _ -> failwithf "LLib.create_fun: function %s is defined more than once" name
       | None -> Module.Function.declare name lty
     List.iter2 (fun lv_param name ->
       Value.set_name name lv_param) 
       (P.to_unknown_list (function_params lv_f))
-      (Ltype.Base.WithString.tags args);
+      (Ltype.WithString.tags args);
     let bb = Block.append ~name:"entry" lv_f in
     perform 
       Block.position_at_end bb;
 open Spotlib.Spot
-open Ltype.Base
-open Lvalue.Base
+open Ltype
+open Lvalue
 
 open Spotlib.Spot.Phantom
 
 open Spotlib.Spot
 open Llvm
 open Llvm_executionengine
-open Ltype.Base
+open Ltype
 
 open Spotlib.Spot.Phantom
 
 open Spotlib.Spot
-open Ltype.Base
+open Ltype
 open Llvm_executionengine
 
 open Spotlib.Spot.Phantom
-open Ltype.Base
-open Lvalue.Base
+open Ltype
+open Lvalue
 
 open Spotlib.Spot.Phantom
 
 module P = Spotlib.Spot.Phantom
 open P.Open
 
-module Base = struct
+(** Context Free *)
+module CF = struct
   (** phantom *)
   type 'a typ = ('a, lltype) P.t 
   type 'a typs = ('a, lltype) P.ts
   end
 end
 
-open Base
+include CF
 
 (* This should be shared by all the Make(A) *)
 let defined_names : (lltype * (string * string)) list ref = ref []
 
+(** Extend CF with context dependent functions *)
 module Make(A : sig val context : llcontext end) = struct
   include A
 
-  include Base
+  include CF
 
   (* shorter names *)
   let classify ty = classify_type !<ty
 open Ltype_intf
 
-module Base : S0
-open Base
+module CF : S0
+include S0
 
+(** Extend CF with context dependent functions *)
 module Make(A : sig val context : Llvm.llcontext end) : S
   (* lots of equalities but we cannot live without them... *)
   with type void = void
   and type 'a vector = 'a vector
   and type ('a, 'b) array_ = ('a, 'b) array_
   and type void_pointer = void_pointer
-  and module WithString = Base.WithString
+  and module WithString = CF.WithString
+        (* CR : if WithString can be removed CF can be gone *)
 module P = Spotlib.Spot.Phantom
 open P.Open
 
-open Ltype.Base
+open Ltype
 
-module Base = struct
+(* Context Free *)
+module CF = struct
   (** phantom *)
   type 'a v = ('a, llvalue) P.t
   type 'a vs = ('a, llvalue) P.ts
     P.unsafe_list (Array.to_list (params !<f))
 end
 
-open Base
+include CF
 
 module Make(A : sig val context : llcontext end) = struct
   include A
-  include Base
+  include CF
 
   module Ltype = Ltype.Make(A)
 
 open Llvm
-open Ltype.Base
+open Ltype
 open Lvalue_intf
 
-module Base : S0
-open Base
+include S0
 
 module Make(A : sig val context : llcontext end) : S
-open Ltype.Base
+open Ltype
 open Spotlib.Spot.Phantom
 
 module type S0 = sig
 module type S = sig
   val context : Llvm.llcontext
 
-  open Lvalue.Base
+  open Lvalue
   module Value : Lvalue_intf.S
 
-  open Ltype.Base
+  open Ltype
   module Type : sig
     include Ltype_intf.S
 	(* lots of equalities but we cannot live without them... *)