427015c6c6456561b0255a04d490d5985ad334a3
[oota-llvm.git] / include / llvm / Analysis / Verifier.h
1 //===-- llvm/Analysis/Verifier.h - Module Verifier --------------*- C++ -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the function verifier interface, that can be used for some
11 // sanity checking of input to the system, and for checking that transformations
12 // haven't done something bad.
13 //
14 // Note that this does not provide full 'java style' security and verifications,
15 // instead it just tries to ensure that code is well formed.
16 //
17 // To see what specifically is checked, look at the top of Verifier.cpp
18 //
19 //===----------------------------------------------------------------------===//
20
21 #ifndef LLVM_ANALYSIS_VERIFIER_H
22 #define LLVM_ANALYSIS_VERIFIER_H
23
24 class FunctionPass;
25 class Module;
26 class Function;
27
28 // createVerifierPass - Check a module or function for validity.  If errors are
29 // detected, error messages corresponding to the problem are printed to stderr.
30 //
31 FunctionPass *createVerifierPass();
32
33 // verifyModule - Check a module for errors, printing messages on stderr.
34 // Return true if the module is corrupt.  This should only be used for
35 // debugging, because it plays games with PassManagers and stuff.
36 //
37 bool verifyModule(const Module &M);
38
39 // verifyFunction - Check a function for errors, useful for use when debugging a
40 // pass.
41 bool verifyFunction(const Function &F);
42
43 #endif