Remove pointless local variables.
[libfirm] / ir / ir / irgraph.c
index d9b9774..c6d7c41 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -142,7 +142,7 @@ void irg_set_nloc(ir_graph *res, int n_loc)
 }
 
 /* Allocates a list of nodes:
-    - The start block containing a start node and Proj nodes for it's four
+    - The start block containing a start node and Proj nodes for its four
       results (X, M, P, Tuple).
     - The end block containing an end node. This block is not matured after
       new_ir_graph as predecessors need to be added to it.
@@ -154,7 +154,7 @@ ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc)
 {
        ir_graph *res;
        ir_node  *first_block;
-       ir_node  *end, *start, *start_block, *initial_mem, *projX, *bad;
+       ir_node  *start, *start_block, *initial_mem, *projX;
 
        res = alloc_graph();
 
@@ -212,13 +212,11 @@ ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc)
 
        /*-- Nodes needed in every graph --*/
        set_irg_end_block (res, new_r_immBlock(res));
-       end = new_r_End(res, 0, NULL);
-       set_irg_end(res, end);
+       set_irg_end(res, new_r_End(res, 0, NULL));
 
        start_block = new_r_Block_noopt(res, 0, NULL);
        set_irg_start_block(res, start_block);
-       bad = new_r_Bad(res);
-       set_irg_bad        (res, bad);
+       set_irg_bad        (res, new_r_Bad(res));
        set_irg_no_mem     (res, new_r_NoMem(res));
        start = new_r_Start(res);
        set_irg_start      (res, start);
@@ -227,7 +225,6 @@ ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc)
        projX                   = new_r_Proj(start, mode_X, pn_Start_X_initial_exec);
        set_irg_initial_exec    (res, projX);
        set_irg_frame           (res, new_r_Proj(start, mode_P_data, pn_Start_P_frame_base));
-       set_irg_tls             (res, new_r_Proj(start, mode_P_data, pn_Start_P_tls));
        set_irg_args            (res, new_r_Proj(start, mode_T,      pn_Start_T_args));
        initial_mem             = new_r_Proj(start, mode_M, pn_Start_M);
        set_irg_initial_mem(res, initial_mem);
@@ -495,7 +492,7 @@ long get_irg_graph_nr(const ir_graph *irg)
 }
 #endif
 
-int get_irg_idx(const ir_graph *irg)
+size_t get_irg_idx(const ir_graph *irg)
 {
        return irg->index;
 }
@@ -565,16 +562,6 @@ void (set_irg_frame)(ir_graph *irg, ir_node *node)
        _set_irg_frame(irg, node);
 }
 
-ir_node *(get_irg_tls)(const ir_graph *irg)
-{
-       return _get_irg_tls(irg);
-}
-
-void (set_irg_tls)(ir_graph *irg, ir_node *node)
-{
-       _set_irg_tls(irg, node);
-}
-
 ir_node *(get_irg_initial_mem)(const ir_graph *irg)
 {
        return _get_irg_initial_mem(irg);
@@ -742,8 +729,8 @@ void (set_irg_loopinfo_inconsistent)(ir_graph *irg)
 
 void set_irp_loopinfo_inconsistent(void)
 {
-       int i;
-       for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
+       size_t i, n;
+       for (i = 0, n = get_irp_n_irgs(); i < n; ++i) {
                set_irg_loopinfo_inconsistent(get_irp_irg(i));
        }
 }