From b75f6949aa4b8e5bacf4013549b82d0d05f60d0a Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 29 Sep 2006 19:00:12 +0000 Subject: [PATCH] set the global type and tls type flags on the globat/tls type [r8312] --- ir/ir/irprog.c | 30 ++++++++++++++++-------------- ir/ir/irprog_t.h | 36 ++++++++++++++++++------------------ 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/ir/ir/irprog.c b/ir/ir/irprog.c index cc01bcd11..09e3226cc 100644 --- a/ir/ir/irprog.c +++ b/ir/ir/irprog.c @@ -73,6 +73,10 @@ static ir_prog *complete_ir_prog(ir_prog *irp) { remove_irp_type(irp->glob_type); remove_irp_type(irp->tls_type); + /* set these flags for debugging */ + irp->glob_type->flags |= tf_global_type; + irp->tls_type->flags |= tf_tls_type; + irp->const_code_irg = new_const_code_irg(); irp->phase_state = phase_building; @@ -102,7 +106,7 @@ ir_prog *new_ir_prog (void) { /* frees all memory used by irp. Types in type list, irgs in irg list and entities in global type must be freed by hand before. */ -void free_ir_prog(void) { +void free_ir_prog(void) { if (irp->glob_type) free_type(irp->glob_type); if (irp->tls_type) @@ -125,7 +129,7 @@ void free_ir_prog(void) { /* Access the main routine of the compiled program. */ ir_graph *get_irp_main_irg(void) { - assert (irp); + assert(irp); return irp->main_irg; } @@ -192,8 +196,8 @@ ir_graph *(get_irp_irg)(int pos){ } void set_irp_irg(int pos, ir_graph *irg) { - assert (irp && irg); - assert (pos < (ARR_LEN(irp->graphs))); + assert(irp && irg); + assert(pos < (ARR_LEN(irp->graphs))); irp->graphs[pos] = irg; } @@ -217,7 +221,7 @@ ir_graph *get_irp_allirg(int pos) { /* Adds type to the list of types in irp. */ void add_irp_type(ir_type *typ) { - assert (typ != NULL); + assert(typ != NULL); assert(irp); ARR_APP1 (ir_type *, irp->types, typ); } @@ -247,8 +251,8 @@ ir_type *(get_irp_type) (int pos) { } void set_irp_type(int pos, ir_type *typ) { - assert (irp && typ); - assert (pos < (ARR_LEN((irp)->types))); + assert(irp && typ); + assert(pos < (ARR_LEN((irp)->types))); irp->types[pos] = typ; } @@ -279,11 +283,11 @@ void add_irp_opcode(ir_op *opcode) { /* Removes opcode from the list of opcodes and shrinks the list by one. */ void remove_irp_opcode(ir_op *opcode) { int i; - assert(opcode); + assert(opcode); for (i = ARR_LEN(irp->opcodes) -1; i >= 0; i--) { if (irp->opcodes[i] == opcode) { - for(; i < (ARR_LEN(irp->opcodes)) - 1; i++) { + for (; i < (ARR_LEN(irp->opcodes)) - 1; i++) { irp->opcodes[i] = irp->opcodes[i+1]; } ARR_SETLEN(ir_op *, irp->opcodes, (ARR_LEN(irp->opcodes)) - 1); @@ -334,7 +338,7 @@ ir_graph *(get_const_code_irg)(void) { irg_phase_state get_irp_phase_state(void) { return irp->phase_state; } -void set_irp_phase_state(irg_phase_state s) { +void set_irp_phase_state(irg_phase_state s) { irp->phase_state = s; } @@ -346,13 +350,11 @@ void set_irp_ip_outs_inconsistent(void) { irp->outs_state = outs_inconsistent; } -void set_irp_ip_outedges(ir_node ** ip_outedges) -{ +void set_irp_ip_outedges(ir_node ** ip_outedges) { irp->ip_outedges = ip_outedges; } -ir_node** get_irp_ip_outedges(void) -{ +ir_node** get_irp_ip_outedges(void) { return irp->ip_outedges; } diff --git a/ir/ir/irprog_t.h b/ir/ir/irprog_t.h index 51781d0a2..8813f5dd4 100644 --- a/ir/ir/irprog_t.h +++ b/ir/ir/irprog_t.h @@ -40,10 +40,10 @@ struct ir_prog { firm_kind kind; /**< must be k_ir_prog */ ident *name; /**< A file name or the like. */ - ir_graph *main_irg; /**< entry point to the compiled program - @@@ or a list, in case we compile a library or the like? */ - ir_graph **graphs; /**< all graphs in the ir */ - ir_graph **pseudo_graphs; /**< all pseudo graphs in the ir. See pseudo_irg.c */ + ir_graph *main_irg; /**< The entry point to the compiled program + or NULL if no poit exist. */ + ir_graph **graphs; /**< A list of all graphs in the ir. */ + ir_graph **pseudo_graphs; /**< A list of all pseudo graphs in the ir. See pseudo_irg.c */ ir_graph *const_code_irg; /**< This ir graph gives the proper environment to allocate nodes the represent values of constant entities. It is not meant as @@ -52,35 +52,35 @@ struct ir_prog { have fields and procedures. */ ir_type *tls_type; /**< The thread local storage type. Must be a struct as it can only have fields. */ - ir_type **types; /**< all types in the ir */ - ir_mode **modes; /**< all modes in the ir */ - ir_op **opcodes; /**< all opcodes in the ir */ + ir_type **types; /**< A list of all types in the ir. */ + ir_mode **modes; /**< A list of all modes in the ir. */ + ir_op **opcodes; /**< A list of all opcodes in the ir. */ /* -- states of and access to generated information -- */ - irg_phase_state phase_state; /**< State of construction. */ + irg_phase_state phase_state; /**< The state of construction. */ - ip_view_state ip_view; /**< State of interprocedural view. */ + ip_view_state ip_view; /**< The state of interprocedural view. */ - irg_outs_state outs_state; /**< State of out edges of ir nodes. */ - ir_node **ip_outedges; /**< Huge Array that contains all out edges + irg_outs_state outs_state; /**< The state of out edges of ir nodes. */ + ir_node **ip_outedges; /**< A huge Array that contains all out edges in interprocedural view. */ - irg_outs_state trouts_state; /**< State of out edges of type information. */ + irg_outs_state trouts_state; /**< The state of out edges of type information. */ irg_callee_info_state callee_info_state; /**< Validity of callee information. - Contains the lowest value or all irgs. */ + Contains the lowest value or all irgs. */ ir_typeinfo_state typeinfo_state; /**< Validity of type information. */ inh_transitive_closure_state inh_trans_closure_state; /**< trans closure of inh relations. */ - irp_callgraph_state callgraph_state; /**< State of the callgraph. */ + irp_callgraph_state callgraph_state; /**< The state of the callgraph. */ ir_loop *outermost_cg_loop; /**< For callgraph analysis: entry point - to looptree over callgraph. */ + to looptree over callgraph. */ int max_callgraph_loop_depth; /**< needed in callgraph. */ int max_callgraph_recursion_depth; /**< needed in callgraph. */ double max_method_execution_frequency; /**< needed in callgraph. */ irp_temperature_state temperature_state; /**< accumulated temperatures computed? */ - exec_freq_state execfreq_state; /**< State of execution freqency information */ - loop_nesting_depth_state lnd_state; /**< State of loop nesting depth information. */ - ir_class_cast_state class_cast_state; /**< kind of cast operations in code. */ + exec_freq_state execfreq_state; /**< The state of execution frequency information */ + loop_nesting_depth_state lnd_state; /**< The state of loop nesting depth information. */ + ir_class_cast_state class_cast_state; /**< The state of cast operations in code. */ #ifdef DEBUG_libfirm long max_node_nr; /**< to generate unique numbers for nodes. */ -- 2.20.1