X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana2%2Fpto_comp.c;h=94487cd448295c8b78f0869c72605bf45b65a83c;hb=c53a503e81f6e7c0995fbbcc451c2178ad9083bd;hp=f2bfeaa7b24d22161fb99886d71611ddfcf6019d;hpb=f001e5b3cb89f984c977a9f7d4aef02cc3cc56eb;p=libfirm diff --git a/ir/ana2/pto_comp.c b/ir/ana2/pto_comp.c index f2bfeaa7b..94487cd44 100644 --- a/ir/ana2/pto_comp.c +++ b/ir/ana2/pto_comp.c @@ -2,7 +2,7 @@ /* Project: libFIRM - File name: ir/ana/pto_comp.c + File name: ir/ana2/pto_comp.c Purpose: Main Implementation of PTO Author: Florian Modified by: @@ -29,7 +29,7 @@ # include "pto_mod.h" # include "irnode_t.h" -# include "irprog.h" +# include "irprog_t.h" # include "xmalloc.h" # include "irmemwalk.h" @@ -38,10 +38,14 @@ # include "ecg.h" +# include "gnu_ext.h" + /* Local Defines: */ /* Local Data Types: */ typedef struct pto_env_str { + struct pto_env_str *enc_env; + ir_graph *graph; int ctx_idx; int change; } pto_env_t; @@ -53,7 +57,7 @@ typedef struct pto_env_str { char *spaces = NULL; /* Local Prototypes: */ -static pto_t *get_pto (ir_node*); +static pto_t *get_pto (ir_node*, pto_env_t*); static void pto_call (ir_graph*, ir_node*, pto_env_t*); static void pto_raise (ir_node*, pto_env_t*); static void pto_load (ir_node*, pto_env_t*); @@ -64,21 +68,64 @@ static void pto_end_block (ir_node*, pto_env_t*); /* =================================================== Local Implementation: =================================================== */ +/* Add values of the actual arguments to the formal arguments */ +static int add_graph_args (ir_graph *graph, ir_node *call, pto_env_t *env) +{ + int change = FALSE; + ir_type *meth = get_entity_type (get_irg_entity (graph)); + ir_node **args = get_irg_proj_args (graph); + int i, n_args; + + assert(op_Call == get_irn_op(call)); + + n_args = get_Call_n_params (call); + + DBGPRINT (1, (stdout, "%s: args of %s[%li] -> 0x%08x\n", + __FUNCTION__, + OPNAME (call), OPNUM (call), (int) graph)); + + for (i = 0; i < n_args; i ++) { + if (NULL != args [i]) { + if (mode_P == get_type_mode (get_method_param_type (meth, i))) { + ir_node *call_arg = get_Call_param (call, i); + pto_t *arg_pto = get_pto (call_arg, env); + pto_t *frm_pto = get_node_pto (args [i]); + + assert (arg_pto); + assert (frm_pto); + + change |= qset_insert_all (frm_pto->values, arg_pto->values); + + DBGPRINT (2, (stdout, "%s: arg [%i]: -> %s[%li] (%i) -> %s[%li] (%i)\n", + __FUNCTION__, + i, + OPNAME (call_arg), OPNUM (call_arg), + arg_pto->values->id, + OPNAME (args [i]), OPNUM (args [i]), + frm_pto->values->id)); + } + } + } + + return (change); +} + /* Transfer the actual arguments to the formal arguments */ -static void set_graph_args (ir_graph *graph, ir_node *call) +static void set_graph_args (ir_graph *graph, ir_node *call, pto_env_t *env) { - assert (iro_Call == get_irn_opcode (call)); + ir_type *meth = get_entity_type (get_irg_entity (graph)); + ir_node **args = get_irg_proj_args (graph); + int i, n_args; - type *meth = get_entity_type (get_irg_entity (graph)); - ir_node **args = find_irg_args (graph); - int n_args = get_Call_n_params (call); - int i; + assert (op_Call == get_irn_op(call)); + + n_args = get_Call_n_params (call); for (i = 0; i < n_args; i ++) { if (NULL != args [i]) { if (mode_P == get_type_mode (get_method_param_type (meth, i))) { ir_node *call_arg = get_Call_param (call, i); - pto_t *pto = get_pto (call_arg); + pto_t *pto = get_pto (call_arg, env); assert (pto); set_node_pto (args [i], pto); @@ -96,11 +143,13 @@ static void set_graph_args (ir_graph *graph, ir_node *call) /* Transfer the graph's result to the call */ static int set_graph_result (ir_graph *graph, ir_node *call) { - type *tp = get_entity_type (get_irg_entity (graph)); - int change = FALSE; + ir_type *tp = get_entity_type (get_irg_entity (graph)); + ir_node *end_block; + pto_t *ret_pto, *call_pto; + int change; if (0 == get_method_n_ress (tp)) { - return (change); + return (FALSE); } tp = get_method_res_type (tp, 0); @@ -108,29 +157,40 @@ static int set_graph_result (ir_graph *graph, ir_node *call) if (mode_P != get_type_mode (tp)) { set_node_pto (call, NULL); - return (change); + return (FALSE); } - ir_node *end_block = get_irg_end_block (graph); - pto_t *ret_pto = get_node_pto (end_block); + end_block = get_irg_end_block (graph); + ret_pto = get_node_pto (end_block); - pto_t *call_pto = get_node_pto (call); + call_pto = get_node_pto (call); assert (call_pto); - change |= qset_insert_all (call_pto->values, ret_pto->values); + DBGPRINT (1, (stdout, "%s: before change args\n", __FUNCTION__)); + DBGEXE (1, pto_print_pto (end_block)); + DBGEXE (1, pto_print_pto (call)); + + change = qset_insert_all (call_pto->values, ret_pto->values); + + if (change) { + DBGPRINT (1, (stdout, "%s: after change args\n", __FUNCTION__)); + DBGEXE (1, pto_print_pto (end_block)); + DBGEXE (1, pto_print_pto (call)); + /* assert (0); */ + } return (change); } /* Propagation of PTO values */ -static pto_t *get_pto_proj (ir_node *proj) +static pto_t *get_pto_proj (ir_node *proj, pto_env_t *env) { ir_node *proj_in = get_Proj_pred (proj); const long proj_proj = get_Proj_proj (proj); const opcode in_op = get_irn_opcode (proj_in); pto_t *in_pto = NULL; - pto_t *proj_pto = get_node_pto (proj); + pto_t *proj_pto = NULL; /* get_node_pto (proj); */ ir_node *proj_in_in = NULL; @@ -139,10 +199,13 @@ static pto_t *get_pto_proj (ir_node *proj) assert (0 && "pto from ProjT(Start) requested"); return (NULL); - case (iro_Proj): /* ProjT (Start), ProjT (Call) */ + case (iro_Proj): { /* ProjT (Start), ProjT (Call) */ + opcode in_in_op; + long proj_in_proj; + proj_in_in = get_Proj_pred (proj_in); - const opcode in_in_op = get_irn_opcode (proj_in_in); - const long proj_in_proj = get_Proj_proj (proj_in); + in_in_op = get_irn_opcode (proj_in_in); + proj_in_proj = get_Proj_proj (proj_in); assert ((pn_Start_T_args == proj_in_proj) || (pn_Call_T_result == proj_in_proj)); @@ -150,6 +213,7 @@ static pto_t *get_pto_proj (ir_node *proj) switch (in_in_op) { case (iro_Start): /* ProjArg (ProjT (Start)) */ /* then the pto value must have been set to the node */ + proj_pto = get_node_pto (proj); assert (proj_pto); return (proj_pto); @@ -157,7 +221,7 @@ static pto_t *get_pto_proj (ir_node *proj) if (NULL != proj_pto) { return (proj_pto); } else { - in_pto = get_pto (proj_in); + in_pto = get_pto (proj_in, env); set_node_pto (proj, in_pto); assert (in_pto); @@ -167,6 +231,7 @@ static pto_t *get_pto_proj (ir_node *proj) default: assert (0 && "Proj(Proj(?))"); } /* done with case (in_op == iro_Proj) */ + } case (iro_Load): /* ProjV (Load) */ assert (pn_Load_res == proj_proj); @@ -177,94 +242,108 @@ static pto_t *get_pto_proj (ir_node *proj) if (NULL != proj_pto) { return (proj_pto); } else { - in_pto = get_pto (proj_in); + in_pto = get_pto (proj_in, env); assert (in_pto); set_node_pto (proj, in_pto); return (in_pto); } default: - fprintf (stderr, "%s: not handled: proj (%s[%li])\n", - __FUNCTION__, + fprintf (stderr, "get_pto_proj(/*todo*/): not handled: proj (%s[%li])\n", get_op_name (get_irn_op (proj_in)), get_irn_node_nr (proj_in)); assert (0 && "Proj(?)"); + return NULL; } } -static pto_t *get_pto_phi (ir_node *phi) +static pto_t *get_pto_phi (ir_node *phi, pto_env_t *env) { - assert (mode_P == get_irn_mode (phi)); + pto_t *pto; + int change = FALSE; + int i, n_ins; - pto_t *pto = get_node_pto (phi); + assert (mode_P == get_irn_mode (phi)); + pto = get_node_pto (phi); assert (pto); /* must be initialised */ - int n_ins = get_irn_arity (phi); - int i; - + n_ins = get_irn_arity (phi); for (i = 0; i < n_ins; i ++) { ir_node *in = get_irn_n (phi, i); - pto_t *in_pto = get_pto (in); + pto_t *in_pto = get_pto (in, env); assert (in_pto); - qset_insert_all (pto->values, in_pto->values); + change |= qset_insert_all (pto->values, in_pto->values); } + env->change |= change; + return (pto); } -static pto_t *get_pto_sel (ir_node *sel) +static pto_t *get_pto_sel (ir_node *sel, pto_env_t *env) { - pto_t *pto = get_node_pto (sel); + pto_t *pto = NULL; /* get_node_pto (sel); */ if (NULL == pto) { ir_node *in = get_Sel_ptr (sel); - pto = get_pto (in); + pto = get_pto (in, env); set_node_pto (sel, pto); } return (pto); } -static pto_t *get_pto_ret (ir_node *ret) +static pto_t *get_pto_ret (ir_node *ret, pto_env_t *env) { - pto_t *pto = get_node_pto (ret); + pto_t *pto = NULL; /* get_node_pto (ret); */ if (NULL == pto) { ir_node *in = get_Return_res (ret, 0); - pto = get_pto (in); + pto = get_pto (in, env); set_node_pto (ret, pto); } assert (pto); + DBGPRINT (9, (stdout, "%s: ", __FUNCTION__)); + DBGEXE (9, pto_print_pto (ret)); + return (pto); } /* Dispatch to propagate PTO values */ -static pto_t *get_pto (ir_node *node) +static pto_t *get_pto (ir_node *node, pto_env_t *env) { const opcode op = get_irn_opcode (node); + DBGPRINT (2, (stdout, "%s (%s[%li])\n", + __FUNCTION__, + OPNAME (node), OPNUM (node))); + switch (op) { - case (iro_Cast): return (get_pto (get_Cast_op (node))); - case (iro_Proj): return (get_pto_proj (node)); - case (iro_Phi): return (get_pto_phi (node)); - case (iro_Sel): return (get_pto_sel (node)); + case (iro_Cast): return (get_pto (get_Cast_op (node), env)); + case (iro_Proj): return (get_pto_proj (node, env)); + case (iro_Phi): return (get_pto_phi (node, env)); + case (iro_Sel): return (get_pto_sel (node, env)); case (iro_Alloc): return (get_alloc_pto (node)); - case (iro_Return): return (get_pto_ret (node)); + case (iro_Return): return (get_pto_ret (node, env)); case (iro_Call): /* FALLTHROUGH */ case (iro_Load): /* FALLTHROUGH */ case (iro_Const): /* FALLTHROUGH */ - case (iro_SymConst): return (get_node_pto (node)); + case (iro_SymConst):{ + pto_t *pto = get_node_pto (node); + assert (pto); + return (pto); + } default: /* stopgap measure */ fprintf (stderr, "%s: not handled: node[%li].op = %s\n", @@ -272,7 +351,7 @@ static pto_t *get_pto (ir_node *node) get_irn_node_nr (node), get_op_name (get_irn_op (node))); assert (0 && "something not handled"); - + return NULL; } } @@ -280,70 +359,88 @@ static pto_t *get_pto (ir_node *node) /* Actions for the nodes: */ static void pto_load (ir_node *load, pto_env_t *pto_env) { + ir_node *ptr; + entity *ent; + /* perform load */ - DBGPRINT (2, (stdout, "%s (%s[%li]): pto = %p\n", __FUNCTION__, - OPNAME (load), OPNUM (load), (void*) get_node_pto (load))); + DBGPRINT (2, (stdout, "%s (%s[%li]): pto = 0x%08x\n", + __FUNCTION__, + OPNAME (load), OPNUM (load), (int) get_node_pto (load))); - ir_node *ptr = get_Load_ptr (load); + ptr = get_Load_ptr (load); if (is_dummy_load_ptr (ptr)) { return; } - entity *ent = get_ptr_ent (ptr); - pto_t *ptr_pto = get_pto (ptr); + ent = get_ptr_ent (ptr); - assert (ptr_pto); + if (mode_P == get_type_mode (get_entity_type (ent))) { + pto_t *ptr_pto = get_pto (ptr, pto_env); + + assert (ptr_pto); - DBGPRINT (1, (stdout, "%s (%s[%li]): ptr = %p\n", __FUNCTION__, - OPNAME (ptr), OPNUM (ptr), (void*) ptr_pto)); + DBGPRINT (1, (stdout, "%s (%s[%li]): ptr = 0x%08x\n", + __FUNCTION__, + OPNAME (ptr), OPNUM (ptr), (int) ptr_pto)); - pto_env->change |= mod_load (load, ent, ptr_pto); + pto_env->change |= mod_load (load, ent, ptr_pto); + } } static void pto_store (ir_node *store, pto_env_t *pto_env) { + ir_node *ptr, *val; + entity *ent; + pto_t *ptr_pto, *val_pto; + /* perform store */ - DBGPRINT (2, (stdout, "%s (%s[%li]) (no pto)\n", __FUNCTION__, + DBGPRINT (2, (stdout, "%s (%s[%li]) (no pto)\n", + __FUNCTION__, OPNAME (store), OPNUM (store))); - ir_node *ptr = get_Store_ptr (store); - ir_node *val = get_Store_value (store); + ptr = get_Store_ptr (store); + val = get_Store_value (store); if (mode_P != get_irn_mode (val)) { return; } - entity *ent = get_ptr_ent (ptr); + ent = get_ptr_ent (ptr); - pto_t *ptr_pto = get_pto (ptr); - pto_t *val_pto = get_pto (val); + ptr_pto = get_pto (ptr, pto_env); + val_pto = get_pto (val, pto_env); assert (ptr_pto); assert (val_pto); - DBGPRINT (1, (stdout, "%s (%s[%li]): ptr_pto = %p\n", __FUNCTION__, - OPNAME (store), OPNUM (store), (void*) ptr_pto)); - DBGPRINT (1, (stdout, "%s (%s[%li]): val_pto = %p\n", __FUNCTION__, - OPNAME (store), OPNUM (store), (void*) val_pto)); + DBGPRINT (2, (stdout, "%s (%s[%li]): ptr_pto = 0x%08x\n", + __FUNCTION__, + OPNAME (ptr), OPNUM (ptr), (int) ptr_pto)); + DBGPRINT (2, (stdout, "%s (%s[%li]): val_pto = 0x%08x\n", + __FUNCTION__, + OPNAME (val), OPNUM (val), (int) val_pto)); pto_env->change |= mod_store (store, ent, ptr_pto, val_pto); } static void pto_method (ir_node *call, pto_env_t *pto_env) { - DBGPRINT (2, (stdout, "%s:%i (%s[%li]): pto = %p\n", + int i; + callEd_info_t *callEd_info; + + DBGPRINT (2, (stdout, "%s:%i (%s[%li]): pto = 0x%08x\n", __FUNCTION__, __LINE__, OPNAME (call), OPNUM (call), - (void*) get_node_pto (call))); + (int) get_node_pto (call))); - callEd_info_t *callEd_info = ecg_get_callEd_info (call); + callEd_info = ecg_get_callEd_info (call); if (NULL == callEd_info) { DBGPRINT (2, (stdout, "%s:%i (%s[%li]), no graph\n", __FUNCTION__, __LINE__, OPNAME (call), OPNUM (call))); } - int i = 0; + i = 0; while (NULL != callEd_info) { DBGPRINT (2, (stdout, "%s:%i (%s[%li]), graph %i\n", __FUNCTION__, __LINE__, OPNAME (call), OPNUM (call), i ++)); @@ -355,12 +452,12 @@ static void pto_method (ir_node *call, pto_env_t *pto_env) } /* Perform the appropriate action on the given node */ -static void pto_node_node (ir_node *node, pto_env_t *pto_env) +static void pto_node_node(ir_node *node, pto_env_t *pto_env) { - DBGPRINT (1, (stdout, "%s (%s[%li])\n", __FUNCTION__, - OPNAME (node), OPNUM (node))); + opcode op = get_irn_opcode (node); - const opcode op = get_irn_opcode (node); + DBGPRINT (1, (stdout, "%s (%s[%li])\n", + __FUNCTION__, OPNAME (node), OPNUM (node))); switch (op) { case (iro_Start): /* nothing */ break; @@ -426,20 +523,17 @@ static void pto_node_post (ir_node *node, void *env) { pto_env_t *pto_env = (pto_env_t*) env; + DBGPRINT (999, (stdout, "%s (%s[%li])\n", + __FUNCTION__, + OPNAME (node), OPNUM (node))); + pto_node_node (node, pto_env); } /* Perform a single pass over the given graph */ static void pto_graph_pass (ir_graph *graph, void *pto_env) { - entity *ent = get_irg_entity (graph); - const char *ent_name = (char*) get_entity_name (ent); - const char *own_name = (char*) get_type_name (get_entity_owner (ent)); - /* HERE3 ("start", own_name, ent_name); */ - irg_walk_mem (graph, pto_node_pre, pto_node_post, pto_env); - - /* HERE3 ("end ", own_name, ent_name); */ } /* Continue PTO for one of the graphs called at a Call */ @@ -447,49 +541,86 @@ static void pto_call (ir_graph *graph, ir_node *call, pto_env_t *pto_env) { int change = FALSE; - /* perform call */ - DBGPRINT (1, (stdout, "%s:%i (%s[%li])\n", - __FUNCTION__, __LINE__, OPNAME (call), OPNUM (call))); - /* only for debugging stuff: */ entity *ent = get_irg_entity (graph); const char *ent_name = (char*) get_entity_name (ent); const char *own_name = (char*) get_type_name (get_entity_owner (ent)); + /* perform call */ + DBGPRINT (2, (stdout, "%s (%s[%li]) to \"%s.%s\"\n", + __FUNCTION__, + OPNAME (call), OPNUM (call), + own_name, ent_name)); + if (! get_irg_is_mem_visited (graph)) { + /* handle direct call */ graph_info_t *ginfo = ecg_get_info (graph); /* Save CTX */ int ctx_idx = find_ctx_idx (call, ginfo, get_curr_ctx ()); ctx_info_t *call_ctx = get_ctx (ginfo, ctx_idx); ctx_info_t *old_ctx = set_curr_ctx (call_ctx); - DBGPRINT (3, (stdout, "%s>CTX: ", -- spaces)); - DBGEXE (3, ecg_print_ctx (call_ctx, stdout)); + + DBGPRINT (1, (stdout, "%s>CTX: ", -- spaces)); + DBGEXE (1, ecg_print_ctx (call_ctx, stdout)); /* Initialise Alloc Names and Node values */ pto_reset_graph_pto (graph, ctx_idx); /* Compute Arguments */ - set_graph_args (graph, call); + set_graph_args (graph, call, pto_env); /* Visit/Iterate Graph */ - pto_graph (graph, ctx_idx); + pto_graph (graph, ctx_idx, pto_env); /* Restore CTX */ set_curr_ctx (old_ctx); + /* Get Return Value from Graph */ change |= set_graph_result (graph, call); - DBGPRINT (3, (stdout, "%sgraph) { + enc_env = enc_env->enc_env; /* talk about naming issues here */ + + /* since we're in a recursion loop, we *must* find an env for the callEd here: */ + assert (NULL != enc_env->enc_env); + } + /* Re-Set arguments */ + rec_change = add_graph_args (graph, call, pto_env); - /* Get Return Value from Graph */ - } else { - DBGPRINT (2, (stdout, "%s: recursion into \"%s.%s\"\n", - __FUNCTION__, own_name, ent_name)); + DBGPRINT (1, (stdout, "%s: return in:", __FUNCTION__)); + DBGEXE (1, pto_print_pto (get_irg_end_block (graph))); + + if (rec_change) { + DBGPRINT (0, (stdout, "%s: change args\n", __FUNCTION__)); + } + + rec_change |= set_graph_result (graph, call); + + if (rec_change) { + DBGPRINT (1, (stdout, "%s: return out:", __FUNCTION__)); + DBGEXE (1, pto_print_pto (get_irg_end_block (graph))); + } + +# if 0 + /* appears that we don't need this: */ + enc_env->change |= rec_change; +# endif /* 0 */ } /* Todo: Set 'Unknown' Value as Return Value when the graph is not @@ -501,14 +632,17 @@ static void pto_call (ir_graph *graph, ir_node *call, pto_env_t *pto_env) static void pto_raise (ir_node *raise, pto_env_t *pto_env) { /* perform raise */ - DBGPRINT (2, (stdout, "%s (%s[%li]): pto = %p\n", __FUNCTION__, - OPNAME (raise), OPNUM (raise), (void*) get_node_pto (raise))); + DBGPRINT (2, (stdout, "%s (%s[%li]): pto = 0x%08x\n", + __FUNCTION__, + OPNAME (raise), OPNUM (raise), (int) get_node_pto (raise))); } static void pto_end_block (ir_node *end_block, pto_env_t *pto_env) { /* perform end block */ - type *tp = get_entity_type (get_irg_entity (get_irn_irg (end_block))); + ir_type *tp = get_entity_type (get_irg_entity (get_irn_irg (end_block))); + pto_t *end_pto; + int i, n_ins; if (0 == get_method_n_ress (tp)) { return; @@ -516,25 +650,25 @@ static void pto_end_block (ir_node *end_block, pto_env_t *pto_env) tp = get_method_res_type (tp, 0); - if (mode_P != get_type_mode (tp)) { + if (! mode_is_reference(get_type_mode (tp))) { return; } - DBGPRINT (2, (stdout, "%s (%s[%li]): pto = %p\n", __FUNCTION__, + DBGPRINT (2, (stdout, "%s (%s[%li]): pto = 0x%08x\n", + __FUNCTION__, OPNAME (end_block), OPNUM (end_block), - (void*) get_node_pto (end_block))); + (int) get_node_pto (end_block))); - pto_t *end_pto = get_node_pto (end_block); + end_pto = get_node_pto (end_block); assert (end_pto); - int n_ins = get_irn_arity (end_block); - int i; + n_ins = get_irn_arity (end_block); for (i = 0; i < n_ins; i ++) { ir_node *in = get_irn_n (end_block, i); if (iro_Return == get_irn_opcode (in)) { - pto_t *in_pto = get_pto (in); + pto_t *in_pto = get_pto (in, pto_env); pto_env->change |= qset_insert_all (end_pto->values, in_pto->values); } @@ -545,12 +679,17 @@ static void pto_end_block (ir_node *end_block, pto_env_t *pto_env) Exported Implementation: =================================================== */ /* Main loop: Initialise and iterate over the given graph */ -void pto_graph (ir_graph *graph, int ctx_idx) +void pto_graph (ir_graph *graph, int ctx_idx, pto_env_t *enc_env) { + int run; + pto_env_t *pto_env; + /* Also exported, since we need it in 'pto.c' */ - pto_env_t *pto_env = xmalloc (sizeof (pto_env_t)); + pto_env = xmalloc (sizeof (pto_env_t)); + pto_env->enc_env = enc_env; + pto_env->graph = graph; pto_env->ctx_idx = ctx_idx; - pto_env->change = TRUE; + pto_env->change = TRUE; /* HERE ("start"); */ @@ -559,7 +698,7 @@ void pto_graph (ir_graph *graph, int ctx_idx) ctx_idx)); /* todo (here): iterate, obey 'changed' attribute */ - int run = 0; + run = 0; while (0 != pto_env->change) { run ++; pto_env->change = FALSE; @@ -571,9 +710,7 @@ void pto_graph (ir_graph *graph, int ctx_idx) run, get_type_name (get_entity_owner (get_irg_entity (graph))), get_entity_name (get_irg_entity (graph)))); - - - memset (pto_env, 0x00, sizeof (pto_env_t)); + memset (pto_env, 0, sizeof (pto_env_t)); free (pto_env); /* HERE ("end"); */ } @@ -581,7 +718,7 @@ void pto_graph (ir_graph *graph, int ctx_idx) /* Set the PTO value for the given non-alloc node */ void set_node_pto (ir_node *node, pto_t *pto) { - assert (iro_Alloc != get_irn_opcode (node)); + assert (op_Alloc != get_irn_op(node)); set_irn_link (node, (void*) pto); } @@ -589,7 +726,7 @@ void set_node_pto (ir_node *node, pto_t *pto) /*Get the PTO value for the given non-alloc node */ pto_t *get_node_pto (ir_node *node) { - assert (iro_Alloc != get_irn_opcode (node)); + assert (op_Alloc != get_irn_op(node)); return ((pto_t*) get_irn_link (node)); } @@ -597,7 +734,7 @@ pto_t *get_node_pto (ir_node *node) /* Set the PTO value for the given alloc node */ void set_alloc_pto (ir_node *alloc, alloc_pto_t *alloc_pto) { - assert (iro_Alloc == get_irn_opcode (alloc)); + assert (op_Alloc == get_irn_op(alloc)); assert (alloc_pto); @@ -607,9 +744,9 @@ void set_alloc_pto (ir_node *alloc, alloc_pto_t *alloc_pto) /*Get the current PTO value for the given alloc node */ pto_t *get_alloc_pto (ir_node *alloc) { - alloc_pto_t *alloc_pto = (alloc_pto_t*) get_irn_link (alloc); + alloc_pto_t *alloc_pto = get_irn_link (alloc); - assert (iro_Alloc == get_irn_opcode (alloc)); + assert (op_Alloc == get_irn_op(alloc)); assert (alloc_pto -> curr_pto); @@ -619,6 +756,43 @@ pto_t *get_alloc_pto (ir_node *alloc) /* $Log$ + Revision 1.18 2006/01/13 22:57:41 beck + renamed all types 'type' to 'ir_type' + used mode_is_reference instead of != mode_P test + + Revision 1.17 2005/02/25 16:48:21 liekweg + fix typo + + Revision 1.16 2005/01/27 15:51:19 liekweg + whitespace change + + Revision 1.15 2005/01/14 14:14:26 liekweg + fix gnu extension, fix fprintf's + + Revision 1.14 2005/01/14 13:37:26 liekweg + fix allocation (size); don't cast malloc + + Revision 1.13 2005/01/10 17:26:34 liekweg + fixup printfs, don't put environments on the stack + + Revision 1.12 2004/12/23 15:46:19 beck + removed unneeded allocations + + Revision 1.11 2004/12/21 14:50:59 beck + removed C)) and GNUC constructs, add default returns + + Revision 1.10 2004/12/20 17:34:35 liekweg + fix recursion handling + + Revision 1.9 2004/12/15 13:31:18 liekweg + remove debugging stuff + + Revision 1.8 2004/12/15 09:18:18 liekweg + pto_name.c + + Revision 1.7 2004/12/06 12:55:06 liekweg + actually iterate + Revision 1.6 2004/12/02 16:17:51 beck fixed config.h include