changed type for uninitialized variable access, added the graph now
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 27 Jan 2005 12:39:58 +0000 (12:39 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 27 Jan 2005 12:39:58 +0000 (12:39 +0000)
(is always current_ir_graph but that doesn't matter)

[r4974]

ir/ir/ircons.c
ir/ir/ircons.h
ir/ir/ircons_t.h

index 1116671..bbe3de9 100644 (file)
@@ -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;
 }
index e4eda0d..6878a8c 100644 (file)
@@ -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_ */
index bfd6021..22c6ea3 100644 (file)
 /**
  * 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_ */