aboutsummaryrefslogtreecommitdiff
path: root/llvm/bindings/ocaml/linker/linker_ocaml.c
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2014-10-29 08:15:54 +0000
committerPeter Zotov <whitequark@whitequark.org>2014-10-29 08:15:54 +0000
commit662538ac404c94ddfb92bd9def67d0e5034b45ec (patch)
treed9c72364adb81b10779fb8f900720d9518027255 /llvm/bindings/ocaml/linker/linker_ocaml.c
parente447b61c5036a7d0e3ff680ed46a9dfab33c431a (diff)
downloadllvm-662538ac404c94ddfb92bd9def67d0e5034b45ec.zip
llvm-662538ac404c94ddfb92bd9def67d0e5034b45ec.tar.gz
llvm-662538ac404c94ddfb92bd9def67d0e5034b45ec.tar.bz2
[OCaml] Drop support for 3.12.1 and earlier.
In practice this means: * Always using -g flag. * Embedding -cclib -lstdc++ into the corresponding cma/cmxa file. This also moves -lstdc++ in a single place. * Using caml_named_value instead of a homegrown mechanism. llvm-svn: 220843
Diffstat (limited to 'llvm/bindings/ocaml/linker/linker_ocaml.c')
-rw-r--r--llvm/bindings/ocaml/linker/linker_ocaml.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/llvm/bindings/ocaml/linker/linker_ocaml.c b/llvm/bindings/ocaml/linker/linker_ocaml.c
index 2491e3b..553fbd9 100644
--- a/llvm/bindings/ocaml/linker/linker_ocaml.c
+++ b/llvm/bindings/ocaml/linker/linker_ocaml.c
@@ -19,14 +19,7 @@
#include "caml/alloc.h"
#include "caml/memory.h"
#include "caml/fail.h"
-
-static value llvm_linker_error_exn;
-
-CAMLprim value llvm_register_linker_exns(value Error) {
- llvm_linker_error_exn = Field(Error, 0);
- register_global_root(&llvm_linker_error_exn);
- return Val_unit;
-}
+#include "caml/callback.h"
static void llvm_raise(value Prototype, char *Message) {
CAMLparam1(Prototype);
@@ -36,19 +29,15 @@ static void llvm_raise(value Prototype, char *Message) {
LLVMDisposeMessage(Message);
raise_with_arg(Prototype, CamlMessage);
- abort(); /* NOTREACHED */
-#ifdef CAMLnoreturn
- CAMLnoreturn; /* Silences warnings, but is missing in some versions. */
-#endif
+ CAMLnoreturn;
}
-/* llmodule -> llmodule -> Mode.t -> unit
- raises Error msg on error */
+/* llmodule -> llmodule -> Mode.t -> unit */
CAMLprim value llvm_link_modules(LLVMModuleRef Dst, LLVMModuleRef Src, value Mode) {
char* Message;
if (LLVMLinkModules(Dst, Src, Int_val(Mode), &Message))
- llvm_raise(llvm_linker_error_exn, Message);
+ llvm_raise(*caml_named_value("Llvm_linker.Error"), Message);
return Val_unit;
}