summaryrefslogtreecommitdiff
path: root/bindings/ocaml/llvm/llvm_ocaml.c
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/ocaml/llvm/llvm_ocaml.c')
-rw-r--r--bindings/ocaml/llvm/llvm_ocaml.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c
index 4b6d1c5072b..137b17f26bf 100644
--- a/bindings/ocaml/llvm/llvm_ocaml.c
+++ b/bindings/ocaml/llvm/llvm_ocaml.c
@@ -336,7 +336,12 @@ CAMLprim LLVMContextRef llvm_type_context(LLVMTypeRef Ty) {
/* 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;
}