From db44b33a0812306bc02d27a63290c96511bfb567 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 27 Jan 2005 12:39:58 +0000 Subject: [PATCH] changed type for uninitialized variable access, added the graph now (is always current_ir_graph but that doesn't matter) [r4974] --- ir/ir/ircons.c | 10 +++++----- ir/ir/ircons.h | 12 +++++++----- ir/ir/ircons_t.h | 12 ++++++------ 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ir/ir/ircons.c b/ir/ir/ircons.c index 1116671bd..bbe3de951 100644 --- a/ir/ir/ircons.c +++ b/ir/ir/ircons.c @@ -58,7 +58,7 @@ typedef struct Phi_in_stack Phi_in_stack; /* * language dependant initialization variable */ -static default_initialize_local_variable_func_t *default_initialize_local_variable = NULL; +static uninitialized_local_variable_func_t *default_initialize_local_variable = NULL; /* -------------------------------------------- */ /* privat interfaces, for professional use only */ @@ -1736,7 +1736,7 @@ phi_merge (ir_node *block, int pos, ir_mode *mode, ir_node **nin, int ins) before recuring. */ if (default_initialize_local_variable) - block->attr.block.graph_arr[pos] = default_initialize_local_variable(mode, pos - 1); + block->attr.block.graph_arr[pos] = default_initialize_local_variable(current_ir_graph, mode, pos - 1); else block->attr.block.graph_arr[pos] = new_Const(mode, tarval_bad); /* We don't need to care about exception ops in the start block. @@ -2329,7 +2329,7 @@ new_d_Sync (dbg_info* db, int arity, ir_node** in) ir_node * (new_d_Bad)(void) { - return __new_d_Bad(); + return _new_d_Bad(); } ir_node * @@ -2385,7 +2385,7 @@ new_d_Filter (dbg_info *db, ir_node *arg, ir_mode *mode, long proj) ir_node * (new_d_NoMem)(void) { - return __new_d_NoMem(); + return _new_d_NoMem(); } ir_node * @@ -2526,7 +2526,7 @@ type *get_cur_frame_type() { /* call once for each run of the library */ void -init_cons (default_initialize_local_variable_func_t *func) +init_cons(uninitialized_local_variable_func_t *func) { default_initialize_local_variable = func; } diff --git a/ir/ir/ircons.h b/ir/ir/ircons.h index e4eda0d02..6878a8cee 100644 --- a/ir/ir/ircons.h +++ b/ir/ir/ircons.h @@ -3786,16 +3786,18 @@ void finalize_cons (ir_graph *irg); /** * This function is called, whenever a local variable is used before definition * - * @parameter mode the mode of the local var - * @pos position chosen be the frontend for this var + * @param irg the IR graph on which this happens + * @param mode the mode of the local var + * @param pos position chosen be the frontend for this variable (n_loc) * * @return a firm node of mode @p mode that initializes the var at position pos * * @note * Do not return NULL - * If this function is not set, FIRM will create a const node with tarval BAD + * If this function is not set, FIRM will create a const node with tarval BAD. + * Use set_irg_loc_description()/get_irg_loc_description() to assign additional + * informations to local variables. */ -typedef ir_node *default_initialize_local_variable_func_t(ir_mode *mode, int pos); - +typedef ir_node *uninitialized_local_variable_func_t(ir_graph *irg, ir_mode *mode, int pos); # endif /* _IRCONS_H_ */ diff --git a/ir/ir/ircons_t.h b/ir/ir/ircons_t.h index bfd602166..22c6ea368 100644 --- a/ir/ir/ircons_t.h +++ b/ir/ir/ircons_t.h @@ -19,24 +19,24 @@ /** * Initializes the graph construction. * - * @param func @see default_initialize_local_variable_func_t + * @param func @see uninitialized_local_variable_func_t */ -void init_cons (default_initialize_local_variable_func_t *func); +void init_cons(uninitialized_local_variable_func_t *func); /* inline functions */ static INLINE ir_node * -__new_d_Bad(void) { +_new_d_Bad(void) { return current_ir_graph->bad; } static INLINE ir_node * -__new_d_NoMem(void) { +_new_d_NoMem(void) { return current_ir_graph->no_mem; } -#define new_d_Bad() __new_d_Bad() -#define new_d_NoMem() __new_d_NoMem() +#define new_d_Bad() _new_d_Bad() +#define new_d_NoMem() _new_d_NoMem() #endif /* _IRCONS_T_H_ */ -- 2.20.1