7992ad1d0da07387da42c6f6631a2babec9b2ce0
[oota-llvm.git] / bindings / ocaml / analysis / llvm_analysis.mli
1 (*===-- llvm_analysis.mli - LLVM Ocaml Interface ----------------*- C++ -*-===*
2  *
3  *                     The LLVM Compiler Infrastructure
4  *
5  * This file is distributed under the University of Illinois Open Source
6  * License. See LICENSE.TXT for details.
7  *
8  *===----------------------------------------------------------------------===
9  *
10  * This interface provides an ocaml API for LLVM IR analyses, the classes in
11  * the Analysis library.
12  *
13  *===----------------------------------------------------------------------===*)
14
15
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"
20
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"
25
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"
31
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"