[OCaml] Fix ocamlc -custom builds when configured as --enable-shared.
[oota-llvm.git] / bindings / ocaml / bitwriter / llvm_bitwriter.ml
index 3e69a3cc8fbba799571cf1d0999a5717b75334b5..fca6efa4a75b2af6fdb6f412ec7f222c9209dee5 100644 (file)
@@ -1,4 +1,4 @@
-(*===-- llvm_bitwriter.ml - LLVM Ocaml Interface ----------------*- C++ -*-===*
+(*===-- llvm_bitwriter.ml - LLVM OCaml Interface --------------*- OCaml -*-===*
  *
  *                     The LLVM Compiler Infrastructure
  *
@@ -7,19 +7,22 @@
  *
  *===----------------------------------------------------------------------===
  *
- * This interface provides an ocaml API for the LLVM intermediate
+ * This interface provides an OCaml API for the LLVM intermediate
  * representation, the classes in the VMCore library.
  *
  *===----------------------------------------------------------------------===*)
 
+external write_bitcode_file
+  : Llvm.llmodule -> string -> bool
+  = "llvm_write_bitcode_file"
 
-(* Writes the bitcode for module the given path. Returns true if successful. *)
-external write_bitcode_file : Llvm.llmodule -> string -> bool
-                            = "llvm_write_bitcode_file"
+external write_bitcode_to_fd
+  : ?unbuffered:bool -> Llvm.llmodule -> Unix.file_descr -> bool
+  = "llvm_write_bitcode_to_fd"
 
-external write_bitcode_to_fd : ?unbuffered:bool -> Llvm.llmodule
-                               -> Unix.file_descr -> bool
-                             = "llvm_write_bitcode_to_fd"
+external write_bitcode_to_memory_buffer
+  : Llvm.llmodule -> Llvm.llmemorybuffer
+  = "llvm_write_bitcode_to_memory_buffer"
 
 let output_bitcode ?unbuffered channel m =
   write_bitcode_to_fd ?unbuffered m (Unix.descr_of_out_channel channel)