1 (*===-- llvm_analysis.mli - LLVM Ocaml Interface ----------------*- C++ -*-===*
3 * The LLVM Compiler Infrastructure
5 * This file is distributed under the University of Illinois Open Source
6 * License. See LICENSE.TXT for details.
8 *===----------------------------------------------------------------------===
10 * This interface provides an ocaml API for LLVM IR analyses, the classes in
11 * the Analysis library.
13 *===----------------------------------------------------------------------===*)
16 (** [verify_module m] returns [None] if the module [m] is valid, and
17 [Some reason] if it is invalid. [reason] is a string containing a
18 human-readable validation report. See [llvm::verifyModule]. **)
19 external verify_module : Llvm.llmodule -> string option = "llvm_verify_module"
21 (** [verify_function f] returns [None] if the function [f] is valid, and
22 [Some reason] if it is invalid. [reason] is a string containing a
23 human-readable validation report. See [llvm::verifyFunction]. **)
24 external verify_function : Llvm.llvalue -> bool = "llvm_verify_function"
26 (** [verify_module m] returns if the module [m] is valid, but prints a
27 validation report to [stderr] and aborts the program if it is invalid. See
28 [llvm::verifyModule]. **)
29 external assert_valid_module : Llvm.llmodule -> unit
30 = "llvm_assert_valid_module"
32 (** [verify_function f] returns if the function [f] is valid, but prints a
33 validation report to [stderr] and aborts the program if it is invalid. See
34 [llvm::verifyFunction]. **)
35 external assert_valid_function : Llvm.llvalue -> unit
36 = "llvm_assert_valid_function"