[OCaml] Fix undefined reference to LLVMDumpType() with NDEBUG
authorMichal Gorny <mgorny@gentoo.org>
Thu, 27 Jul 2017 21:13:25 +0000 (21:13 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Thu, 27 Jul 2017 21:13:25 +0000 (21:13 +0000)
commit83012b4721d53ddc8052f44ad4bd31ea77a22b0b
tree20985dc857c641ff4e133bb511f2ffc4648ec61a
parent3073ff9fd3122becd371931e0af5f36833421eff
[OCaml] Fix undefined reference to LLVMDumpType() with NDEBUG

Account for the possibility of LLVMDumpType() not being available with
NDEBUG in the OCaml bindings. If it is not built into LLVM, make
the dump function raise an exception.

Since rL293359, the dump functions are built only if either NDEBUG is
not defined, or LLVM_ENABLE_DUMP is defined. As a result, if the dump
functions are not built in LLVM, the dynamic OCaml libraries fail to
load due to undefined LLVMDumpType symbol.

Differential Revision: https://reviews.llvm.org/D35899

llvm-svn: 309321
llvm/bindings/ocaml/llvm/llvm.ml
llvm/bindings/ocaml/llvm/llvm.mli
llvm/bindings/ocaml/llvm/llvm_ocaml.c