summaryrefslogtreecommitdiff
path: root/bindings/ocaml/llvm/llvm.ml
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/ocaml/llvm/llvm.ml')
-rw-r--r--bindings/ocaml/llvm/llvm.ml22
1 files changed, 22 insertions, 0 deletions
diff --git a/bindings/ocaml/llvm/llvm.ml b/bindings/ocaml/llvm/llvm.ml
index 259d57bc068..5e149d44c41 100644
--- a/bindings/ocaml/llvm/llvm.ml
+++ b/bindings/ocaml/llvm/llvm.ml
@@ -283,6 +283,14 @@ module ValueKind = struct
| Instruction of Opcode.t
end
+module DiagnosticSeverity = struct
+ type t =
+ | Error
+ | Warning
+ | Remark
+ | Note
+end
+
exception IoError of string
let () = Callback.register_exception "Llvm.IoError" (IoError "")
@@ -304,6 +312,20 @@ type ('a, 'b) llrev_pos =
| At_start of 'a
| After of 'b
+
+(*===-- Context error handling --------------------------------------------===*)
+module Diagnostic = struct
+ type t
+
+ external description : t -> string = "llvm_get_diagnostic_description"
+ external severity : t -> DiagnosticSeverity.t
+ = "llvm_get_diagnostic_severity"
+end
+
+external set_diagnostic_handler
+ : llcontext -> (Diagnostic.t -> unit) option -> unit
+ = "llvm_set_diagnostic_handler"
+
(*===-- Contexts ----------------------------------------------------------===*)
external create_context : unit -> llcontext = "llvm_create_context"
external dispose_context : llcontext -> unit = "llvm_dispose_context"