From: Christian Würdig Date: Thu, 30 Mar 2006 15:39:41 +0000 (+0000) Subject: wrapped debugging modules with DEBUG_ONLY X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;ds=sidebyside;h=ea64ddabccc512b21b425e4d89fda5e4ffe124a6;p=libfirm wrapped debugging modules with DEBUG_ONLY --- diff --git a/ir/be/TEMPLATE/TEMPLATE_emitter.c b/ir/be/TEMPLATE/TEMPLATE_emitter.c index 03f23de1e..29544ce60 100644 --- a/ir/be/TEMPLATE/TEMPLATE_emitter.c +++ b/ir/be/TEMPLATE/TEMPLATE_emitter.c @@ -297,9 +297,9 @@ static void TEMPLATE_register_emitters(void) { */ void TEMPLATE_emit_node(ir_node *irn, void *env) { emit_env_t *emit_env = env; - firm_dbg_module_t *mod = emit_env->mod; FILE *F = emit_env->out; ir_op *op = get_irn_op(irn); + DEBUG_ONLY(firm_dbg_module_t *mod = emit_env->mod;) DBG((mod, LEVEL_1, "emitting code for %+F\n", irn)); diff --git a/ir/be/TEMPLATE/TEMPLATE_emitter.h b/ir/be/TEMPLATE/TEMPLATE_emitter.h index d211d1fa2..06ca14a0c 100644 --- a/ir/be/TEMPLATE/TEMPLATE_emitter.h +++ b/ir/be/TEMPLATE/TEMPLATE_emitter.h @@ -10,10 +10,10 @@ #include "bearch_TEMPLATE_t.h" typedef struct _emit_env_t { - firm_dbg_module_t *mod; FILE *out; const arch_env_t *arch_env; const TEMPLATE_code_gen_t *cg; + DEBUG_ONLY(firm_dbg_module_t *mod;) } emit_env_t; const lc_arg_env_t *TEMPLATE_get_arg_env(void); diff --git a/ir/be/TEMPLATE/bearch_TEMPLATE_t.h b/ir/be/TEMPLATE/bearch_TEMPLATE_t.h index a707afdd7..dd06d04ec 100644 --- a/ir/be/TEMPLATE/bearch_TEMPLATE_t.h +++ b/ir/be/TEMPLATE/bearch_TEMPLATE_t.h @@ -12,9 +12,9 @@ typedef struct _TEMPLATE_code_gen_t { FILE *out; /* output file */ const arch_env_t *arch_env; /* the arch env */ set *reg_set; /* set to memorize registers for FIRM nodes (e.g. phi) */ - firm_dbg_module_t *mod; /* debugging module */ int emit_decls; /* flag indicating if decls were already emitted */ const be_irg_t *birg; /* The be-irg (contains additional information about the irg) */ + DEBUG_ONLY(firm_dbg_module_t *mod;) /* debugging module */ } TEMPLATE_code_gen_t; @@ -36,12 +36,12 @@ typedef struct _TEMPLATE_irn_ops_t { /* this is a struct to minimize the number of parameters for transformation walker */ typedef struct _TEMPLATE_transform_env_t { - firm_dbg_module_t *mod; /**< The firm debugger */ dbg_info *dbg; /**< The node debug info */ ir_graph *irg; /**< The irg, the node should be created in */ ir_node *block; /**< The block, the node should belong to */ ir_node *irn; /**< The irn, to be transformed */ ir_mode *mode; /**< The mode of the irn */ + DEBUG_ONLY(firm_dbg_module_t *mod;) /**< The firm debugger */ } TEMPLATE_transform_env_t; diff --git a/ir/be/arm/arm_emitter.c b/ir/be/arm/arm_emitter.c index 206d24953..8fb8fef24 100644 --- a/ir/be/arm/arm_emitter.c +++ b/ir/be/arm/arm_emitter.c @@ -754,9 +754,9 @@ static void arm_register_emitters(void) { */ static void arm_emit_node(const ir_node *irn, void *env) { arm_emit_env_t *emit_env = env; - firm_dbg_module_t *mod = emit_env->mod; FILE *F = emit_env->out; ir_op *op = get_irn_op(irn); + DEBUG_ONLY(firm_dbg_module_t *mod = emit_env->mod;) DBG((mod, LEVEL_1, "emitting code for %+F\n", irn)); diff --git a/ir/be/arm/arm_emitter.h b/ir/be/arm/arm_emitter.h index 787a7d4f1..282979f2c 100644 --- a/ir/be/arm/arm_emitter.h +++ b/ir/be/arm/arm_emitter.h @@ -10,10 +10,10 @@ #include "bearch_arm_t.h" typedef struct _arm_emit_env_t { - firm_dbg_module_t *mod; FILE *out; const arch_env_t *arch_env; const arm_code_gen_t *cg; + DEBUG_ONLY(firm_dbg_module_t *mod;) } arm_emit_env_t; const lc_arg_env_t *arm_get_arg_env(void); diff --git a/ir/be/arm/arm_transform.c b/ir/be/arm/arm_transform.c index 256da5cb0..0e744d057 100644 --- a/ir/be/arm/arm_transform.c +++ b/ir/be/arm/arm_transform.c @@ -821,7 +821,7 @@ static ir_node *gen_CopyB(arm_transform_env_t *env) { const_env.dbg = dbg; const_env.irg = irg; const_env.irn = node; - const_env.mod = env->mod; + DEBUG_ONLY(const_env.mod = env->mod;) const_env.mode = mode_Iu; src_copy = be_new_Copy(&arm_reg_classes[CLASS_arm_general_purpose], irg, block, src); @@ -874,7 +874,7 @@ void arm_move_consts(ir_node *node, void *env) { tenv.dbg = get_irn_dbg_info(pred); tenv.irg = current_ir_graph; tenv.irn = pred; - tenv.mod = cgenv->mod; + DEBUG_ONLY(tenv.mod = cgenv->mod;) tenv.mode = get_irn_mode(pred); const_graph = create_const_graph(&tenv); set_irn_n(node, i, const_graph); @@ -899,7 +899,7 @@ void arm_move_consts(ir_node *node, void *env) { tenv.dbg = get_irn_dbg_info(pred); tenv.irg = current_ir_graph; tenv.irn = pred; - tenv.mod = cgenv->mod; + DEBUG_ONLY(tenv.mod = cgenv->mod;) tenv.mode = get_irn_mode(pred); const_graph = create_const_graph(&tenv); set_irn_n(node, i, const_graph); @@ -962,7 +962,7 @@ void arm_transform_node(ir_node *node, void *env) { tenv.dbg = get_irn_dbg_info(node); tenv.irg = current_ir_graph; tenv.irn = node; - tenv.mod = cgenv->mod; + DEBUG_ONLY(tenv.mod = cgenv->mod;) tenv.mode = get_irn_mode(node); #define UNOP(a) case iro_##a: asm_node = gen_##a(&tenv, get_##a##_op(node)); break diff --git a/ir/be/arm/bearch_arm_t.h b/ir/be/arm/bearch_arm_t.h index e24d2bb14..7f59bfee4 100644 --- a/ir/be/arm/bearch_arm_t.h +++ b/ir/be/arm/bearch_arm_t.h @@ -14,10 +14,10 @@ typedef struct _arm_code_gen_t { FILE *out; /**< output file */ const arch_env_t *arch_env; /**< the arch env */ set *reg_set; /**< set to memorize registers for FIRM nodes (e.g. phi) */ - firm_dbg_module_t *mod; /**< debugging module */ int emit_decls; /**< flag indicating if decls were already emitted */ const be_irg_t *birg; /**< The be-irg (contains additional information about the irg) */ ir_type *int_tp; /**< the int type, needed for Call conversion */ + DEBUG_ONLY(firm_dbg_module_t *mod;) /**< debugging module */ } arm_code_gen_t; @@ -39,13 +39,12 @@ typedef struct _arm_irn_ops_t { /* this is a struct to minimize the number of parameters for transformation walker */ typedef struct _arm_transform_env_t { - firm_dbg_module_t *mod; /**< The firm debugger */ dbg_info *dbg; /**< The node debug info */ ir_graph *irg; /**< The irg, the node should be created in */ ir_node *block; /**< The block, the node should belong to */ ir_node *irn; /**< The irn, to be transformed */ ir_mode *mode; /**< The mode of the irn */ -// arm_code_gen_t *cg; /**< The code generator */ + DEBUG_ONLY(firm_dbg_module_t *mod;) /**< The firm debugger */ } arm_transform_env_t; diff --git a/ir/be/be_t.h b/ir/be/be_t.h index ca296127e..bed907cf6 100644 --- a/ir/be/be_t.h +++ b/ir/be/be_t.h @@ -28,7 +28,7 @@ struct _be_main_env_t { struct _be_options_t *options; struct _arch_code_generator_t *cg; struct _arch_irn_handler_t *phi_handler; - firm_dbg_module_t *dbg; + DEBUG_ONLY(firm_dbg_module_t *dbg;) }; struct _be_irg_t { diff --git a/ir/be/beabi.c b/ir/be/beabi.c index a8e030a15..d5d29b3c9 100644 --- a/ir/be/beabi.c +++ b/ir/be/beabi.c @@ -74,7 +74,6 @@ struct _be_stack_slot_t { struct _be_abi_irg_t { struct obstack obst; - firm_dbg_module_t *dbg; /**< The debugging module. */ be_stack_frame_t *frame; /**< The stack frame model. */ const be_irg_t *birg; /**< The back end IRG. */ const arch_isa_t *isa; /**< The isa. */ @@ -99,6 +98,7 @@ struct _be_abi_irg_t { arch_irn_handler_t irn_handler; arch_irn_ops_t irn_ops; + DEBUG_ONLY(firm_dbg_module_t *dbg;) /**< The debugging module. */ }; #define get_abi_from_handler(ptr) firm_container_of(ptr, be_abi_irg_t, irn_handler) @@ -1134,7 +1134,6 @@ static void create_barrier(be_abi_irg_t *env, ir_node *bl, ir_node **mem, pmap * */ static void modify_irg(be_abi_irg_t *env) { - firm_dbg_module_t *dbg = env->dbg; be_abi_call_t *call = env->call; const arch_isa_t *isa = env->birg->main_env->arch_env->isa; const arch_register_t *sp = arch_isa_sp(isa); @@ -1148,6 +1147,7 @@ static void modify_irg(be_abi_irg_t *env) pset *dont_save = pset_new_ptr(8); int n_params = get_method_n_params(method_type); int max_arg = 0; + DEBUG_ONLY(firm_dbg_module_t *dbg = env->dbg;) int i, j, n; diff --git a/ir/be/bechordal.c b/ir/be/bechordal.c index a83c52a89..bcad99485 100644 --- a/ir/be/bechordal.c +++ b/ir/be/bechordal.c @@ -63,7 +63,6 @@ typedef struct _be_chordal_alloc_env_t { be_chordal_env_t *chordal_env; - firm_dbg_module_t *constr_dbg; /**< Debug output for the constraint handler. */ pset *pre_colored; /**< Set of precolored nodes. */ bitset_t *live; /**< A liveness bitset. */ bitset_t *tmp_colors; /**< An auxiliary bitset which is as long as the number of colors in the class. */ @@ -71,6 +70,7 @@ typedef struct _be_chordal_alloc_env_t { bitset_t *in_colors; /**< Colors used by live in values. */ bitset_t *ignore_regs; /**< A bitset of all ignore registers in the current class. */ int colors_n; /**< The number of colors. */ + DEBUG_ONLY(firm_dbg_module_t *constr_dbg;) /**< Debug output for the constraint handler. */ } be_chordal_alloc_env_t; #include "fourcc.h" @@ -380,13 +380,13 @@ static ir_node *pre_process_constraints(be_chordal_alloc_env_t *alloc_env, insn_ { be_chordal_env_t *env = alloc_env->chordal_env; const arch_env_t *aenv = env->birg->main_env->arch_env; - firm_dbg_module_t *dbg = alloc_env->constr_dbg; insn_t *insn = *the_insn; ir_node *bl = get_nodes_block(insn->irn); ir_node *copy = NULL; ir_node *perm = NULL; bitset_t *out_constr = bitset_alloca(env->cls->n_regs); bitset_t *bs = bitset_alloca(env->cls->n_regs); + DEBUG_ONLY(firm_dbg_module_t *dbg = alloc_env->constr_dbg;) int i; @@ -504,7 +504,6 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env, ir_node *i correctly precolored. These Perms arise during the ABI handling phase. */ if(insn->has_constraints) { - firm_dbg_module_t *dbg = alloc_env->constr_dbg; const arch_env_t *aenv = env->birg->main_env->arch_env; int n_regs = env->cls->n_regs; bitset_t *bs = bitset_alloca(n_regs); @@ -512,6 +511,7 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env, ir_node *i bipartite_t *bp = bipartite_new(n_regs, n_regs); int *assignment = alloca(n_regs * sizeof(assignment[0])); pmap *partners = pmap_create(); + DEBUG_ONLY(firm_dbg_module_t *dbg = alloc_env->constr_dbg;) int i, n_alloc; long col; @@ -699,8 +699,8 @@ static void pressure(ir_node *block, void *env_ptr) be_chordal_alloc_env_t *alloc_env = env_ptr; be_chordal_env_t *env = alloc_env->chordal_env; bitset_t *live = alloc_env->live; - firm_dbg_module_t *dbg = env->dbg; ir_node *irn; + DEBUG_ONLY(firm_dbg_module_t *dbg = env->dbg;) int i, n; unsigned step = 0; @@ -795,11 +795,11 @@ static void assign(ir_node *block, void *env_ptr) { be_chordal_alloc_env_t *alloc_env = env_ptr; be_chordal_env_t *env = alloc_env->chordal_env; - firm_dbg_module_t *dbg = env->dbg; bitset_t *live = alloc_env->live; bitset_t *colors = alloc_env->colors; bitset_t *in_colors = alloc_env->in_colors; const arch_env_t *arch_env = env->birg->main_env->arch_env; + DEBUG_ONLY(firm_dbg_module_t *dbg = env->dbg;) const ir_node *irn; border_t *b; diff --git a/ir/be/bechordal_main.c b/ir/be/bechordal_main.c index 0e5df3e63..7cada80a1 100644 --- a/ir/be/bechordal_main.c +++ b/ir/be/bechordal_main.c @@ -55,12 +55,12 @@ void be_ra_chordal_check(be_chordal_env_t *chordal_env) { - firm_dbg_module_t *dbg = chordal_env->dbg; const arch_env_t *arch_env = chordal_env->birg->main_env->arch_env; struct obstack ob; pmap_entry *pme; ir_node **nodes, *n1, *n2; int i, o; + DEBUG_ONLY(firm_dbg_module_t *dbg = chordal_env->dbg;) /* Collect all irns */ obstack_init(&ob); @@ -98,13 +98,13 @@ void be_ra_chordal_check(be_chordal_env_t *chordal_env) { static void check_pressure_walker(ir_node *bl, void *data) { be_chordal_env_t *env = data; - firm_dbg_module_t *dbg = env->dbg; int n_regs = arch_register_class_n_regs(env->cls); pset *live = pset_new_ptr_default(); int step = 0; ir_node *irn; irn_live_t *li; + DEBUG_ONLY(firm_dbg_module_t *dbg = env->dbg;) live_foreach(bl, li) { if(live_is_end(li) && chordal_has_class(env, li->irn)) { diff --git a/ir/be/bechordal_t.h b/ir/be/bechordal_t.h index c8d632cd4..dbf7e8dc5 100644 --- a/ir/be/bechordal_t.h +++ b/ir/be/bechordal_t.h @@ -54,7 +54,6 @@ typedef struct _border_t { struct _be_chordal_env_t { struct obstack obst; /**< An obstack for temporary storage. */ be_ra_chordal_opts_t *opts; /**< A pointer to the chordal ra options. */ - firm_dbg_module_t *dbg; /**< Debug module for the chordal register allocator. */ const be_irg_t *birg; /**< Back-end IRG session. */ dom_front_info_t *dom_front; /**< Dominance frontiers. */ ir_graph *irg; /**< The graph under examination. */ @@ -62,6 +61,7 @@ struct _be_chordal_env_t { pmap *border_heads; /**< Maps blocks to border heads. */ be_ifg_t *ifg; /**< The interference graph. */ void *data; /**< Some pointer, to which different phases can attach data to. */ + DEBUG_ONLY(firm_dbg_module_t *dbg;) /**< Debug module for the chordal register allocator. */ }; static INLINE struct list_head *_get_block_border_head(const be_chordal_env_t *inf, ir_node *bl) { diff --git a/ir/be/becopyheur.c b/ir/be/becopyheur.c index 7b16fe190..2bda705c2 100644 --- a/ir/be/becopyheur.c +++ b/ir/be/becopyheur.c @@ -29,7 +29,7 @@ #include "becopystat.h" #include "bitset.h" -static firm_dbg_module_t *dbg = NULL; +DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) #define SEARCH_FREE_COLORS diff --git a/ir/be/becopyilp2.c b/ir/be/becopyilp2.c index 584fa159c..773decd47 100644 --- a/ir/be/becopyilp2.c +++ b/ir/be/becopyilp2.c @@ -44,10 +44,10 @@ #define DEBUG_LVL 1 typedef struct _local_env_t { - firm_dbg_module_t *dbg; double time_limit; int first_x_var, last_x_var; pmap *nr_2_irn; + DEBUG_ONLY(firm_dbg_module_t *dbg;) } local_env_t; static void build_coloring_cstr(ilp_env_t *ienv) { diff --git a/ir/be/becopyopt.c b/ir/be/becopyopt.c index 1d86d6a0d..8b0f6d000 100644 --- a/ir/be/becopyopt.c +++ b/ir/be/becopyopt.c @@ -43,7 +43,7 @@ ******************************************************************************/ -static firm_dbg_module_t *dbg = NULL; +DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) void be_copy_opt_init(void) { } diff --git a/ir/be/becopystat.c b/ir/be/becopystat.c index ec83cb4da..15d1a255c 100644 --- a/ir/be/becopystat.c +++ b/ir/be/becopystat.c @@ -29,7 +29,7 @@ #define DO_ILP2 #define DEBUG_LVL SET_LEVEL_1 -static firm_dbg_module_t *dbg = NULL; +DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) #define MAX_ARITY 20 #define MAX_CLS_SIZE 20 diff --git a/ir/be/belistsched.c b/ir/be/belistsched.c index 55100844d..dcf012f49 100644 --- a/ir/be/belistsched.c +++ b/ir/be/belistsched.c @@ -403,9 +403,9 @@ typedef struct _block_sched_env_t { pset *ready_set; pset *already_scheduled; ir_node *block; - firm_dbg_module_t *dbg; const list_sched_selector_t *selector; void *selector_block_env; + DEBUG_ONLY(firm_dbg_module_t *dbg;) } block_sched_env_t; /** diff --git a/ir/be/belower.c b/ir/be/belower.c index 4378dc7cb..ae3db13f5 100644 --- a/ir/be/belower.c +++ b/ir/be/belower.c @@ -43,7 +43,7 @@ typedef struct _lower_env_t { be_chordal_env_t *chord_env; int do_copy; - firm_dbg_module_t *dbg_module; + DEBUG_ONLY(firm_dbg_module_t *dbg_module;) } lower_env_t; /* holds a perm register pair */ @@ -248,7 +248,6 @@ static perm_cycle_t *get_perm_cycle(perm_cycle_t *cycle, reg_pair_t *pairs, int static void lower_perm_node(ir_node *irn, void *walk_env) { const arch_register_class_t *reg_class; const arch_env_t *arch_env; - firm_dbg_module_t *mod; lower_env_t *env = walk_env; reg_pair_t *pairs; const ir_edge_t *edge; @@ -257,10 +256,11 @@ static void lower_perm_node(ir_node *irn, void *walk_env) { ir_node *sched_point, *block, *in[2]; ir_node *arg1, *arg2, *res1, *res2; ir_node *cpyxchg = NULL; + DEBUG_ONLY(firm_dbg_module_t *mod;) arch_env = env->chord_env->birg->main_env->arch_env; do_copy = env->do_copy; - mod = env->dbg_module; + DEBUG_ONLY(mod = env->dbg_module;) block = get_nodes_block(irn); /* diff --git a/ir/be/beraextern.c b/ir/be/beraextern.c index 557d0caee..903b62901 100644 --- a/ir/be/beraextern.c +++ b/ir/be/beraextern.c @@ -103,7 +103,6 @@ typedef struct _var_info_t var_info_t; * Environment with all the needed stuff */ typedef struct _be_raext_env_t { - firm_dbg_module_t *dbg; arch_env_t *aenv; const arch_register_class_t *cls; ir_graph *irg; @@ -113,6 +112,7 @@ typedef struct _be_raext_env_t { set *vars; /**< contains all var_info_t */ int n_cls_vars; /**< length of the array cls_vars */ var_info_t **cls_vars; /**< only the var_infos for current cls. needed for double iterating */ + DEBUG_ONLY(firm_dbg_module_t *dbg;) } be_raext_env_t; diff --git a/ir/be/bespill.c b/ir/be/bespill.c index 23d2a0aca..55c50769a 100644 --- a/ir/be/bespill.c +++ b/ir/be/bespill.c @@ -51,7 +51,6 @@ typedef struct _spill_ctx_t { } spill_ctx_t; struct _spill_env_t { - firm_dbg_module_t *dbg; const arch_register_class_t *cls; const be_chordal_env_t *chordal_env; struct obstack obst; @@ -60,6 +59,7 @@ struct _spill_env_t { pset *mem_phis; /**< set of all special spilled phis. allocated and freed seperately */ decide_irn_t is_mem_phi; /**< callback func to decide if a phi needs special spilling */ void *data; /**< data passed to all callbacks */ + DEBUG_ONLY(firm_dbg_module_t *dbg;) }; static int cmp_spillctx(const void *a, const void *b, size_t n) { @@ -74,15 +74,11 @@ static int cmp_spillinfo(const void *x, const void *y, size_t size) { return ! (xx->spilled_node == yy->spilled_node); } -spill_env_t *be_new_spill_env(firm_dbg_module_t *dbg, - const be_chordal_env_t *chordal_env, - decide_irn_t is_mem_phi, void *data) { - +spill_env_t *be_new_spill_env(const be_chordal_env_t *chordal_env, decide_irn_t is_mem_phi, void *data) { spill_env_t *env = xmalloc(sizeof(env[0])); env->spill_ctxs = new_set(cmp_spillctx, 1024); env->spills = new_set(cmp_spillinfo, 1024); env->cls = chordal_env->cls; - env->dbg = dbg; env->is_mem_phi = is_mem_phi; env->data = data; env->chordal_env = chordal_env; @@ -386,11 +382,11 @@ typedef struct _spill_slot_t { } spill_slot_t; typedef struct _ss_env_t { - firm_dbg_module_t *dbg; struct obstack ob; be_chordal_env_t *cenv; pmap *slots; /* maps spill_contexts to spill_slots */ - pmap *types; /* maps modes to types */ + pmap *types; /* maps modes to types */ + DEBUG_ONLY(firm_dbg_module_t *dbg;) } ss_env_t; diff --git a/ir/be/bespill.h b/ir/be/bespill.h index ef19be83e..f99918484 100644 --- a/ir/be/bespill.h +++ b/ir/be/bespill.h @@ -22,11 +22,7 @@ typedef struct _spill_env_t spill_env_t; typedef int(*decide_irn_t)(const ir_node*, void*); -spill_env_t *be_new_spill_env( - firm_dbg_module_t *dbg, - const be_chordal_env_t *chordal, - decide_irn_t is_mem_phi, - void *data); +spill_env_t *be_new_spill_env(const be_chordal_env_t *chordal, decide_irn_t is_mem_phi, void *data); void be_delete_spill_env(spill_env_t *senv); diff --git a/ir/be/bespillbelady.c b/ir/be/bespillbelady.c index 237ef7782..3a9e68ce9 100644 --- a/ir/be/bespillbelady.c +++ b/ir/be/bespillbelady.c @@ -47,7 +47,7 @@ #define DBG_SLOTS 32 #define DBG_TRACE 64 #define DEBUG_LVL 0 //(DBG_START | DBG_DECIDE | DBG_WSETS | DBG_FIX | DBG_SPILL) -static firm_dbg_module_t *dbg = NULL; +DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) #define MIN(a,b) (((a)<(b))?(a):(b)) @@ -639,14 +639,15 @@ void be_spill_belady(const be_chordal_env_t *chordal_env) { /* init belady env */ obstack_init(&bel.ob); - bel.arch = chordal_env->birg->main_env->arch_env; - bel.cls = chordal_env->cls; - bel.n_regs = arch_register_class_n_regs(bel.cls); - bel.ws = new_workset(&bel.ob, &bel); - bel.uses = be_begin_uses(chordal_env->irg, chordal_env->birg->main_env->arch_env, bel.cls); - bel.senv = be_new_spill_env(dbg, chordal_env, is_mem_phi, NULL); - bel.reloads = pset_new_ptr_default(); - bel.copies = pset_new_ptr_default(); + bel.arch = chordal_env->birg->main_env->arch_env; + bel.cls = chordal_env->cls; + bel.n_regs = arch_register_class_n_regs(bel.cls); + bel.ws = new_workset(&bel.ob, &bel); + bel.uses = be_begin_uses(chordal_env->irg, chordal_env->birg->main_env->arch_env, bel.cls); + bel.senv = be_new_spill_env(chordal_env, is_mem_phi, NULL); + DEBUG_ONLY(bel.senv->dbg = dbg;) + bel.reloads = pset_new_ptr_default(); + bel.copies = pset_new_ptr_default(); DBG((dbg, LEVEL_1, "running on register class: %s\n", bel.cls->name)); diff --git a/ir/be/bespillilp.c b/ir/be/bespillilp.c index c9b60bd92..6dfcac485 100644 --- a/ir/be/bespillilp.c +++ b/ir/be/bespillilp.c @@ -86,7 +86,6 @@ typedef struct _spill_ilp_t { spill_stat_t stats; const arch_register_class_t *cls; const be_chordal_env_t *chordal_env; - firm_dbg_module_t *dbg; lpp_t *lpp; set *irn_use_heads; set *live_ranges; @@ -96,6 +95,7 @@ typedef struct _spill_ilp_t { struct obstack *obst; int enable_store : 1; int enable_remat : 1; + DEBUG_ONLY(firm_dbg_module_t *dbg;) } spill_ilp_t; typedef struct _live_range_t live_range_t; @@ -635,7 +635,8 @@ void be_spill_ilp(const be_chordal_env_t *chordal_env) memset(&si.stats, 0, sizeof(si.stats)); si.chordal_env = chordal_env; si.obst = &obst; - si.senv = be_new_spill_env(si.dbg, chordal_env, is_mem_phi, &si); + si.senv = be_new_spill_env(chordal_env, is_mem_phi, &si); + DEBUG_ONLY(si.senv->dbg = si.dbg;) si.cls = chordal_env->cls; si.lpp = new_lpp(problem_name, lpp_minimize); si.irn_use_heads = new_set(cmp_irn_use_head, 4096); @@ -646,7 +647,6 @@ void be_spill_ilp(const be_chordal_env_t *chordal_env) si.enable_store = 1; FIRM_DBG_REGISTER(si.dbg, "firm.be.ra.spillilp"); - firm_dbg_set_mask(si.dbg, DBG_LEVEL); irg_block_walk_graph(chordal_env->irg, process_block, NULL, &si); if(si.enable_store) add_store_costs(&si); diff --git a/ir/be/bessadestr.c b/ir/be/bessadestr.c index ded0b4368..860802533 100644 --- a/ir/be/bessadestr.c +++ b/ir/be/bessadestr.c @@ -29,7 +29,7 @@ #include "benode_t.h" #include "besched_t.h" -static firm_dbg_module_t *dbg = NULL; +DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) #define DUMP_GRAPHS #define get_chordal_arch(ce) ((ce)->birg->main_env->arch_env) diff --git a/ir/be/beuses.c b/ir/be/beuses.c index ed76311c0..be79159d1 100644 --- a/ir/be/beuses.c +++ b/ir/be/beuses.c @@ -45,8 +45,8 @@ typedef struct _be_use_t { struct _be_uses_t { set *uses; ir_graph *irg; - firm_dbg_module_t *dbg; const arch_env_t *arch_env; + DEBUG_ONLY(firm_dbg_module_t *dbg;) }; diff --git a/ir/be/ia32/bearch_ia32.c b/ir/be/ia32/bearch_ia32.c index c6ba84230..bbf2d5466 100644 --- a/ir/be/ia32/bearch_ia32.c +++ b/ir/be/ia32/bearch_ia32.c @@ -419,13 +419,13 @@ ia32_irn_ops_t ia32_irn_ops = { */ static void ia32_prepare_graph(void *self) { ia32_code_gen_t *cg = self; - firm_dbg_module_t *old_mod = cg->mod; + DEBUG_ONLY(firm_dbg_module_t *old_mod = cg->mod;) FIRM_DBG_REGISTER(cg->mod, "firm.be.ia32.transform"); irg_walk_blkwise_graph(cg->irg, ia32_place_consts_set_modes, ia32_transform_node, cg); be_dump(cg->irg, "-transformed", dump_ir_block_graph_sched); - cg->mod = old_mod; + DEBUG_ONLY(cg->mod = old_mod;) if (cg->opt.doam) { edges_deactivate(cg->irg); @@ -663,7 +663,7 @@ static void ia32_after_ra_walker(ir_node *node, void *env) { tenv.dbg = get_irn_dbg_info(node); tenv.irg = current_ir_graph; tenv.irn = node; - tenv.mod = cg->mod; + DEBUG_ONLY(tenv.mod = cg->mod;) tenv.mode = get_irn_mode(node); tenv.cg = cg; diff --git a/ir/be/ia32/bearch_ia32_t.h b/ir/be/ia32/bearch_ia32_t.h index 2329eea6e..0d8c93575 100644 --- a/ir/be/ia32/bearch_ia32_t.h +++ b/ir/be/ia32/bearch_ia32_t.h @@ -43,7 +43,6 @@ typedef struct _ia32_code_gen_t { FILE *out; /**< output file */ const arch_env_t *arch_env; /**< the arch env */ set *reg_set; /**< set to memorize registers for non-ia32 nodes (e.g. phi nodes) */ - firm_dbg_module_t *mod; /**< debugging module */ int emit_decls; /**< flag indicating if decls were already emitted */ pmap *types; /**< A map of modes to primitive types */ pmap *tv_ent; /**< A map of entities that store tarvals */ @@ -52,6 +51,7 @@ typedef struct _ia32_code_gen_t { ia32_optimize_t opt; /**< contains optimization information */ char fp_kind; /**< floating point kind */ char used_x87; /**< x87 floating point unit used in this graph */ + DEBUG_ONLY(firm_dbg_module_t *mod;) /**< debugging module */ } ia32_code_gen_t; typedef struct _ia32_isa_t { @@ -77,13 +77,13 @@ typedef struct _ia32_irn_ops_t { /* this is a struct to minimize the number of parameters for transformation walker */ typedef struct _ia32_transform_env_t { - firm_dbg_module_t *mod; /**< The firm debugger */ dbg_info *dbg; /**< The node debug info */ ir_graph *irg; /**< The irg, the node should be created in */ ir_node *block; /**< The block, the node should belong to */ ir_node *irn; /**< The irn, to be transformed */ ir_mode *mode; /**< The mode of the irn */ ia32_code_gen_t *cg; /**< The code generator */ + DEBUG_ONLY(firm_dbg_module_t *mod;) /**< The firm debugger */ } ia32_transform_env_t; /** diff --git a/ir/be/ia32/ia32_emitter.c b/ir/be/ia32/ia32_emitter.c index 949e8388e..42c7356dc 100644 --- a/ir/be/ia32/ia32_emitter.c +++ b/ir/be/ia32/ia32_emitter.c @@ -1426,10 +1426,10 @@ static void ia32_register_emitters(void) { * Emits code for a node. */ static void ia32_emit_node(const ir_node *irn, void *env) { - ia32_emit_env_t *emit_env = env; - firm_dbg_module_t *mod = emit_env->mod; + ia32_emit_env_t *emit_env = env; FILE *F = emit_env->out; ir_op *op = get_irn_op(irn); + DEBUG_ONLY(firm_dbg_module_t *mod = emit_env->mod;) DBG((mod, LEVEL_1, "emitting code for %+F\n", irn)); diff --git a/ir/be/ia32/ia32_emitter.h b/ir/be/ia32/ia32_emitter.h index 72cb763a7..41416f439 100644 --- a/ir/be/ia32/ia32_emitter.h +++ b/ir/be/ia32/ia32_emitter.h @@ -10,11 +10,11 @@ #include "bearch_ia32_t.h" typedef struct _ia32_emit_env_t { - firm_dbg_module_t *mod; FILE *out; const arch_env_t *arch_env; const ia32_code_gen_t *cg; ia32_isa_t *isa; + DEBUG_ONLY(firm_dbg_module_t *mod;) } ia32_emit_env_t; const lc_arg_env_t *ia32_get_arg_env(void); diff --git a/ir/be/ia32/ia32_optimize.c b/ir/be/ia32/ia32_optimize.c index df7a64b83..b3a568736 100644 --- a/ir/be/ia32/ia32_optimize.c +++ b/ir/be/ia32/ia32_optimize.c @@ -217,7 +217,7 @@ void ia32_place_consts_set_modes(ir_node *irn, void *env) { tenv.block = get_nodes_block(irn); tenv.cg = cg; tenv.irg = cg->irg; - tenv.mod = cg->mod; + DEBUG_ONLY(tenv.mod = cg->mod;) /* Loop over all predecessors and check for Sym/Const nodes */ for (i = get_irn_arity(irn) - 1; i >= 0; --i) { @@ -596,7 +596,7 @@ static int load_store_addr_is_equal(const ir_node *load, const ir_node *store, /** * Folds Add or Sub to LEA if possible */ -static ir_node *fold_addr(ia32_code_gen_t *cg, ir_node *irn, firm_dbg_module_t *mod, ir_node *noreg) { +static ir_node *fold_addr(ia32_code_gen_t *cg, ir_node *irn, ir_node *noreg) { ir_graph *irg = get_irn_irg(irn); dbg_info *dbg = get_irn_dbg_info(irn); ir_node *block = get_nodes_block(irn); @@ -613,6 +613,7 @@ static ir_node *fold_addr(ia32_code_gen_t *cg, ir_node *irn, firm_dbg_module_t * ir_node *left, *right, *temp; ir_node *base, *index; ia32_am_flavour_t am_flav; + DEBUG_ONLY(firm_dbg_module_t *mod = cg->mod;) if (is_ia32_Add(irn)) isadd = 1; @@ -849,7 +850,6 @@ static ir_node *fold_addr(ia32_code_gen_t *cg, ir_node *irn, firm_dbg_module_t * */ void ia32_optimize_am(ir_node *irn, void *env) { ia32_code_gen_t *cg = env; - firm_dbg_module_t *mod = cg->mod; ir_node *res = irn; dbg_info *dbg; ir_mode *mode; @@ -858,6 +858,7 @@ void ia32_optimize_am(ir_node *irn, void *env) { ir_node *store, *load, *mem_proj; ir_node *succ, *addr_b, *addr_i; int check_am_src = 0; + DEBUG_ONLY(firm_dbg_module_t *mod = cg->mod;) if (! is_ia32_irn(irn)) return; @@ -889,7 +890,7 @@ void ia32_optimize_am(ir_node *irn, void *env) { /* check is irn is a candidate for address calculation */ if (is_candidate(block, irn, 1)) { DBG((mod, LEVEL_1, "\tfound address calculation candidate %+F ... ", irn)); - res = fold_addr(cg, irn, mod, noreg_gp); + res = fold_addr(cg, irn, noreg_gp); if (res == irn) DB((mod, LEVEL_1, "transformed into %+F\n", res)); diff --git a/ir/be/ia32/ia32_transform.c b/ir/be/ia32/ia32_transform.c index 4cdcfa5f2..4fa60b1ef 100644 --- a/ir/be/ia32/ia32_transform.c +++ b/ir/be/ia32/ia32_transform.c @@ -184,11 +184,11 @@ static ir_node *gen_binop(ia32_transform_env_t *env, ir_node *op1, ir_node *op2, dbg_info *dbg = env->dbg; ir_graph *irg = env->irg; ir_node *block = env->block; - firm_dbg_module_t *mod = env->mod; ir_node *noreg_gp = ia32_new_NoReg_gp(env->cg); ir_node *noreg_fp = ia32_new_NoReg_fp(env->cg); ir_node *nomem = new_NoMem(); ir_node *expr_op, *imm_op; + DEBUG_ONLY(firm_dbg_module_t *mod = env->mod;) /* Check if immediate optimization is on and */ /* if it's an operation with immediate. */ @@ -275,11 +275,11 @@ static ir_node *gen_shift_binop(ia32_transform_env_t *env, ir_node *op1, ir_node dbg_info *dbg = env->dbg; ir_graph *irg = env->irg; ir_node *block = env->block; - firm_dbg_module_t *mod = env->mod; ir_node *noreg = ia32_new_NoReg_gp(env->cg); ir_node *nomem = new_NoMem(); ir_node *expr_op, *imm_op; tarval *tv; + DEBUG_ONLY(firm_dbg_module_t *mod = env->mod;) assert(! mode_is_float(mode) && "Shift/Rotate with float not supported"); @@ -345,11 +345,11 @@ static ir_node *gen_unop(ia32_transform_env_t *env, ir_node *op, construct_unop_ ir_node *new_op = NULL; ir_mode *mode = env->mode; dbg_info *dbg = env->dbg; - firm_dbg_module_t *mod = env->mod; ir_graph *irg = env->irg; ir_node *block = env->block; ir_node *noreg = ia32_new_NoReg_gp(env->cg); ir_node *nomem = new_NoMem(); + DEBUG_ONLY(firm_dbg_module_t *mod = env->mod;) new_op = func(dbg, irg, block, noreg, noreg, op, nomem, mode_T); @@ -383,7 +383,6 @@ static ir_node *gen_unop(ia32_transform_env_t *env, ir_node *op, construct_unop_ static ir_node *gen_imm_Add(ia32_transform_env_t *env, ir_node *expr_op, ir_node *const_op) { ir_node *new_op = NULL; tarval *tv = get_ia32_Immop_tarval(const_op); - firm_dbg_module_t *mod = env->mod; dbg_info *dbg = env->dbg; ir_graph *irg = env->irg; ir_node *block = env->block; @@ -391,6 +390,7 @@ static ir_node *gen_imm_Add(ia32_transform_env_t *env, ir_node *expr_op, ir_node ir_node *nomem = new_NoMem(); int normal_add = 1; tarval_classification_t class_tv, class_negtv; + DEBUG_ONLY(firm_dbg_module_t *mod = env->mod;) /* try to optimize to inc/dec */ if (env->cg->opt.incdec && tv) { @@ -704,7 +704,6 @@ static ir_node *gen_Min(ia32_transform_env_t *env, ir_node *op1, ir_node *op2) { static ir_node *gen_imm_Sub(ia32_transform_env_t *env, ir_node *expr_op, ir_node *const_op) { ir_node *new_op = NULL; tarval *tv = get_ia32_Immop_tarval(const_op); - firm_dbg_module_t *mod = env->mod; dbg_info *dbg = env->dbg; ir_graph *irg = env->irg; ir_node *block = env->block; @@ -712,6 +711,7 @@ static ir_node *gen_imm_Sub(ia32_transform_env_t *env, ir_node *expr_op, ir_node ir_node *nomem = new_NoMem(); int normal_sub = 1; tarval_classification_t class_tv, class_negtv; + DEBUG_ONLY(firm_dbg_module_t *mod = env->mod;) /* try to optimize to inc/dec */ if (env->cg->opt.incdec && tv) { @@ -1626,8 +1626,8 @@ static ir_node *gen_Conv(ia32_transform_env_t *env, ir_node *op) { ir_node *new_op = NULL; ir_node *noreg = ia32_new_NoReg_gp(env->cg); ir_node *nomem = new_rd_NoMem(irg); - firm_dbg_module_t *mod = env->mod; ir_node *proj; + DEBUG_ONLY(firm_dbg_module_t *mod = env->mod;) if (src_mode == tgt_mode) { /* this can happen when changing mode_P to mode_Is */ @@ -1894,7 +1894,7 @@ void ia32_transform_sub_to_neg_add(ir_node *irn, ia32_code_gen_t *cg) { tenv.dbg = get_irn_dbg_info(irn); tenv.irg = cg->irg; tenv.irn = irn; - tenv.mod = cg->mod; + DEBUG_ONLY(tenv.mod = cg->mod;) tenv.mode = get_ia32_res_mode(irn); tenv.cg = cg; @@ -1977,7 +1977,7 @@ void ia32_transform_lea_to_add(ir_node *irn, ia32_code_gen_t *cg) { tenv.dbg = get_irn_dbg_info(irn); tenv.irg = cg->irg; tenv.irn = irn; - tenv.mod = cg->mod; + DEBUG_ONLY(tenv.mod = cg->mod;) tenv.mode = get_irn_mode(irn); tenv.cg = cg; @@ -2069,7 +2069,7 @@ void ia32_transform_node(ir_node *node, void *env) { tenv.dbg = get_irn_dbg_info(node); tenv.irg = current_ir_graph; tenv.irn = node; - tenv.mod = cgenv->mod; + DEBUG_ONLY(tenv.mod = cgenv->mod;) tenv.mode = get_irn_mode(node); tenv.cg = cgenv; diff --git a/ir/be/ia32/ia32_x87.c b/ir/be/ia32/ia32_x87.c index 2472cf9c7..010efd8ca 100644 --- a/ir/be/ia32/ia32_x87.c +++ b/ir/be/ia32/ia32_x87.c @@ -48,7 +48,7 @@ #define MASK_TOS(x) ((x) & (N_x87_REGS - 1)) /** the debug handle */ -static firm_dbg_module_t *dbg = NULL; +DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) /** * An exchange template. diff --git a/ir/be/mips/bearch_mips_t.h b/ir/be/mips/bearch_mips_t.h index 1e4e30388..77c9b24de 100644 --- a/ir/be/mips/bearch_mips_t.h +++ b/ir/be/mips/bearch_mips_t.h @@ -14,11 +14,11 @@ struct _mips_code_gen_t { FILE *out; /**< output file */ const arch_env_t *arch_env; /**< the arch env */ set *reg_set; /**< set to memorize registers for FIRM nodes (e.g. phi) */ - firm_dbg_module_t *mod; /**< debugging module */ int emit_decls; /**< flag indicating if decls were already emitted */ const be_irg_t *birg; /**< The be-irg (contains additional information about the irg) */ ir_node **bl_list; /**< The block schedule list. */ survive_dce_t *bl_list_sdce; /**< survive dce environment for the block schedule list */ + DEBUG_ONLY(firm_dbg_module_t *mod;) /**< debugging module */ }; @@ -40,13 +40,13 @@ typedef struct _mips_irn_ops_t { /* this is a struct to minimize the number of parameters for transformation walker */ typedef struct _mips_transform_env_t { - firm_dbg_module_t *mod; /**< The firm debugger */ dbg_info *dbg; /**< The node debug info */ ir_graph *irg; /**< The irg, the node should be created in */ ir_node *block; /**< The block, the node should belong to */ ir_node *irn; /**< The irn, to be transformed */ ir_mode *mode; /**< The mode of the irn */ mips_code_gen_t *cg; /**< The code generator */ + DEBUG_ONLY(firm_dbg_module_t *mod;) /**< The firm debugger */ } mips_transform_env_t; ir_node *mips_new_NoReg(mips_code_gen_t *cg); diff --git a/ir/be/mips/mips_emitter.c b/ir/be/mips/mips_emitter.c index 1c2cb3acc..552c9dcf2 100644 --- a/ir/be/mips/mips_emitter.c +++ b/ir/be/mips/mips_emitter.c @@ -658,10 +658,10 @@ typedef void (*emit_func) (const ir_node *, mips_emit_env_t *); */ static void mips_emit_node(ir_node *irn, mips_emit_env_t* env) { - mips_emit_env_t *emit_env = env; - firm_dbg_module_t *mod = emit_env->mod; + mips_emit_env_t *emit_env = env; FILE *F = emit_env->out; ir_op *op = get_irn_op(irn); + DEBUG_ONLY(firm_dbg_module_t *mod = emit_env->mod;) DBG((mod, LEVEL_1, "emitting code for %+F\n", irn)); diff --git a/ir/be/mips/mips_emitter.h b/ir/be/mips/mips_emitter.h index 86c4133e6..993788ae1 100644 --- a/ir/be/mips/mips_emitter.h +++ b/ir/be/mips/mips_emitter.h @@ -10,10 +10,10 @@ #include "bearch_mips_t.h" typedef struct _mips_emit_env_t { - firm_dbg_module_t *mod; FILE *out; const arch_env_t *arch_env; const mips_code_gen_t *cg; + DEBUG_ONLY(firm_dbg_module_t *mod;) } mips_emit_env_t; const lc_arg_env_t *mips_get_arg_env(void); diff --git a/ir/be/mips/mips_transform.c b/ir/be/mips/mips_transform.c index 3dcd39fee..a22dd9a98 100644 --- a/ir/be/mips/mips_transform.c +++ b/ir/be/mips/mips_transform.c @@ -986,7 +986,7 @@ void mips_transform_node(ir_node *node, void *env) { tenv.dbg = get_irn_dbg_info(node); tenv.irg = current_ir_graph; tenv.irn = node; - tenv.mod = cgenv->mod; + DEBUG_ONLY(tenv.mod = cgenv->mod;) tenv.mode = get_irn_mode(node); tenv.cg = cgenv; @@ -1134,7 +1134,7 @@ void mips_pre_transform_node(ir_node *node, void *env) { tenv.dbg = get_irn_dbg_info(node); tenv.irg = current_ir_graph; tenv.irn = node; - tenv.mod = cgenv->mod; + DEBUG_ONLY(tenv.mod = cgenv->mod;) tenv.mode = get_irn_mode(node); tenv.cg = cgenv; @@ -1173,7 +1173,7 @@ void mips_after_ra_walker(ir_node *node, void *env) { tenv.dbg = get_irn_dbg_info(node); tenv.irg = current_ir_graph; tenv.irn = node; - tenv.mod = cg->mod; + DEBUG_ONLY(tenv.mod = cg->mod;) tenv.mode = get_irn_mode(node); tenv.cg = cg; diff --git a/ir/be/ppc32/bearch_ppc32_t.h b/ir/be/ppc32/bearch_ppc32_t.h index a3b203788..2a2aac7f2 100644 --- a/ir/be/ppc32/bearch_ppc32_t.h +++ b/ir/be/ppc32/bearch_ppc32_t.h @@ -13,13 +13,13 @@ typedef struct _ppc32_code_gen_t { FILE *out; /**< output file */ const arch_env_t *arch_env; /**< the arch env */ set *reg_set; /**< set to memorize registers for FIRM nodes (e.g. phi) */ - firm_dbg_module_t *mod; /**< debugging module */ int emit_decls; /**< flag indicating if decls were already emitted */ const be_irg_t *birg; /**< The be-irg (contains additional information about the irg) */ unsigned area_size; /**< size of call area for the current irg */ entity *area; /**< the entity representing the call area or NULL for leaf functions */ ir_node *start_succ_block; /**< the block succeeding the start block in the cfg */ ir_node **blk_sched; /**< an array containing the scheduled blocks */ + DEBUG_ONLY(firm_dbg_module_t *mod;) /**< debugging module */ } ppc32_code_gen_t; @@ -41,12 +41,12 @@ typedef struct _ppc32_irn_ops_t { /** this is a struct to minimize the number of parameters for transformation walker */ typedef struct _ppc32_transform_env_t { - firm_dbg_module_t *mod; /**< The firm debugger */ dbg_info *dbg; /**< The node debug info */ ir_graph *irg; /**< The irg, the node should be created in */ ir_node *block; /**< The block, the node should belong to */ ir_node *irn; /**< The irn, to be transformed */ ir_mode *mode; /**< The mode of the irn */ + DEBUG_ONLY(firm_dbg_module_t *mod;) /**< The firm debugger */ } ppc32_transform_env_t; diff --git a/ir/be/ppc32/ppc32_emitter.c b/ir/be/ppc32/ppc32_emitter.c index 228edfca3..2192d1ded 100644 --- a/ir/be/ppc32/ppc32_emitter.c +++ b/ir/be/ppc32/ppc32_emitter.c @@ -574,10 +574,10 @@ static void ppc32_register_emitters(void) { * Emits code for a node. */ static void ppc32_emit_node(ir_node *irn, void *env) { - ppc32_emit_env_t *emit_env = env; - firm_dbg_module_t *mod = emit_env->mod; - FILE *F = emit_env->out; - ir_op *op = get_irn_op(irn); + ppc32_emit_env_t *emit_env = env; + FILE *F = emit_env->out; + ir_op *op = get_irn_op(irn); + DEBUG_ONLY(firm_dbg_module_t *mod = emit_env->mod;) DBG((mod, LEVEL_1, "emitting code for %+F\n", irn)); diff --git a/ir/be/ppc32/ppc32_emitter.h b/ir/be/ppc32/ppc32_emitter.h index 10744808a..edc9b3170 100644 --- a/ir/be/ppc32/ppc32_emitter.h +++ b/ir/be/ppc32/ppc32_emitter.h @@ -10,10 +10,10 @@ #include "bearch_ppc32_t.h" typedef struct _emit_env_t { - firm_dbg_module_t *mod; FILE *out; const arch_env_t *arch_env; const ppc32_code_gen_t *cg; + DEBUG_ONLY(firm_dbg_module_t *mod;) } ppc32_emit_env_t; const lc_arg_env_t *ppc32_get_arg_env(void); diff --git a/ir/be/ppc32/ppc32_transform.c b/ir/be/ppc32/ppc32_transform.c index be7afc1c0..055f29ff7 100644 --- a/ir/be/ppc32/ppc32_transform.c +++ b/ir/be/ppc32/ppc32_transform.c @@ -1357,7 +1357,7 @@ void ppc32_transform_node(ir_node *node, void *env) { tenv.dbg = get_irn_dbg_info(node); tenv.irg = current_ir_graph; tenv.irn = node; - tenv.mod = cgenv->mod; + DEBUG_ONLY(tenv.mod = cgenv->mod;) tenv.mode = get_irn_mode(node); #define UNOP(a) case iro_##a: asm_node = gen_##a(&tenv, get_##a##_op(node)); break @@ -1746,7 +1746,7 @@ void ppc32_transform_const(ir_node *node, void *env) { tenv.dbg = get_irn_dbg_info(node); tenv.irg = current_ir_graph; tenv.irn = node; - tenv.mod = cgenv->mod; + DEBUG_ONLY(tenv.mod = cgenv->mod;) tenv.mode = get_irn_mode(node); #define OTHER_GEN(a) \ diff --git a/ir/be/ppc32/ppc32_transform_conv.c b/ir/be/ppc32/ppc32_transform_conv.c index 8e74a094f..b50029294 100644 --- a/ir/be/ppc32/ppc32_transform_conv.c +++ b/ir/be/ppc32/ppc32_transform_conv.c @@ -208,7 +208,7 @@ void finalize_block(ppc32_code_gen_t *cgenv) tenv.block = current_block; tenv.irg = current_ir_graph; - tenv.mod = cgenv->mod; + DEBUG_ONLY(tenv.mod = cgenv->mod;) memory = get_irg_no_mem(current_ir_graph); for(i = 0; i < attr->conv_count; i++) @@ -360,7 +360,7 @@ void ppc32_conv_walk(ir_node *node, void *env) { } tenv.irg = current_ir_graph; - tenv.mod = cgenv->mod; + DEBUG_ONLY(tenv.mod = cgenv->mod;) if (code == iro_Conv) { @@ -456,7 +456,7 @@ void ppc32_pretransform_walk(ir_node *node, void *env) { } tenv.irg = current_ir_graph; - tenv.mod = cgenv->mod; + DEBUG_ONLY(tenv.mod = cgenv->mod;) if(code == iro_Const || code == iro_SymConst) {