X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firgraph.c;h=8e9125a356d1d8ad8f185bf2ad91833f2aef5e69;hb=10095ba5b312beeb57f0f0b587afc2b187dfcae7;hp=4c60503d6de0012cfe393a7ca74cc9574675078d;hpb=1d265ff57b0137d181368d97cdbd93f3c14d94aa;p=libfirm diff --git a/ir/ir/irgraph.c b/ir/ir/irgraph.c index 4c60503d6..8e9125a35 100644 --- a/ir/ir/irgraph.c +++ b/ir/ir/irgraph.c @@ -95,6 +95,7 @@ new_ir_graph (entity *ent, int n_loc) res->Phi_in_stack = new_Phi_in_stack(); /* A stack needed for automatic Phi generation */ #endif + res->kind = k_ir_graph; res->obst = (struct obstack *) xmalloc (sizeof (struct obstack)); obstack_init (res->obst); res->value_table = new_identities (); /* value table for global value @@ -129,8 +130,8 @@ new_ir_graph (entity *ent, int n_loc) /* Proj results of start node */ projX = new_Proj (res->start, mode_X, pns_initial_exec); set_store (new_Proj (res->start, mode_M, pns_global_store)); - res->frame = new_Proj (res->start, mode_P, pns_frame_base); - res->globals = new_Proj (res->start, mode_P, pns_globals); + res->frame = new_Proj (res->start, mode_P_mach, pns_frame_base); + res->globals = new_Proj (res->start, mode_P_mach, pns_globals); res->args = new_Proj (res->start, mode_T, pns_args); #ifdef DEBUG_libfirm res->graph_nr = get_irp_new_node_nr(); @@ -167,6 +168,7 @@ ir_graph *new_const_code_irg() { #if USE_EXPLICIT_PHI_IN_STACK res->Phi_in_stack = NULL; #endif + res->kind = k_ir_graph; res->obst = (struct obstack *) xmalloc (sizeof (struct obstack)); obstack_init (res->obst); res->phase_state = phase_building; @@ -218,6 +220,15 @@ void free_ir_graph (ir_graph *irg) { {attr type} get_irg_{attribute name} (ir_graph *irg); void set_irg_{attr name} (ir_graph *irg, {attr type} {attr}); */ +int +is_ir_graph(void *thing) { + assert(thing); + if (get_kind(thing) == k_ir_graph) + return 1; + else + return 0; +} + /* Outputs a unique number for this node */ INLINE long