Fixed some typos.
[libfirm] / ir / ir / irgraph.c
index c5b4a9c..f6f381a 100644 (file)
@@ -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,10 @@ 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_no_mem     (res, new_r_NoMem(res));
        start = new_r_Start(res);
        set_irg_start      (res, start);
@@ -227,7 +224,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);
@@ -263,7 +259,6 @@ ir_graph *new_ir_graph(ir_entity *ent, int n_loc)
 ir_graph *new_const_code_irg(void)
 {
        ir_graph *res = alloc_graph();
-       ir_node  *bad;
        ir_node  *body_block;
        ir_node  *end;
        ir_node  *end_block;
@@ -306,8 +301,6 @@ ir_graph *new_const_code_irg(void)
        /* -- The start block -- */
        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);
        no_mem = new_r_NoMem(res);
        set_irg_no_mem(res, no_mem);
        start = new_r_Start(res);
@@ -326,7 +319,6 @@ ir_graph *new_const_code_irg(void)
        set_Block_block_visited(body_block, -1);
        set_Block_block_visited(start_block, -1);
        set_irn_visited(start_block, -1);
-       set_irn_visited(bad, -1);
        set_irn_visited(no_mem, -1);
 
        return res;
@@ -423,7 +415,6 @@ ir_graph *create_irg_copy(ir_graph *irg)
 
        /* -- The start block -- */
        set_irg_start_block(res, get_new_node(get_irg_start_block(irg)));
-       set_irg_bad        (res, get_new_node(get_irg_bad(irg)));
        set_irg_no_mem     (res, get_new_node(get_irg_no_mem(irg)));
        set_irg_start      (res, get_new_node(get_irg_start(irg)));
 
@@ -495,12 +486,12 @@ 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;
 }
 
-ir_node *(get_idx_irn)(ir_graph *irg, unsigned idx)
+ir_node *(get_idx_irn)(const ir_graph *irg, unsigned idx)
 {
        return _get_idx_irn(irg, idx);
 }
@@ -565,16 +556,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);
@@ -595,16 +576,6 @@ void (set_irg_args)(ir_graph *irg, ir_node *node)
        _set_irg_args(irg, node);
 }
 
-ir_node *(get_irg_bad)(const ir_graph *irg)
-{
-       return _get_irg_bad(irg);
-}
-
-void (set_irg_bad)(ir_graph *irg, ir_node *node)
-{
-       _set_irg_bad(irg, node);
-}
-
 ir_node *(get_irg_no_mem)(const ir_graph *irg)
 {
        return _get_irg_no_mem(irg);
@@ -659,7 +630,7 @@ struct obstack *
  *
  * Implementation is GLIBC specific as is uses the internal _obstack_chunk implementation.
  */
-int node_is_in_irgs_storage(ir_graph *irg, ir_node *n)
+int node_is_in_irgs_storage(const ir_graph *irg, const ir_node *n)
 {
        struct _obstack_chunk *p;