[PATCH] D35899: [OCaml] Fix undefined reference to LLVMDumpType() with NDEBUG
Michał Górny via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 27 14:15:49 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL309321: [OCaml] Fix undefined reference to LLVMDumpType() with NDEBUG (authored by mgorny).
Changed prior to commit:
https://reviews.llvm.org/D35899?vs=108318&id=108525#toc
Repository:
rL LLVM
https://reviews.llvm.org/D35899
Files:
llvm/trunk/bindings/ocaml/llvm/llvm.ml
llvm/trunk/bindings/ocaml/llvm/llvm.mli
llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
Index: llvm/trunk/bindings/ocaml/llvm/llvm.mli
===================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.mli
+++ llvm/trunk/bindings/ocaml/llvm/llvm.mli
@@ -371,6 +371,8 @@
(** {6 Exceptions} *)
+exception FeatureDisabled of string
+
exception IoError of string
Index: llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
===================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
+++ llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
@@ -336,7 +336,12 @@
/* lltype -> unit */
CAMLprim value llvm_dump_type(LLVMTypeRef Val) {
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVMDumpType(Val);
+#else
+ caml_raise_with_arg(*caml_named_value("Llvm.FeatureDisabled"),
+ caml_copy_string("dump"));
+#endif
return Val_unit;
}
Index: llvm/trunk/bindings/ocaml/llvm/llvm.ml
===================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.ml
+++ llvm/trunk/bindings/ocaml/llvm/llvm.ml
@@ -20,6 +20,10 @@
type llmemorybuffer
type llmdkind
+exception FeatureDisabled of string
+
+let () = Callback.register_exception "Llvm.FeatureDisabled" (FeatureDisabled "")
+
module TypeKind = struct
type t =
| Void
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35899.108525.patch
Type: text/x-patch
Size: 1273 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170727/dd332623/attachment.bin>
More information about the llvm-commits
mailing list