don't access members of the irg directly
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 6 Apr 2006 12:04:46 +0000 (12:04 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 6 Apr 2006 12:04:46 +0000 (12:04 +0000)
[r7582]

ir/ir/iropt.c
ir/opt/tailrec.c

index 1d0d54a..3bfa9b3 100644 (file)
@@ -773,8 +773,8 @@ static ir_node *equivalent_node_Block(ir_node *n)
     }
   }
   else if (get_opt_unreachable_code() &&
-           (n != current_ir_graph->start_block) &&
-           (n != current_ir_graph->end_block)     ) {
+           (n != get_irg_start_block(current_ir_graph)) &&
+           (n != get_irg_end_block(current_ir_graph))    ) {
     int i;
 
     /* If all inputs are dead, this block is dead too, except if it is
@@ -1202,8 +1202,8 @@ static ir_node *equivalent_node_Phi(ir_node *n)
   /* @@@ fliegt 'raus, sollte aber doch immer wahr sein!!!
      assert(get_irn_arity(block) == n_preds && "phi in wrong block!"); */
   if ((is_Block_dead(block)) ||                  /* Control dead */
-      (block == current_ir_graph->start_block))  /* There should be no Phi nodes */
-    return new_Bad();                            /* in the Start Block. */
+      (block == get_irg_start_block(current_ir_graph)))  /* There should be no Phi nodes */
+    return new_Bad();                                    /* in the Start Block. */
 
   if (n_preds == 0) return n;           /* Phi of dead Region without predecessors. */
 
index 89e94ec..4ae0c52 100644 (file)
@@ -98,7 +98,7 @@ static void collect_data(ir_node *node, void *env)
     /*
      * the first block has the initial exec as cfg predecessor
      */
-    if (node != current_ir_graph->start_block) {
+    if (node != get_irg_start_block(current_ir_graph)) {
       for (i = 0; i < n_pred; ++i) {
         if (get_Block_cfgpred(node, i) == data->proj_X) {
                data->block   = node;
@@ -213,9 +213,10 @@ static void do_opt_tail_rec(ir_graph *irg, ir_node *rets, int n_tail_calls)
 
   phis[0] = new_r_Phi(irg, block, n_tail_calls + 1, in, mode_M);
 
-  /* build the data phi's */
+  /* build the data Phi's */
   if (n_params > 0) {
     ir_node *calls;
+    ir_node *args;
 
     NEW_ARR_A(ir_node **, call_params, n_tail_calls);
 
@@ -225,11 +226,12 @@ static void do_opt_tail_rec(ir_graph *irg, ir_node *rets, int n_tail_calls)
       ++i;
     }
 
-    /* build new projs and Phi's */
+    /* build new Proj's and Phi's */
+    args = get_irg_args(irg);
     for (i = 0; i < n_params; ++i) {
       ir_mode *mode = get_type_mode(get_method_param_type(method_tp, i));
 
-      in[0] = new_r_Proj(irg, block, irg->args, mode, i);
+      in[0] = new_r_Proj(irg, block, args, mode, i);
       for (j = 0; j < n_tail_calls; ++j)
         in[j + 1] = call_params[j][i];