3 * File name: ir/ir/irvrfy.h
4 * Purpose: Check irnodes for correctness.
5 * Author: Christian Schaefer
6 * Modified by: Goetz Lindenmaier. Till Riedel
9 * Copyright: (c) 1998-2003 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
16 * ir graph verification.
18 * @author Christian Schaefer
23 #include "firm_types.h"
26 * Tests the modes of checknode and its predecessors.
27 * checknode must be in current_ir_graph.
32 int irn_vrfy(ir_node *checknode);
35 * Tests the modes of checknode and its predecessors.
36 * checknode must be in given ir_graph.
41 int irn_vrfy_irg(ir_node *checknode, ir_graph *irg);
44 * Same as irn_vrfy_irg, but temporary sets verification mode to
45 * NODE_VERIFICATION_ERROR_ONLY.
49 int irn_vrfy_irg_dump(ir_node *checknode, ir_graph *irg, const char **bad_string);
52 * Flags for irg_verify().
54 typedef enum _irg_verify_flags_t {
55 VRFY_NORMAL = 0, /**< check SSA property only if dominance information is available */
56 VRFY_ENFORCE_SSA = 1 /**< check SSA property by enforcing the dominance information recalculation */
60 * Calls irn_vrfy() for each node in irg.
61 * Graph must be in state "op_pin_state_pinned".
64 * NON-zero on success.
66 int irg_verify(ir_graph *irg, unsigned flags);
69 * Compatibility macro. Deprecated soon.
71 #define irg_vrfy(irg) irg_verify(irg, 0)
74 * Possible flags for irg_vrfy_bads().
76 enum verify_bad_flags_t {
77 BAD_CF = 1, /**< Bad nodes are allowed as predecessors of Blocks and Phis. */
78 BAD_DF = 2, /**< Bad nodes are allowed as dataflow predecessors. */
79 BAD_BLOCK = 4, /**< Bad nodes are allowed as Block input. */
80 TUPLE = 8 /**< Tuple nodes are allowed. */
84 * Verify occurrence of bad nodes in a graph.
86 * @param irg The graph to verify
87 * @param flags combination of verify_bad_flags_t flags describing
88 * which Bads are allowed
89 * @returns a value combined of verify_bad_flags_t indicating the problems found.
91 int irg_vrfy_bads(ir_graph *irg, int flags);
94 * Enable/disable verification of Load/Store nodes with
95 * its entities. If disabled, Store(SymConst(array)) will be allowed
96 * (C-frontend builds this :-)
98 void vrfy_enable_entity_tests(int enable);
100 # endif /* _IRVRFY_H_ */