Commits

camlspotter committed eb257b9

cleanup

Comments (0)

Files changed (4)

   (* let icmp c = cmp "icmped" (Llvm.build_icmp c)
      let fcmp c = cmp "fcmped" (Llvm.build_fcmp c) *)
 
+  let ( land_ ) ?name = arith "landed" Llvm.build_and ?name
+  let ( &! ) x = land_ ?name:None x
+
   (** Arithmetic type conversion *)
 
   let sitofp ?(name="sitofped") i ty = 

lib/build_intf.ml

   val ( *.! ) : ([>`floating] as 'a) v -> 'a v -> 'a v m
   val ( /.! ) : ([>`floating] as 'a) v -> 'a v -> 'a v m
 
+  val land_ : ?name:string -> ([>`int] as 'a) v -> 'a v -> 'a v m
+  val ( &! ) : ([>`int] as 'a) v -> 'a v -> 'a v m
+
   (** {6 Arithmetic type conversion} *)
 
   val sitofp : ?name:string -> [>`int] v -> ([>`floating] as 'a) typ -> 'a v m
 open Phantom.Open
 
+(* `int and `llvalue cannot be reduced to Llvm value in this module
+   since we are here independent from the context. *)
+
 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 gen k f = f { rev = []; k = k; }
 let end_ st = st.k (List.rev st.rev)
   

lib/value_intf.ml

 module type S = sig
   include S0
 
-  type ('a, 'final, 'res) gep_t (* equal to Value.Gep.t *)
+  type ('a, 'final, 'res) gep_t (* equal to Gep.t *)
 
   module Const : sig
     val int : int -> [`int] v