|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
-|* This file was developed by Gordon Henriksen and is distributed under the *|
-|* University of Illinois Open Source License. See LICENSE.TXT for details. *|
+|* This file is distributed under the University of Illinois Open Source *|
+|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
#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
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 */
+#ifdef CAMLnoreturn
+ CAMLnoreturn; /* Silences warnings, but is missing in some versions. */
+#endif
+}
/*===-- Modules -----------------------------------------------------------===*/