X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firgraph.c;h=249fdb55a0347d235e98f9818ebb29b019deaa28;hb=5f8ddee6b08c8040c0a304a347d65045c1141d52;hp=9c70e9c3d1e346fcb6d567b6ad32d7da1afa07da;hpb=fbbb55c1f112790feb394560fa936d23760320ef;p=libfirm diff --git a/ir/ir/irgraph.c b/ir/ir/irgraph.c index 9c70e9c3d..249fdb55a 100644 --- a/ir/ir/irgraph.c +++ b/ir/ir/irgraph.c @@ -7,14 +7,20 @@ */ # include "ircons.h" -# include "irgraph.h" +# include "irgraph_t.h" # include "irprog.h" -# include "iropt.h" +# include "iropt_t.h" # include "array.h" # include "irgmod.h" ir_graph *current_ir_graph; +#if USE_EXPICIT_PHI_IN_STACK +/* really defined in ircons.c */ +typedef struct Phi_in_stack Phi_in_stack; +Phi_in_stack *new_Phi_in_stack(); +#endif + /* Allocates a list of nodes: - The start block containing a start node and Proj nodes for it's four results (X, M, P, Tuple). @@ -25,7 +31,7 @@ ir_graph *current_ir_graph; and optimization. */ ir_graph * -new_ir_graph (entity *ent, int params) +new_ir_graph (entity *ent, int n_loc) { ir_graph *res; ir_node *first_block; @@ -37,7 +43,7 @@ new_ir_graph (entity *ent, int params) /** Internal information for graph construction either held in the graph or *** initialized for each graph. **/ - res->params = params + 1; /* number of local variables that are never + res->n_loc = n_loc + 1; /* number of local variables that are never dereferenced in this graph plus one for the store. This is not the number of parameters to the procedure! */ @@ -50,18 +56,19 @@ new_ir_graph (entity *ent, int params) #endif res->obst = (struct obstack *) xmalloc (sizeof (struct obstack)); obstack_init (res->obst); - res->value_table = new_identities (); /* value table for global value numbering - for optimizing use in iropt.c */ + res->value_table = new_identities (); /* value table for global value + numbering for optimizing use in + iropt.c */ /** Type inforamtion for the procedure of the graph **/ res->ent = ent; - /* ent->irg = res; */ + set_entity_irg(ent, res); /** Nodes needed in every graph **/ - res->end_block = new_Block (); + res->end_block = new_immBlock (); res->end = new_End (); - res->start_block = new_Block (); + res->start_block = new_immBlock (); res->start = new_Start (); res->bad = new_ir_node (res, res->start_block, op_Bad, mode_T, 0, NULL); @@ -80,7 +87,7 @@ new_ir_graph (entity *ent, int params) mature_block (res->current_block); /** Make a block to start with **/ - first_block = new_Block (); + first_block = new_immBlock (); add_in_edge (first_block, projX); return res; @@ -214,6 +221,7 @@ set_irg_current_block (ir_graph *irg, ir_node *node) entity * get_irg_ent (ir_graph *irg) { + assert(irg && irg->ent); return irg->ent; } @@ -224,15 +232,15 @@ set_irg_ent (ir_graph *irg, entity *ent) } int -get_irg_params (ir_graph *irg) +get_irg_n_loc (ir_graph *irg) { - return irg->params; + return irg->n_loc; } void -set_irg_params (ir_graph *irg, int params) +set_irg_n_loc (ir_graph *irg, int n_loc) { - irg->params = params; + irg->n_loc = n_loc; } unsigned long