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.
19 extern const char *firm_vrfy_failure_msg;
23 * in RELEASE mode, returns ret if the expression expr evaluates to zero
24 * in ASSERT mode, asserts the expression expr (and the string string).
26 #define ASSERT_AND_RET(expr, string, ret) do { if (!(expr)) return (ret); } while (0)
29 * in RELEASE mode, returns ret if the expression expr evaluates to zero
30 * in ASSERT mode, executes blk if the expression expr evaluates to zero and asserts expr
32 #define ASSERT_AND_RET_DBG(expr, string, ret, blk) do { if (!(expr)) return (ret); } while (0)
34 #define ASSERT_AND_RET(expr, string, ret) \
36 if (opt_do_node_verification == FIRM_VERIFICATION_ON) {\
37 if (!(expr) && current_ir_graph != get_const_code_irg()) \
38 dump_ir_block_graph(current_ir_graph, "-assert"); \
39 assert((expr) && string); } \
41 if (opt_do_node_verification == FIRM_VERIFICATION_REPORT) \
42 fprintf(stderr, #expr " : " string "\n"); \
43 firm_vrfy_failure_msg = #expr " && " string; \
48 #define ASSERT_AND_RET_DBG(expr, string, ret, blk) \
51 firm_vrfy_failure_msg = #expr " && " string; \
52 if (opt_do_node_verification != FIRM_VERIFICATION_ERROR_ONLY) { blk; } \
53 if (opt_do_node_verification == FIRM_VERIFICATION_REPORT) \
54 fprintf(stderr, #expr " : " string "\n"); \
55 else if (opt_do_node_verification == FIRM_VERIFICATION_ON) { \
56 if (!(expr) && current_ir_graph != get_const_code_irg()) \
57 dump_ir_block_graph(current_ir_graph, "-assert"); \
58 assert((expr) && string); \
67 * Set the default verify_node and verify_proj_node operation for an ir_op_ops.
69 void firm_set_default_verifyer(opcode code, ir_op_ops *ops);
71 #endif /* _IRVRFY_T_H_ */