IR: Give 'DI' prefix to debug info metadata
[oota-llvm.git] / bindings / ocaml / bitwriter / bitwriter_ocaml.c
index 1045c2344a70f5978345ec7869d0b33aa41a50a4..04fd61917dc6205979d36b64c8c314bcb5effc94 100644 (file)
@@ -21,8 +21,6 @@
 #include "caml/mlvalues.h"
 #include "caml/memory.h"
 
-/*===-- BitWriter ---------------------------------------------------------===*/
-
 /* Llvm.llmodule -> string -> bool */
 CAMLprim value llvm_write_bitcode_file(LLVMModuleRef M, value Path) {
   int Result = LLVMWriteBitcodeToFile(M, String_val(Path));
@@ -43,3 +41,8 @@ CAMLprim value llvm_write_bitcode_to_fd(value U, LLVMModuleRef M, value FD) {
   Result = LLVMWriteBitcodeToFD(M, Int_val(FD), 0, Unbuffered);
   return Val_bool(Result == 0);
 }
+
+/* Llvm.llmodule -> Llvm.llmemorybuffer */
+CAMLprim LLVMMemoryBufferRef llvm_write_bitcode_to_memory_buffer(LLVMModuleRef M) {
+  return LLVMWriteBitcodeToMemoryBuffer(M);
+}