3 * File name: ir/ir/irvrfy.c
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.
17 # include "irgraph_t.h"
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) if (!(expr)) return (ret)
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
32 #define ASSERT_AND_RET_DBG(expr, string, ret, blk) if (!(expr)) return (ret)
34 #define ASSERT_AND_RET(expr, string, ret) do { assert((expr) && string); if (!(expr)) return (ret); } while(0)
35 #define ASSERT_AND_RET_DBG(expr, string, ret, blk) do { if (!(expr)) { { blk } assert(0 && string); return (ret); } } while(0)
38 /* @@@ replace use of array "in" by access functions. */
39 ir_node **get_irn_in(ir_node *node);
41 bool opt_do_node_verification = 1;
42 void do_node_verification(bool b) {
43 opt_do_node_verification = b;
47 * Prints a failure message for a binop
49 static void show_binop_failure(ir_node *n, const char *text)
51 ir_node *left = get_binop_left(n);
52 ir_node *right = get_binop_right(n);
54 fprintf(stderr, "\nFIRM: irn_vrfy_irg() of node %ld %s%s(%s%s, %s%s) did not match (%s)\n",
56 get_irn_opname(n), get_irn_modename(n),
57 get_irn_opname(left), get_irn_modename(left),
58 get_irn_opname(right), get_irn_modename(right),
63 * Prints a failure message for an unop
65 static void show_unop_failure(ir_node *n, const char *text)
67 ir_node *op = get_unop_op(n);
69 fprintf(stderr, "\nFIRM: irn_vrfy_irg() of node %ld %s%s(%s%s) did not match (%s)\n",
71 get_irn_opname(n), get_irn_modename(n),
72 get_irn_opname(op), get_irn_modename(op),
77 * Prints a failure message for a proj
79 static void show_proj_failure(ir_node *n)
81 ir_node *op = get_Proj_pred(n);
82 int proj = get_Proj_proj(n);
84 fprintf(stderr, "\nFIRM: irn_vrfy_irg() of node %ld %s%s %d(%s%s) failed\n" ,
86 get_irn_opname(n), get_irn_modename(n), proj,
87 get_irn_opname(op), get_irn_modename(op));
91 * Show a node and a graph
93 static void show_node_on_graph(ir_graph *irg, ir_node *n)
95 entity *ent = get_irg_ent(irg);
98 fprintf(stderr, "\nFIRM: irn_vrfy_irg() of Entity %s, node %ld %s%s\n",
100 get_irn_node_nr(n), get_irn_opname(n), get_irn_modename(n));
102 fprintf(stderr, "\nFIRM: irn_vrfy_irg() of Graph %p, node %ld %s%s\n",
104 get_irn_node_nr(n), get_irn_opname(n), get_irn_modename(n));
110 static void show_call_param(ir_node *n, type *mt)
114 fprintf(stderr, "\nFIRM: irn_vrfy_irg() Call type-check failed: %s(", get_type_name(mt));
115 for (i = 0; i < get_method_n_params(mt); ++i) {
116 fprintf(stderr, "%s ", get_mode_name(get_type_mode(get_method_param_type(mt, i))));
118 fprintf(stderr, ") != CALL(");
120 for (i = 0; i < get_Call_n_params(n); ++i) {
121 fprintf(stderr, "%s ", get_mode_name(get_irn_mode(get_Call_param(n, i))));
123 fprintf(stderr, ")\n");
128 vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
133 pred = skip_nop(get_Proj_pred(p));
134 assert(get_irn_mode(pred) == mode_T);
135 mode = get_irn_mode(p);
136 proj = get_Proj_proj(p);
138 switch (get_irn_opcode(pred)) {
142 (proj == pns_initial_exec && mode == mode_X) ||
143 (proj == pns_global_store && mode == mode_M) ||
144 (proj == pns_frame_base && mode_is_reference(mode)) ||
145 (proj == pns_globals && mode_is_reference(mode)) ||
146 (proj == pns_args && mode == mode_T) ||
147 (proj == pns_value_arg_base && mode_is_reference(mode))
149 "wrong Proj from Start", 0,
150 show_proj_failure(p);
156 (proj >= 0 && mode == mode_X),
157 "wrong Proj from Cond", 0,
158 show_proj_failure(p);
164 ((proj == pn_Raise_X && mode == mode_X) || (proj == pn_Raise_M && mode == mode_M)),
165 "wrong Proj from Raise", 0,
166 show_proj_failure(p);
172 (proj >= 0 && mode == mode_X),
173 "wrong Proj from InstOf", 0,
174 show_proj_failure(p);
180 ((proj == pn_Call_M_regular && mode == mode_M) ||
181 (proj == pn_Call_X_except && mode == mode_X) ||
182 (proj == pn_Call_T_result && mode == mode_T) ||
183 (proj == pn_Call_M_except && mode == mode_M) ||
184 (proj == pn_Call_P_value_res_base && mode == mode_P)),
185 "wrong Proj from Call", 0,
186 show_proj_failure(p);
192 ((proj == pn_Quot_M && mode == mode_M) ||
193 (proj == pn_Quot_X_except && mode == mode_X) ||
194 (proj == pn_Quot_res && mode_is_float(mode))),
195 "wrong Proj from Quot", 0,
196 show_proj_failure(p);
202 ((proj == pn_DivMod_M && mode == mode_M) ||
203 (proj == pn_DivMod_X_except && mode == mode_X) ||
204 (proj == pn_DivMod_res_div && mode_is_int(mode)) ||
205 (proj == pn_DivMod_res_mod && mode_is_int(mode))),
206 "wrong Proj from DivMod", 0,
207 show_proj_failure(p);
213 ((proj == pn_Div_M && mode == mode_M) ||
214 (proj == pn_Div_X_except && mode == mode_X) ||
215 (proj == pn_Div_res && mode_is_int(mode))),
216 "wrong Proj from Div or Mod", 0,
217 show_proj_failure(p);
223 ((proj == pn_Mod_M && mode == mode_M) ||
224 (proj == pn_Mod_X_except && mode == mode_X) ||
225 (proj == pn_Mod_res && mode_is_int(mode))),
226 "wrong Proj from Div or Mod", 0,
227 show_proj_failure(p);
233 (proj >= 0 && proj <= 15 && mode == mode_b),
234 "wrong Proj from Cmp", 0,
235 show_proj_failure(p);
240 if (proj == pn_Load_res) {
241 ir_node *ptr = get_Load_ptr(pred);
243 if (get_irn_op(ptr) == op_Sel) {
244 ent = get_Sel_entity(ptr);
246 We may not test this, after lowering and optimization the Const can
247 have an unexpected type.
248 else if ((get_irn_op(ptr) == op_Const) &&
249 tarval_is_entity(get_Const_tarval(ptr))) {
250 ent = get_tarval_entity(get_Const_tarval(ptr));
254 (mode == get_type_mode(get_entity_type(ent))),
255 "wrong data Proj from Load", 0,
256 show_proj_failure(p);
262 "wrong data Proj from Load", 0,
263 show_proj_failure(p);
268 ((proj == pn_Load_M && mode == mode_M) ||
269 (proj == pn_Load_X_except && mode == mode_X)),
270 "wrong Proj from Load", 0,
271 show_proj_failure(p);
278 ((proj == pn_Store_M && mode == mode_M) ||
279 (proj == pn_Store_X_except && mode == mode_X)),
280 "wrong Proj from Store", 0,
281 show_proj_failure(p);
288 (proj == pn_Alloc_M && mode == mode_M) ||
289 (proj == pn_Alloc_X_except /* && mode == mode_X*/) ||
290 (proj == pn_Alloc_res && mode_is_reference(mode))
292 "wrong Proj from Alloc", 0,
293 show_proj_failure(p);
299 type *mt; /* A method type */
300 pred = skip_nop(get_Proj_pred(pred));
301 ASSERT_AND_RET((get_irn_mode(pred) == mode_T), "Proj from something not a tuple", 0);
302 switch (get_irn_opcode(pred))
307 (proj >= 0 && mode_is_data(mode)),
308 "wrong Proj from Proj from Start", 0);
309 mt = get_entity_type(get_irg_ent(irg));
311 (proj < get_method_n_params(mt)),
312 "More Projs for args than args in type", 0
314 if ((mode_is_reference(mode)) && is_compound_type(get_method_param_type(mt, proj)))
315 /* value argument */ break;
318 (mode == get_type_mode(get_method_param_type(mt, proj))),
319 "Mode of Proj from Start doesn't match mode of param type.", 0);
326 (proj >= 0 && mode_is_data(mode)),
327 "wrong Proj from Proj from Call", 0);
328 mt = get_Call_type(pred);
330 (proj < get_method_n_ress(mt)),
331 "More Projs for results than results in type.", 0);
332 if ((mode_is_reference(mode)) && is_compound_type(get_method_res_type(mt, proj)))
333 /* value result */ break;
336 (mode == get_type_mode(get_method_res_type(mt, proj))),
337 "Mode of Proj from Call doesn't match mode of result type.", 0);
346 ASSERT_AND_RET(0, "Unknown opcode", 0);
365 ASSERT_AND_RET(0, "Unknown opcode", 0);
372 int irn_vrfy_irg(ir_node *n, ir_graph *irg)
376 ir_mode *mymode, *op1mode = NULL, *op2mode, *op3mode;
377 int op_is_symmetric = 1; /* 0: asymmetric
378 1: operands have identical modes
379 2: modes of operands == mode of this node */
380 type *mt; /* A method type */
384 if (!opt_do_node_verification) return 1;
386 if (! interprocedural_view) {
388 * do NOT check placement in interprocedural view, as we don't always know
389 * the "right" graph ...
392 node_is_in_irgs_storage(irg, n),
393 "Node is not stored on proper IR graph!", 0,
394 show_node_on_graph(irg, n);
398 opcode = get_irn_opcode (n);
400 /* We don't want to test nodes whose predecessors are Bad or Unknown,
401 as we would have to special case that for each operation. */
402 if (opcode != iro_Phi && opcode != iro_Block)
403 for (i = 0; i < get_irn_arity(n); i++) {
404 opcode1 = get_irn_opcode(get_irn_n(n, i));
405 if (opcode1 == iro_Bad /*|| opcode1 == iro_Unknown*/) /* GL: for analyses mode must be correct. */
409 mymode = get_irn_mode (n);
416 for (i = 0; i < get_Block_n_cfgpreds(n); ++i) {
417 ir_node *pred = get_Block_cfgpred(n, i);
421 (get_irn_mode(pred) == mode_X)
424 // End block may only have Return, Raise or fragile ops as preds.
425 if (n == get_irg_end_block(irg))
426 for (i = 0; i < get_Block_n_cfgpreds(n); ++i) {
427 ir_node *pred = skip_Proj(get_Block_cfgpred(n, i));
428 if (is_Proj(pred) || get_irn_op(pred) == op_Tuple)
429 break; // We can not test properly. How many tuples are there?
430 ASSERT_AND_RET(((get_irn_op(pred) == op_Return) ||
432 (get_irn_op(pred) == op_Raise) ||
433 is_fragile_op(pred) ),
434 "End Block node", 0);
436 // irg attr must == graph we are in.
437 if (! interprocedural_view) {
438 ASSERT_AND_RET(((get_irn_irg(n) && get_irn_irg(n) == irg)), "Block node has wrong irg attribute", 0);
445 /* Start: BB --> X x M x ref x data1 x ... x datan x ref */
446 mymode == mode_T, "Start node", 0
453 mymode == mode_X, "Jmp node", 0
460 mymode == mode_X, "Jmp node", 0
465 op1mode = get_irn_mode(in[1]);
467 /* Cond: BB x b --> X x X */
468 (op1mode == mode_b ||
469 /* Cond: BB x int --> X^n */
470 mode_is_int(op1mode) ), "Cond node", 0
472 ASSERT_AND_RET(mymode == mode_T, "Cond mode is not a tuple", 0);
476 op1mode = get_irn_mode(in[1]);
477 /* Return: BB x M x data1 x ... x datan --> X */
478 /* printf("mode: %s, code %s\n", ID_TO_STR(n->mode->name), ID_TO_STR(n->op->name));*/
479 ASSERT_AND_RET( op1mode == mode_M, "Return node", 0 ); /* operand M */
480 for (i=2; i < get_irn_arity(n); i++) {
481 ASSERT_AND_RET( mode_is_data(get_irn_mode(in[i])), "Return node", 0 ); /* operand datai */
483 ASSERT_AND_RET( mymode == mode_X, "Result X", 0 ); /* result X */
484 /* Compare returned results with result types of method type */
485 mt = get_entity_type(get_irg_ent(irg));
486 ASSERT_AND_RET( get_Return_n_ress(n) == get_method_n_ress(mt),
487 "Number of results for Return doesn't match number of results in type.", 0 );
488 for (i = 0; i < get_Return_n_ress(n); i++)
490 get_irn_mode(get_Return_res(n, i)) == get_type_mode(get_method_res_type(mt, i)),
491 "Mode of result for Return doesn't match mode of result type.", 0);
495 op1mode = get_irn_mode(in[1]);
496 op2mode = get_irn_mode(in[2]);
498 /* Sel: BB x M x ref --> X x M */
499 op1mode == mode_M && mode_is_reference(op2mode) &&
500 mymode == mode_T, "Raise node", 0
506 /* Const: BB --> data */
507 (mode_is_data (mymode) ||
508 mymode == mode_b) /* we want boolean constants for static evaluation */
509 ,"Const node", 0 /* of Cmp. */
515 /* SymConst: BB --> int*/
516 (mode_is_int(mymode) ||
517 /* SymConst: BB --> ref */
518 mode_is_reference(mymode))
519 ,"SymConst node", 0);
523 op1mode = get_irn_mode(in[1]);
524 op2mode = get_irn_mode(in[2]);
526 /* Sel: BB x M x ref x int^n --> ref */
527 (op1mode == mode_M && op2mode == mymode && mode_is_reference(mymode)),
530 for (i=3; i < get_irn_arity(n); i++)
532 ASSERT_AND_RET(mode_is_int(get_irn_mode(in[i])), "Sel node", 0);
537 ASSERT_AND_RET(mode_T == mymode, "mode of Instof is not a tuple", 0);
538 ASSERT_AND_RET(mode_is_data(op1mode), "Instof not on data", 0);
542 op1mode = get_irn_mode(in[1]);
543 op2mode = get_irn_mode(in[2]);
544 /* Call: BB x M x ref x data1 x ... x datan
545 --> M x datan+1 x ... x data n+m */
546 ASSERT_AND_RET( op1mode == mode_M && mode_is_reference(op2mode), "Call node", 0 ); /* operand M x ref */
547 for (i=3; i < get_irn_arity(n); i++) {
548 ASSERT_AND_RET( mode_is_data(get_irn_mode(in[i])), "Call node", 0 ); /* operand datai */
550 ASSERT_AND_RET( mymode == mode_T, "Call result not a tuple", 0 ); /* result T */
551 /* Compare arguments of node with those of type */
552 mt = get_Call_type(n);
554 if (get_method_variadicity(mt) == variadicity_variadic) {
556 get_Call_n_params(n) >= get_method_n_params(mt),
557 "Number of args for Call doesn't match number of args in variadic type.",
559 fprintf(stderr, "Call has %d params, method %s type %d\n",
560 get_Call_n_params(n), get_type_name(mt), get_method_n_params(mt));
565 get_Call_n_params(n) == get_method_n_params(mt),
566 "Number of args for Call doesn't match number of args in non variadic type.",
570 for (i = 0; i < get_method_n_params(mt); i++) {
572 get_irn_mode(get_Call_param(n, i)) == get_type_mode(get_method_param_type(mt, i)),
573 "Mode of arg for Call doesn't match mode of arg type.", 0,
574 show_call_param(n, mt);
580 op1mode = get_irn_mode(in[1]);
581 op2mode = get_irn_mode(in[2]);
584 /* common Add: BB x numP x numP --> numP */
585 (op1mode == mymode && op2mode == op1mode && mode_is_numP(mymode)) ||
586 /* Pointer Add: BB x ref x int --> ref */
587 (mode_is_reference(op1mode) && mode_is_int(op2mode) && op1mode == mymode) ||
588 /* Pointer Add: BB x int x ref --> ref */
589 (mode_is_int(op1mode) && op2mode == mymode && mode_is_reference(mymode))
592 show_binop_failure(n, "/* common Add: BB x numP x numP --> numP */ |\n"
593 "/* Pointer Add: BB x ref x int --> ref */ |\n"
594 "/* Pointer Add: BB x int x ref --> ref */");
596 if (mode_is_reference(op1mode) != mode_is_reference(op2mode)) {
597 /* BB x ref x int --> ref or BB x int x ref --> ref */
600 /* BB x num x num --> num or BB x ref x ref */
606 op1mode = get_irn_mode(in[1]);
607 op2mode = get_irn_mode(in[2]);
609 /* common Sub: BB x numP x numP --> numP */
610 ((mymode ==op1mode && mymode == op2mode && mode_is_numP(op1mode)) ||
611 /* Pointer Sub: BB x ref x int --> ref */
612 (op1mode == mymode && mode_is_int(op2mode) && mode_is_reference(mymode)) ||
613 /* Pointer Sub: BB x int x ref --> ref */
614 (mode_is_int(op1mode) && op2mode == mymode && mode_is_reference(mymode)) ||
615 /* Pointer Sub: BB x ref x ref --> int */
616 (op1mode == op2mode && mode_is_reference(op2mode) && mode_is_int(mymode))),
618 show_binop_failure(n, "/* common Sub: BB x numP x numP --> numP */ |\n"
619 "/* Pointer Sub: BB x ref x int --> ref */ |\n"
620 "/* Pointer Sub: BB x int x ref --> ref */ |\n"
621 "/* Pointer Sub: BB x ref x ref --> int */" );
623 if (mode_is_reference(op1mode) != mode_is_reference(op2mode)) {
631 op1mode = get_irn_mode(in[1]);
633 /* Minus: BB x float --> float */
634 op1mode == mymode && get_mode_sort(op1mode) == irms_float_number, "Minus node", 0,
635 show_unop_failure(n , "/* Minus: BB x float --> float */");
641 op1mode = get_irn_mode(in[1]);
642 op2mode = get_irn_mode(in[2]);
644 /* Mul: BB x int1 x int1 --> int2 */
645 ((mode_is_int(op1mode) && op2mode == op1mode && mode_is_int(mymode)) ||
646 (mode_is_float(op1mode) && op2mode == op1mode && mymode == op1mode)),
648 show_binop_failure(n, "/* Mul: BB x int1 x int1 --> int2 */");
654 op1mode = get_irn_mode(in[1]);
655 op2mode = get_irn_mode(in[2]);
656 op3mode = get_irn_mode(in[3]);
658 /* Quot: BB x M x float x float --> M x X x float */
659 op1mode == mode_M && op2mode == op3mode &&
660 get_mode_sort(op2mode) == irms_float_number &&
663 show_binop_failure(n, "/* Quot: BB x M x float x float --> M x X x float */");
669 op1mode = get_irn_mode(in[1]);
670 op2mode = get_irn_mode(in[2]);
671 op3mode = get_irn_mode(in[3]);
673 /* DivMod: BB x M x int x int --> M x X x int x int */
675 mode_is_int(op2mode) &&
676 op3mode == op2mode &&
685 op1mode = get_irn_mode(in[1]);
686 op2mode = get_irn_mode(in[2]);
687 op3mode = get_irn_mode(in[3]);
689 /* Div or Mod: BB x M x int x int --> M x X x int */
691 op2mode == op3mode &&
692 mode_is_int(op2mode) &&
700 op1mode = get_irn_mode(in[1]);
702 /* Abs: BB x num --> num */
704 mode_is_num (op1mode),
706 show_unop_failure(n, "/* Abs: BB x num --> num */");
714 op1mode = get_irn_mode(in[1]);
715 op2mode = get_irn_mode(in[2]);
717 /* And or Or or Eor: BB x int x int --> int */
718 mode_is_int(mymode) &&
719 op2mode == op1mode &&
721 "And, Or or Eor node", 0,
722 show_binop_failure(n, "/* And or Or or Eor: BB x int x int --> int */");
728 op1mode = get_irn_mode(in[1]);
730 /* Not: BB x int --> int */
731 mode_is_int(mymode) &&
734 show_unop_failure(n, "/* Not: BB x int --> int */");
741 op1mode = get_irn_mode(in[1]);
742 op2mode = get_irn_mode(in[2]);
744 /* Cmp: BB x datab x datab --> b16 */
745 mode_is_data (op1mode) &&
746 op2mode == op1mode &&
749 show_binop_failure(n, "/* Cmp: BB x datab x datab --> b16 */");
756 op1mode = get_irn_mode(in[1]);
757 op2mode = get_irn_mode(in[2]);
759 /* Shl, Shr or Shrs: BB x int x int_u --> int */
760 mode_is_int(op1mode) &&
761 mode_is_int(op2mode) &&
762 !mode_is_signed(op2mode) &&
764 "Shl, Shr, Shr or Rot node", 0,
765 show_binop_failure(n, "/* Shl, Shr or Shrs: BB x int x int_u --> int */");
770 op1mode = get_irn_mode(in[1]);
771 op2mode = get_irn_mode(in[2]);
773 /* Rot: BB x int x int --> int */
774 mode_is_int(op1mode) &&
775 mode_is_int(op2mode) &&
778 show_binop_failure(n, "/* Rot: BB x int x int --> int */");
783 op1mode = get_irn_mode(in[1]);
785 /* Conv: BB x datab1 --> datab2 */
786 mode_is_datab(op1mode) && mode_is_data(mymode),
788 show_unop_failure(n, "/* Conv: BB x datab1 --> datab2 */");
793 op1mode = get_irn_mode(in[1]);
795 /* Conv: BB x datab1 --> datab2 */
796 mode_is_data(op1mode) && op1mode == mymode,
798 show_unop_failure(n, "/* Conv: BB x datab1 --> datab2 */");
803 /* Phi: BB x dataM^n --> dataM */
804 /* for some reason "<=" aborts. int there a problem with get_store? */
805 for (i=1; i < get_irn_arity(n); i++) {
806 if (!is_Bad(in[i]) && (get_irn_op(in[i]) != op_Unknown))
807 ASSERT_AND_RET( get_irn_mode(in[i]) == mymode, "Phi node", 0);
809 ASSERT_AND_RET( mode_is_dataM(mymode), "Phi node", 0 );
813 op1mode = get_irn_mode(in[1]);
814 op2mode = get_irn_mode(in[2]);
816 /* Load: BB x M x ref --> M x X x data */
817 op1mode == mode_M && mode_is_reference(op2mode),
820 ASSERT_AND_RET( mymode == mode_T, "Load node", 0 );
824 op1mode = get_irn_mode(in[1]);
825 op2mode = get_irn_mode(in[2]);
826 op3mode = get_irn_mode(in[3]);
828 /* Load: BB x M x ref data --> M x X */
829 op1mode == mode_M && mode_is_reference(op2mode) && mode_is_data(op3mode),
832 ASSERT_AND_RET(mymode == mode_T, "Store node", 0);
836 op1mode = get_irn_mode(in[1]);
837 op2mode = get_irn_mode(in[2]);
839 /* Alloc: BB x M x int_u --> M x X x ref */
841 mode_is_int(op2mode) &&
842 !mode_is_signed(op2mode) &&
845 show_binop_failure(n, "/* Alloc: BB x M x int_u --> M x X x ref */");
850 op1mode = get_irn_mode(in[1]);
851 op2mode = get_irn_mode(in[2]);
853 /* Free: BB x M x ref --> M */
854 op1mode == mode_M && mode_is_reference(op2mode) &&
857 show_binop_failure(n, "/* Free: BB x M x ref --> M */");
862 /* Sync: BB x M^n --> M */
863 for (i=1; i < get_irn_arity(n); i++) {
864 ASSERT_AND_RET( get_irn_mode(in[i]) == mode_M, "Sync node", 0 );
866 ASSERT_AND_RET( mymode == mode_M, "Sync node", 0 );
870 return vrfy_Proj_proj(n, irg);
874 op1mode = get_irn_mode(in[1]);
875 op2mode = get_irn_mode(in[2]);
877 /* Confirm: BB x T x T --> T */
881 show_binop_failure(n, "/* Confirm: BB x T x T --> T */");
893 int irn_vrfy(ir_node *n)
895 return irn_vrfy_irg(n, current_ir_graph);
898 /*******************************************************************/
899 /* Verify the whole graph. */
900 /*******************************************************************/
902 static void vrfy_wrap(ir_node *node, void *env)
906 *res = irn_vrfy(node);
909 int irg_vrfy(ir_graph *irg)
914 rem = current_ir_graph;
915 current_ir_graph = irg;
917 assert(get_irg_pinned(irg) == pinned);
919 irg_walk(irg->end, vrfy_wrap, NULL, &res);
921 current_ir_graph = rem;