Add some methos specific info
[libfirm] / ir / ir / irvrfy.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/ir/irvrfy.h
4  * Purpose:     Check irnodes for correctness.
5  * Author:      Christian Schaefer
6  * Modified by: Goetz Lindenmaier. Till Riedel
7  * Created:
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 1998-2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 /**
14 * @file irvrfy.h
15 *
16 * ir graph verification.
17 *
18 * @author Christian Schaefer
19 */
20
21 # ifndef _IRVRFY_H_
22 # define _IRVRFY_H_
23
24 # include "irnode.h"
25 # include "irgraph.h"
26
27 typedef enum _node_verification_t
28 {
29   NODE_VERIFICATION_OFF        = 0,             /**< do not verify nodes at all */
30   NODE_VERIFICATION_ON         = 1,             /**< do node verification and assert on error in debug version */
31   NODE_VERIFICATION_REPORT     = 2,             /**< do node verification, but report to stderr only */
32   NODE_VERIFICATION_ERROR_ONLY = 3              /**< do node verification, but NEVER do assert nor report */
33 } node_verification_t;
34
35 /** Select verification of nodes.
36  *
37  *  Per default the  verification is in mode NODE_VERIFICATION_ASSERT.
38  *  Turn the verification off during development to check partial implementations.
39  */
40 void do_node_verification(node_verification_t mode);
41
42 /**
43  * Tests the modes of checknode and its predecessors.
44  * Checknode must be in current_ir_graph.
45  *
46  * \return
47  *      NON-zero on success
48  */
49 int irn_vrfy(struct ir_node *checknode);
50
51 /**
52  * Tests the modes of checknode and its predecessors.
53  * Checknode must be in given ir_graph.
54  *
55  * \return
56  *      NON-zero on success
57  */
58 int irn_vrfy_irg(struct ir_node *checknode, ir_graph *irg);
59
60 /**
61  * Same as irn_vrfy_irg, but temporary sets verification mode to
62  * NODE_VERIFICATION_ERROR_ONLY.
63  * \return
64  *      NON-zero on success
65  */
66 int irn_vrfy_irg_dump(struct ir_node *checknode, ir_graph *irg, const char **bad_string);
67
68 /**
69  * Calls irn_vrfy for each node in irg.
70  * Graph must be in state "pinned".
71  *
72  * \return
73  *      NON-zero on success.
74  */
75 int irg_vrfy(ir_graph *irg);
76
77 # endif /* _IRVRFY_H_ */