[llvm-commits] [llvm] r97367 - in /llvm/trunk: bindings/ocaml/llvm/llvm.ml bindings/ocaml/llvm/llvm.mli bindings/ocaml/llvm/llvm_ocaml.c test/Bindings/Ocaml/vmcore.ml

Erick Tryzelaar idadesub at users.sourceforge.net
Sat Feb 27 21:51:09 PST 2010


Author: erickt
Date: Sat Feb 27 23:51:09 2010
New Revision: 97367

URL: http://llvm.org/viewvc/llvm-project?rev=97367&view=rev
Log:
Remove malloc and free from the ocaml bindings.

Modified:
    llvm/trunk/bindings/ocaml/llvm/llvm.ml
    llvm/trunk/bindings/ocaml/llvm/llvm.mli
    llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
    llvm/trunk/test/Bindings/Ocaml/vmcore.ml

Modified: llvm/trunk/bindings/ocaml/llvm/llvm.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.ml?rev=97367&r1=97366&r2=97367&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.ml (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.ml Sat Feb 27 23:51:09 2010
@@ -745,15 +745,10 @@
                    = "llvm_build_not"
 
 (*--... Memory .............................................................--*)
-external build_malloc : lltype -> string -> llbuilder -> llvalue
-                      = "llvm_build_malloc"
-external build_array_malloc : lltype -> llvalue -> string -> llbuilder ->
-                              llvalue = "llvm_build_array_malloc"
 external build_alloca : lltype -> string -> llbuilder -> llvalue
                       = "llvm_build_alloca"
 external build_array_alloca : lltype -> llvalue -> string -> llbuilder ->
                               llvalue = "llvm_build_array_alloca"
-external build_free : llvalue -> llbuilder -> llvalue = "llvm_build_free"
 external build_load : llvalue -> string -> llbuilder -> llvalue
                     = "llvm_build_load"
 external build_store : llvalue -> llvalue -> llbuilder -> llvalue

Modified: llvm/trunk/bindings/ocaml/llvm/llvm.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.mli?rev=97367&r1=97366&r2=97367&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.mli (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.mli Sat Feb 27 23:51:09 2010
@@ -1628,20 +1628,6 @@
 
 (** {7 Memory} *)
 
-(** [build_malloc ty name b] creates a
-    [%name = malloc %ty]
-    instruction at the position specified by the instruction builder [b].
-    See the method [llvm::LLVMBuilder::CreateAlloca]. *)
-external build_malloc : lltype -> string -> llbuilder -> llvalue
-                      = "llvm_build_malloc"
-
-(** [build_array_malloc ty n name b] creates a
-    [%name = malloc %ty, %n]
-    instruction at the position specified by the instruction builder [b].
-    See the method [llvm::LLVMBuilder::CreateMalloc]. *)
-external build_array_malloc : lltype -> llvalue -> string -> llbuilder ->
-                              llvalue = "llvm_build_array_malloc"
-
 (** [build_alloca ty name b] creates a
     [%name = alloca %ty]
     instruction at the position specified by the instruction builder [b].
@@ -1656,12 +1642,6 @@
 external build_array_alloca : lltype -> llvalue -> string -> llbuilder ->
                               llvalue = "llvm_build_array_alloca"
 
-(** [build_free v b] creates a
-    [free %v]
-    instruction at the position specified by the instruction builder [b].
-    See the method [llvm::LLVMBuilder::CreateFree]. *)
-external build_free : llvalue -> llbuilder -> llvalue = "llvm_build_free"
-
 (** [build_load v name b] creates a
     [%name = load %v]
     instruction at the position specified by the instruction builder [b].

Modified: llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c?rev=97367&r1=97366&r2=97367&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c Sat Feb 27 23:51:09 2010
@@ -1204,18 +1204,6 @@
 /*--... Memory .............................................................--*/
 
 /* lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_malloc(LLVMTypeRef Ty,
-                                        value Name, value B) {
-  return LLVMBuildMalloc(Builder_val(B), Ty, String_val(Name));
-}
-
-/* lltype -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_array_malloc(LLVMTypeRef Ty, LLVMValueRef Size,
-                                              value Name, value B) {
-  return LLVMBuildArrayMalloc(Builder_val(B), Ty, Size, String_val(Name));
-}
-
-/* lltype -> string -> llbuilder -> llvalue */
 CAMLprim LLVMValueRef llvm_build_alloca(LLVMTypeRef Ty,
                                         value Name, value B) {
   return LLVMBuildAlloca(Builder_val(B), Ty, String_val(Name));
@@ -1227,11 +1215,6 @@
   return LLVMBuildArrayAlloca(Builder_val(B), Ty, Size, String_val(Name));
 }
 
-/* llvalue -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_free(LLVMValueRef Pointer, value B) {
-  return LLVMBuildFree(Builder_val(B), Pointer);
-}
-
 /* llvalue -> string -> llbuilder -> llvalue */
 CAMLprim LLVMValueRef llvm_build_load(LLVMValueRef Pointer,
                                       value Name, value B) {

Modified: llvm/trunk/test/Bindings/Ocaml/vmcore.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/vmcore.ml?rev=97367&r1=97366&r2=97367&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/Ocaml/vmcore.ml (original)
+++ llvm/trunk/test/Bindings/Ocaml/vmcore.ml Sat Feb 27 23:51:09 2010
@@ -937,21 +937,15 @@
     let bb08 = append_block context "Bb08" fn in
     let b = builder_at_end context bb08 in
 
-    (* RUN: grep {Inst20.*malloc} < %t.ll
-     * RUN: grep {Inst21.*malloc} < %t.ll
-     * RUN: grep {Inst22.*alloca.*i32 } < %t.ll
+    (* RUN: grep {Inst22.*alloca.*i32 } < %t.ll
      * RUN: grep {Inst23.*alloca.*i32.*P2} < %t.ll
-     * RUN: grep {free.*Inst20} < %t.ll
-     * RUN: grep {Inst25.*load.*Inst21} < %t.ll
+     * RUN: grep {Inst25.*load.*Inst23} < %t.ll
      * RUN: grep {store.*P2.*Inst22} < %t.ll
      * RUN: grep {Inst27.*getelementptr.*Inst23.*P2} < %t.ll
      *)
-    let inst20 = build_malloc i8_type "Inst20" b in
-    let inst21 = build_array_malloc i8_type p1 "Inst21" b in
     let inst22 = build_alloca i32_type "Inst22" b in
     let inst23 = build_array_alloca i32_type p2 "Inst23" b in
-          ignore(build_free inst20 b);
-          ignore(build_load inst21 "Inst25" b);
+          ignore(build_load inst23 "Inst25" b);
           ignore(build_store p2 inst22 b);
           ignore(build_gep inst23 [| p2 |] "Inst27" b);
           ignore(build_unreachable b)





More information about the llvm-commits mailing list