2 * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @brief New checker of irnodes for correctness.
23 * @author Michael Beck
26 #ifndef FIRM_IR_IRVRFY_T_H
27 #define FIRM_IR_IRVRFY_T_H
35 extern const char *firm_vrfy_failure_msg;
39 * in RELEASE mode, returns ret if the expression expr evaluates to zero
40 * in ASSERT mode, asserts the expression expr (and the string string).
42 #define ASSERT_AND_RET(expr, string, ret) do { if (!(expr)) return (ret); } while (0)
45 * in RELEASE mode, returns ret if the expression expr evaluates to zero
46 * in ASSERT mode, executes blk if the expression expr evaluates to zero and asserts expr
48 #define ASSERT_AND_RET_DBG(expr, string, ret, blk) do { if (!(expr)) return (ret); } while (0)
50 #define ASSERT_AND_RET(expr, string, ret) \
52 if (opt_do_node_verification == FIRM_VERIFICATION_ON) {\
53 if (!(expr) && current_ir_graph != get_const_code_irg()) \
54 dump_ir_block_graph_sched(current_ir_graph, "-assert"); \
55 assert((expr) && string); } \
57 if (opt_do_node_verification == FIRM_VERIFICATION_REPORT) \
58 fprintf(stderr, #expr " : " string "\n"); \
59 firm_vrfy_failure_msg = #expr " && " string; \
64 #define ASSERT_AND_RET_DBG(expr, string, ret, blk) \
67 firm_vrfy_failure_msg = #expr " && " string; \
68 if (opt_do_node_verification != FIRM_VERIFICATION_ERROR_ONLY) { blk; } \
69 if (opt_do_node_verification == FIRM_VERIFICATION_REPORT) \
70 fprintf(stderr, #expr " : " string "\n"); \
71 else if (opt_do_node_verification == FIRM_VERIFICATION_ON) { \
72 if (!(expr) && current_ir_graph != get_const_code_irg()) \
73 dump_ir_block_graph_sched(current_ir_graph, "-assert"); \
74 assert((expr) && string); \
83 * Set the default verify_node and verify_proj_node operation for an ir_op_ops.
85 void firm_set_default_verifyer(ir_opcode code, ir_op_ops *ops);