3 * File name: ir/ir/irvrfy_t.h
4 * Purpose: New checker of irnodes for correctness.
9 * Copyright: (c) 1998-2005 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
17 extern node_verification_t opt_do_node_verification;
18 extern const char *firm_vrfy_failure_msg;
22 * in RELEASE mode, returns ret if the expression expr evaluates to zero
23 * in ASSERT mode, asserts the expression expr (and the string string).
25 #define ASSERT_AND_RET(expr, string, ret) if (!(expr)) return (ret)
28 * in RELEASE mode, returns ret if the expression expr evaluates to zero
29 * in ASSERT mode, executes blk if the expression expr evaluates to zero and asserts expr
31 #define ASSERT_AND_RET_DBG(expr, string, ret, blk) if (!(expr)) return (ret)
33 #define ASSERT_AND_RET(expr, string, ret) \
35 if (opt_do_node_verification == NODE_VERIFICATION_ON) {\
36 if (!(expr) && current_ir_graph != get_const_code_irg()) \
37 dump_ir_block_graph(current_ir_graph, "-assert"); \
38 assert((expr) && string); } \
40 if (opt_do_node_verification == NODE_VERIFICATION_REPORT) \
41 fprintf(stderr, #expr " : " string "\n"); \
42 firm_vrfy_failure_msg = #expr " && " string; \
47 #define ASSERT_AND_RET_DBG(expr, string, ret, blk) \
50 firm_vrfy_failure_msg = #expr " && " string; \
51 if (opt_do_node_verification != NODE_VERIFICATION_ERROR_ONLY) { blk; } \
52 if (opt_do_node_verification == NODE_VERIFICATION_REPORT) \
53 fprintf(stderr, #expr " : " string "\n"); \
54 else if (opt_do_node_verification == NODE_VERIFICATION_ON) \
55 assert((expr) && string); \
63 * Set the default verify_node and verify_proj_node operation.
65 void firm_set_default_verifyer(ir_op *op);
67 #endif /* _IRVRFY_T_H_ */