From: Michael Beck Date: Wed, 12 Feb 2003 16:06:05 +0000 (+0000) Subject: Make debug macros "more useful" X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=63f328f1bf853445ccefdac1c9b43881940f07ac;p=libfirm Make debug macros "more useful" [r762] --- diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 8ac6aadd0..ebfac8652 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -386,15 +386,15 @@ equivalent_node (ir_node *n) case iro_Minus: /* --x == x */ /* ??? Is this possible or can --x raise an out of bounds exception if min =! max? */ if (get_irn_op(get_unop_op(n)) == get_irn_op(n)) { - n = get_unop_op(get_unop_op(n)); DBG_OPT_ALGSIM2 + n = get_unop_op(get_unop_op(n)); DBG_OPT_ALGSIM2; } break; case iro_Mul: /* Mul is commutative and has again an other neutral element. */ if (tarval_classify (computed_value (a)) == 1) { - n = b; DBG_OPT_ALGSIM1 + n = b; DBG_OPT_ALGSIM1; } else if (tarval_classify (computed_value (b)) == 1) { - n = a; DBG_OPT_ALGSIM1 + n = a; DBG_OPT_ALGSIM1; } break; case iro_Div: diff --git a/ir/ir/iropt_dbg.h b/ir/ir/iropt_dbg.h index 87473b1ba..680d90dce 100644 --- a/ir/ir/iropt_dbg.h +++ b/ir/ir/iropt_dbg.h @@ -4,86 +4,87 @@ update the debug information after a transformation. */ #define DBG_OPT_STG \ - { \ + do { \ ir_node *ons[2]; \ ons[0] = oldn; \ ons[1] = get_Block_cfgpred(oldn, 0); \ __dbg_info_merge_sets(&n, 1, ons, 2, dbg_straightening); \ - } + } while(0) #define DBG_OPT_IFSIM \ - { \ + do { \ ir_node *ons[4]; \ ons[0] = oldn; \ ons[1] = a; \ ons[2] = b; \ ons[3] = get_Proj_pred(a); \ __dbg_info_merge_sets(&n, 1, ons, 4, dbg_if_simplification); \ - } + } while(0) #define DBG_OPT_ALGSIM1 \ - { \ + do { \ ir_node *ons[3]; \ ons[0] = oldn; \ ons[1] = a; \ ons[2] = b; \ __dbg_info_merge_sets(&n, 1, ons, 3, dbg_algebraic_simplification); \ - } + } while(0) #define DBG_OPT_ALGSIM2 \ - { \ + do { \ ir_node *ons[3]; \ ons[0] = oldn; \ ons[1] = get_unop_op(n); \ ons[2] = n; \ __dbg_info_merge_sets(&n, 1, ons, 3, dbg_algebraic_simplification); \ - } + } while(0) #define DBG_OPT_ALGSIM3 \ - { \ + do { \ ir_node *ons[2]; \ ons[0] = oldn; \ ons[1] = a; \ __dbg_info_merge_sets(&n, 1, ons, 2, dbg_algebraic_simplification); \ - } + } while(0) #define DBG_OPT_PHI \ - { \ + do { \ ir_node *ons[2]; \ ons[0] = oldn; \ ons[1] = first_val; \ __dbg_info_merge_sets(&n, 1, ons, 2, dbg_opt_ssa); \ - } + } while(0) #define DBG_OPT_WAW \ - { \ + do { \ ir_node *ons[2]; \ ons[0] = oldn; \ ons[1] = n; \ __dbg_info_merge_sets(&n, 1, ons, 2, dbg_write_after_write);\ - } + } while(0) #define DBG_OPT_WAR \ - { \ + do { \ ir_node *ons[2]; \ ons[0] = oldn; \ ons[1] = c; \ __dbg_info_merge_sets(&c, 1, ons, 2, dbg_write_after_read); \ - } + } while(0) #define DBG_OPT_TUPLE \ - { \ + do { \ ir_node *ons[3]; \ ons[0] = oldn; \ ons[1] = a; \ ons[2] = n; \ __dbg_info_merge_sets(&n, 1, ons, 3, dbg_opt_auxnode); \ - } + } while(0) + #define DBG_OPT_ID \ - { \ + do { \ ir_node *ons[2]; \ ons[0] = oldn; \ ons[1] = n; \ __dbg_info_merge_sets(&n, 1, ons, 2, dbg_opt_auxnode); \ - } + } while(0)