aboutsummaryrefslogtreecommitdiff
path: root/bindings/ocaml/bitreader/bitreader_ocaml.c
diff options
context:
space:
mode:
authorGordon Henriksen <gordonhenriksen@mac.com>2007-12-23 16:59:28 +0000
committerGordon Henriksen <gordonhenriksen@mac.com>2007-12-23 16:59:28 +0000
commit2e855e68d861224c9b61e2bc9cecad1536b1534b (patch)
tree8e4854d47b8c08d95662a6cc9b1a4c7b03f6a8f1 /bindings/ocaml/bitreader/bitreader_ocaml.c
parentefbcebc95dc8a7936dda8ec5733b6f6d4bd62343 (diff)
C and Ocaml bindings for ExecutionEngine (i.e., the JIT compiler).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45335 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/ocaml/bitreader/bitreader_ocaml.c')
-rw-r--r--bindings/ocaml/bitreader/bitreader_ocaml.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/bindings/ocaml/bitreader/bitreader_ocaml.c b/bindings/ocaml/bitreader/bitreader_ocaml.c
index 87477f6312..980ed2abbf 100644
--- a/bindings/ocaml/bitreader/bitreader_ocaml.c
+++ b/bindings/ocaml/bitreader/bitreader_ocaml.c
@@ -14,9 +14,8 @@
#include "llvm-c/BitReader.h"
#include "caml/alloc.h"
-#include "caml/mlvalues.h"
+#include "caml/fail.h"
#include "caml/memory.h"
-#include <stdio.h>
/* Can't use the recommended caml_named_value mechanism for backwards
@@ -29,7 +28,17 @@ CAMLprim value llvm_register_bitreader_exns(value Error) {
return Val_unit;
}
-void llvm_raise(value Prototype, char *Message);
+static void llvm_raise(value Prototype, char *Message) {
+ CAMLparam1(Prototype);
+ CAMLlocal1(CamlMessage);
+
+ CamlMessage = copy_string(Message);
+ LLVMDisposeMessage(Message);
+
+ raise_with_arg(Prototype, CamlMessage);
+ abort(); /* NOTREACHED */
+ CAMLnoreturn;
+}
/*===-- Modules -----------------------------------------------------------===*/