diff options
author | Michal Gorny <mgorny@gentoo.org> | 2017-07-27 21:13:25 +0000 |
---|---|---|
committer | Michal Gorny <mgorny@gentoo.org> | 2017-07-27 21:13:25 +0000 |
commit | 876aa0d1c66ddcb1952d5153b4cb8486d5ac0ecc (patch) | |
tree | f46887958b76a3e505f486cc9253d27922fee459 /bindings/ocaml/llvm/llvm.ml | |
parent | d62ee98c2730e0f5fc00711c7225c8ab9ba83423 (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/ocaml/llvm/llvm.ml')
-rw-r--r-- | bindings/ocaml/llvm/llvm.ml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bindings/ocaml/llvm/llvm.ml b/bindings/ocaml/llvm/llvm.ml index 6e8ca662ef6..59f0f178c28 100644 --- a/bindings/ocaml/llvm/llvm.ml +++ b/bindings/ocaml/llvm/llvm.ml @@ -20,6 +20,10 @@ type llattribute type llmemorybuffer type llmdkind +exception FeatureDisabled of string + +let () = Callback.register_exception "Llvm.FeatureDisabled" (FeatureDisabled "") + module TypeKind = struct type t = | Void |