use the new Anchor node instead of old anchors
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 11 Jul 2007 15:58:21 +0000 (15:58 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 11 Jul 2007 15:58:21 +0000 (15:58 +0000)
[r15053]

20 files changed:
ir/be/arm/arm_transform.c
ir/be/beabi.c
ir/be/beschedtrace.c
ir/be/betranshlp.c
ir/be/betranshlp.h
ir/be/ia32/ia32_transform.c
ir/be/mips/mips_transform.c
ir/ir/ircons.c
ir/ir/ircons_t.h
ir/ir/irdump.c
ir/ir/iredges.c
ir/ir/irgopt.c
ir/ir/irgopt_t.h
ir/ir/irgraph.c
ir/ir/irgraph_t.h
ir/ir/irgwalk.c
ir/ir/irnode_t.h
ir/ir/irtypes.h
ir/ir/irvrfy.c
ir/opt/tailrec.c

index 302e608..38780bb 100644 (file)
@@ -1515,7 +1515,7 @@ static ir_node *gen_Proj(ir_node *node) {
                        ir_fprintf(stderr, "created jump: %+F\n", jump);
                        return jump;
                }
-               if (node == be_get_old_anchor(anchor_tls)) {
+               if (node == get_irg_anchor(irg, anchor_tls)) {
                        return gen_Proj_tls(node);
                }
        } else {
index 8ddc912..068191b 100644 (file)
@@ -1815,9 +1815,11 @@ static void modify_irg(be_abi_irg_t *env)
        arg_tuple = get_irg_args(irg);
        foreach_out_edge(arg_tuple, edge) {
                ir_node *irn = get_edge_src_irn(edge);
-               int nr       = get_Proj_proj(irn);
-               args[nr]     = irn;
-               DBG((dbg, LEVEL_2, "\treading arg: %d -> %+F\n", nr, irn));
+               if (! is_Anchor(irn)) {
+                       int nr       = get_Proj_proj(irn);
+                       args[nr]     = irn;
+                       DBG((dbg, LEVEL_2, "\treading arg: %d -> %+F\n", nr, irn));
+               }
        }
 
        arg_type = compute_arg_type(env, call, method_type, &param_map);
@@ -1975,8 +1977,8 @@ static void modify_irg(be_abi_irg_t *env)
                }
        }
 
-       /* the arg proj is not needed anymore now */
-       assert(get_irn_n_edges(arg_tuple) == 0);
+       /* the arg proj is not needed anymore now and should be only used by the anchor */
+       assert(get_irn_n_edges(arg_tuple) == 1);
        be_kill_node(arg_tuple);
        set_irg_args(irg, new_rd_Bad(irg));
 
index a6118aa..35af5a2 100644 (file)
@@ -391,6 +391,8 @@ static void trace_preprocess_block(trace_env_t *env, ir_node *block) {
        foreach_out_edge(block, edge) {
                ir_node *succ = get_edge_src_irn(edge);
 
+               if (is_Anchor(succ))
+                       continue;
                if (is_root(succ, block)) {
                        mark_root_node(env, succ);
                        set_irn_link(succ, root);
index 93f7758..54777d0 100644 (file)
@@ -33,7 +33,7 @@
 #include "iropt_t.h"
 #include "irnode_t.h"
 #include "irgraph_t.h"
-#include "ircons.h"
+#include "ircons_t.h"
 #include "irhooks.h"
 #include "iredges.h"
 #include "irouts.h"
@@ -50,7 +50,7 @@ typedef struct be_transform_env_t {
                                    node is already transformed */
        waitq    *worklist;    /**< worklist of nodes that still need to be
                                    transformed */
-       ir_node  **old_anchors;/**< the list of anchors nodes in the old irg */
+       ir_node  *old_anchor;  /**< the old anchor node in the old irg */
 } be_transform_env_t;
 
 
@@ -65,10 +65,6 @@ static INLINE ir_node *be_get_transformed_node(ir_node *old_node) {
        return (ir_node*) get_irn_link(old_node);
 }
 
-ir_node *be_get_old_anchor(unsigned anchor) {
-       return env.old_anchors[anchor];
-}
-
 void be_duplicate_deps(ir_node *old_node, ir_node *new_node) {
        int i;
        int deps = get_irn_deps(old_node);
@@ -228,7 +224,7 @@ ir_node *be_pre_transform_node(ir_node *place) {
  */
 static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform, void *cg) {
        int      i;
-       ir_node  *old_end;
+       ir_node  *old_end, *new_anchor;
 
        hook_dead_node_elim(irg, 1);
 
@@ -237,31 +233,28 @@ static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform, v
        env.irg         = irg;
        env.visited     = get_irg_visited(irg);
        env.worklist    = new_waitq();
-       env.old_anchors = alloca(anchor_max * sizeof(env.old_anchors[0]));
+       env.old_anchor  = irg->anchor;
 
        old_end = get_irg_end(irg);
 
        /* put all anchor nodes in the worklist */
-       for (i = 0; i < anchor_max; ++i) {
-               ir_node *anchor = irg->anchors[i];
+       for (i = get_irg_n_anchors(irg) - 1; i >= 0; --i) {
+               ir_node *anchor = get_irg_anchor(irg, i);
 
                if (anchor == NULL)
                        continue;
                waitq_put(env.worklist, anchor);
-
-               /* remember anchor */
-               env.old_anchors[i] = anchor;
-               /* and set it to NULL to make sure we don't accidently use it */
-               irg->anchors[i] = NULL;
        }
 
+       new_anchor = new_Anchor(irg);
+
        /* pre transform some anchors (so they are available in the other transform
         * functions) */
-       set_irg_bad(irg, be_transform_node(env.old_anchors[anchor_bad]));
-       set_irg_no_mem(irg, be_transform_node(env.old_anchors[anchor_no_mem]));
-       set_irg_start_block(irg, be_transform_node(env.old_anchors[anchor_start_block]));
-       set_irg_start(irg, be_transform_node(env.old_anchors[anchor_start]));
-       set_irg_frame(irg, be_transform_node(env.old_anchors[anchor_frame]));
+       set_irn_n(new_anchor, anchor_bad,         be_transform_node(get_irg_anchor(irg, anchor_bad)));
+       set_irn_n(new_anchor, anchor_no_mem,      be_transform_node(get_irg_anchor(irg, anchor_no_mem)));
+       set_irn_n(new_anchor, anchor_start_block, be_transform_node(get_irg_anchor(irg, anchor_start_block)));
+       set_irn_n(new_anchor, anchor_start,       be_transform_node(get_irg_anchor(irg, anchor_start)));
+       set_irn_n(new_anchor, anchor_frame,       be_transform_node(get_irg_anchor(irg, anchor_frame)));
 
        if (pre_transform)
                (*pre_transform)(cg);
@@ -274,17 +267,18 @@ static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform, v
 
        /* fix loops and set new anchors*/
        inc_irg_visited(irg);
-       for (i = 0; i < anchor_max; ++i) {
-               ir_node *anchor = env.old_anchors[i];
+       for (i = get_irg_n_anchors(irg) - 1; i >= 0; --i) {
+               ir_node *anchor = get_irg_anchor(irg, i);
 
                if (anchor == NULL)
                        continue;
 
                anchor = get_irn_link(anchor);
                fix_loops(anchor);
-               assert(irg->anchors[i] == NULL || irg->anchors[i] == anchor);
-               irg->anchors[i] = anchor;
+               set_irn_n(new_anchor, i, anchor);
        }
+       irg->anchor = new_anchor;
+       set_irn_n(new_anchor, -1, get_irn_intra_n(new_anchor, anchor_end_block));
 
        del_waitq(env.worklist);
        free_End(old_end);
@@ -297,7 +291,7 @@ static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform, v
 static ir_node *gen_Block(ir_node *node) {
        ir_graph *irg         = current_ir_graph;
        dbg_info *dbgi        = get_irn_dbg_info(node);
-       ir_node  *start_block = be_get_old_anchor(anchor_start_block);
+       ir_node  *start_block = get_irg_anchor(irg, anchor_start_block);
        ir_node  *block;
 
        /*
index 0473d03..0edf64d 100644 (file)
@@ -40,11 +40,6 @@ typedef void (arch_pretrans_nodes)(void *arch_cg);
  */
 typedef ir_node *(be_transform_func)(ir_node *node);
 
-/**
- * Returns an old (saved) anchor of the currently transforming graph.
- */
-ir_node *be_get_old_anchor(unsigned anchor);
-
 /** pre-transform a node */
 ir_node *be_pre_transform_node(ir_node *place);
 
index 88cc1d9..d2d7fcf 100644 (file)
@@ -3927,7 +3927,7 @@ static ir_node *gen_Proj(ir_node *node) {
                        jump  = new_rd_Jmp(dbgi, irg, block);
                        return jump;
                }
-               if (node == be_get_old_anchor(anchor_tls)) {
+               if (node == get_irg_anchor(irg, anchor_tls)) {
                        return gen_Proj_tls(node);
                }
        } else {
index 947c775..625ede6 100644 (file)
@@ -519,7 +519,7 @@ static ir_node *gen_Proj_Start(ir_node *node)
                ir_node *jump = new_rd_Jmp(dbgi, irg, block);
                return jump;
        }
-       if(node == be_get_old_anchor(anchor_tls)) {
+       if(node == get_irg_anchor(irg, anchor_tls)) {
                /* TODO... */
                return be_duplicate_node(node);
        }
index 23db2bf..1faf252 100644 (file)
@@ -3357,3 +3357,10 @@ ir_node *new_ASM(int arity, ir_node *in[], ir_asm_constraint *inputs,
                  int n_clobber, ident *clobber[], ident *asm_text) {
        return new_d_ASM(NULL, arity, in, inputs, n_outs, outputs, n_clobber, clobber, asm_text);
 }
+
+/* create a new anchor node */
+ir_node *new_Anchor(ir_graph *irg) {
+       ir_node *in[anchor_last];
+       memset(in, 0, sizeof(in));
+       return new_ir_node(NULL, irg, NULL, op_Anchor, mode_ANY, anchor_last, in);
+}
index 80353cb..1d18668 100644 (file)
  */
 void init_cons(uninitialized_local_variable_func_t *func);
 
+/**
+ * Creates a new Anchor node.
+ */
+ir_node *new_Anchor(ir_graph *irg);
+
 /* inline functions */
 
 static INLINE ir_node *
 _new_d_Bad(void) {
-  return current_ir_graph->anchors[anchor_bad];
+       return get_irg_bad(current_ir_graph);
 }
 
 static INLINE ir_node *
 _new_d_NoMem(void) {
-  return current_ir_graph->anchors[anchor_no_mem];
+       return get_irg_no_mem(current_ir_graph);
 }
 
 
index 0b6b800..118961a 100644 (file)
@@ -536,13 +536,14 @@ static int node_floats(ir_node *n) {
  *  Walker that visits the anchors
  */
 static void ird_walk_graph(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env) {
-       irg_walk_graph(irg, pre, post, env);
-
        if (dump_anchors) {
                int i;
 
-               for (i = anchor_max - 1; i >= 0; --i) {
-                       ir_node *n = irg->anchors[i];
+               if (pre)
+                       pre(irg->anchor, env);
+
+               for (i = get_irg_n_anchors(irg) - 1; i >= 0; --i) {
+                       ir_node *n = get_irg_anchor(irg, i);
 
                        if (n) {
                                /* reset the visit flag: will be increase in the walker */
@@ -550,6 +551,10 @@ static void ird_walk_graph(ir_graph *irg, irg_walk_func *pre, irg_walk_func *pos
                                irg_walk(n, pre, post, env);
                        }
                }
+               if (post)
+                       post(irg->anchor, env);
+       } else {
+               irg_walk_graph(irg, pre, post, env);
        }
 }
 
index 0195480..84a442e 100644 (file)
@@ -498,8 +498,6 @@ void edges_activate_kind(ir_graph *irg, ir_edge_kind_t kind)
 
        info->activated = 1;
        edges_init_graph_kind(irg, kind);
-       //irg_walk_graph(irg, init_lh_walker, build_edges_walker, &w);
-       inc_irg_visited(irg);
        irg_walk_anchors(irg, init_lh_walker, build_edges_walker, &w);
        visit_all_identities(irg, visitor, &w);
 }
@@ -758,9 +756,7 @@ int edges_verify(ir_graph *irg) {
        w.problem_found = 0;
 
        /* verify counter */
-       inc_irg_visited(irg);
        irg_walk_anchors(irg, clear_links, count_user, &w);
-       inc_irg_visited(irg);
        irg_walk_anchors(irg, NULL, verify_edge_counter, &w);
 
        return problem_found ? 1 : w.problem_found;
index 8e306ec..971e0c1 100644 (file)
@@ -35,7 +35,7 @@
 #include "irprog_t.h"
 
 #include "iroptimize.h"
-#include "ircons.h"
+#include "ircons_t.h"
 #include "iropt_t.h"
 #include "irgopt.h"
 #include "irgmod.h"
@@ -363,8 +363,7 @@ static void copy_node(ir_node *n, void *env) {
  * Copies new predecessors of old node to new node remembered in link.
  * Spare the Bad predecessors of Phi and Block nodes.
  */
-void
-copy_preds(ir_node *n, void *env) {
+static void copy_preds(ir_node *n, void *env) {
        ir_node *nn, *block;
        int i, j, irn_arity;
        (void) env;
@@ -497,8 +496,8 @@ static void copy_graph(ir_graph *irg, int copy_node_nr) {
        /* Note: from yet, the visited flag of the graph is equal to vfl + 1 */
 
        /* visit the anchors as well */
-       for (i = anchor_max - 1; i >= 0; --i) {
-               ir_node *n = irg->anchors[i];
+       for (i = get_irg_n_anchors(irg) - 1; i >= 0; --i) {
+               ir_node *n = get_irg_anchor(irg, i);
 
                if (n && (get_irn_visited(n) <= vfl)) {
                        set_irg_visited(irg, vfl);
@@ -555,7 +554,7 @@ static void copy_graph(ir_graph *irg, int copy_node_nr) {
 static void
 copy_graph_env(int copy_node_nr) {
        ir_graph *irg = current_ir_graph;
-       ir_node *old_end, *n;
+       ir_node *old_end, *new_anchor;
        int i;
 
        /* remove end_except and end_reg nodes */
@@ -566,9 +565,10 @@ copy_graph_env(int copy_node_nr) {
        /* Not all nodes remembered in irg might be reachable
           from the end node.  Assure their link is set to NULL, so that
           we can test whether new nodes have been computed. */
-       for (i = anchor_max - 1; i >= 0; --i) {
-               if (irg->anchors[i])
-                       set_new_node(irg->anchors[i], NULL);
+       for (i = get_irg_n_anchors(irg) - 1; i >= 0; --i) {
+               ir_node *n = get_irg_anchor(irg, i);
+               if (n != NULL)
+                       set_new_node(n, NULL);
        }
        /* we use the block walk flag for removing Bads from Blocks ins. */
        inc_irg_block_visited(irg);
@@ -576,14 +576,20 @@ copy_graph_env(int copy_node_nr) {
        /* copy the graph */
        copy_graph(irg, copy_node_nr);
 
-       /* fix the fields in irg */
-       old_end = get_irg_end(irg);
-       for (i = anchor_max - 1; i >= 0; --i) {
-               n = irg->anchors[i];
+       /* fix the anchor */
+       old_end    = get_irg_end(irg);
+       new_anchor = new_Anchor(irg);
+
+       for (i = get_irg_n_anchors(irg) - 1; i >= 0; --i) {
+               ir_node *n = get_irg_anchor(irg, i);
                if (n)
-                       irg->anchors[i] = get_new_node(n);
+                       set_irn_n(new_anchor, i, get_new_node(n));
        }
        free_End(old_end);
+       irg->anchor = new_anchor;
+
+       /* ensure the new anchor is placed in the endblock */
+       set_irn_n(new_anchor, -1, get_irg_end_block(irg));
 }
 
 /**
index 073acea..1e49805 100644 (file)
@@ -25,8 +25,6 @@
 #ifndef FIRM_IR_IRGOPT_T_H
 #define FIRM_IR_IRGOPT_T_H
 
-//void copy_node (ir_node *n, void *env);
-void copy_preds(ir_node *n, void *env);
 void firm_copy_node (ir_node *n, void *env);
 
 #endif
index ef4526b..0686a1c 100644 (file)
@@ -35,7 +35,7 @@
 #endif
 
 #include "xmalloc.h"
-#include "ircons.h"
+#include "ircons_t.h"
 #include "irgraph_t.h"
 #include "irprog_t.h"
 #include "irnode_t.h"
@@ -67,31 +67,32 @@ static size_t additional_graph_data_size = 0;
 
 ir_graph *current_ir_graph;
 ir_graph *get_current_ir_graph(void) {
-  return current_ir_graph;
+       return current_ir_graph;
 }
+
 void set_current_ir_graph(ir_graph *graph) {
-  current_ir_graph = graph;
+       current_ir_graph = graph;
 }
 
 
 int firm_interprocedural_view = 0;
 
 int (get_interprocedural_view)(void) {
-  return _get_interprocedural_view();
+       return _get_interprocedural_view();
 }
 
 void (set_interprocedural_view)(int state) {
-  firm_interprocedural_view = state;
+       firm_interprocedural_view = state;
 
-  /* set function vectors for faster access */
-  if (state) {
-    _get_irn_arity = _get_irn_inter_arity;
-    _get_irn_n     = _get_irn_inter_n;
-  }
-  else {
-    _get_irn_arity = _get_irn_intra_arity;
-    _get_irn_n     = _get_irn_intra_n;
-  }
+       /* set function vectors for faster access */
+       if (state) {
+               _get_irn_arity = _get_irn_inter_arity;
+               _get_irn_n     = _get_irn_inter_n;
+       }
+       else {
+               _get_irn_arity = _get_irn_intra_arity;
+               _get_irn_n     = _get_irn_intra_n;
+       }
 }
 
 /** contains the suffix for frame type names */
@@ -99,8 +100,8 @@ static ident *frame_type_suffix = NULL;
 
 /* initialize the IR graph module */
 void firm_init_irgraph(void) {
-  frame_type_suffix = new_id_from_str(FRAME_TP_SUFFIX);
-  forbid_new_data   = 1;
+       frame_type_suffix = new_id_from_str(FRAME_TP_SUFFIX);
+       forbid_new_data   = 1;
 }
 
 /**
@@ -111,19 +112,19 @@ void firm_init_irgraph(void) {
  * @return Memory for a new graph.
  */
 static ir_graph *alloc_graph(void) {
-  size_t size = sizeof(ir_graph) + additional_graph_data_size;
-  char *ptr = xmalloc(size);
-  memset(ptr, 0, size);
+       size_t size = sizeof(ir_graph) + additional_graph_data_size;
+       char *ptr = xmalloc(size);
+       memset(ptr, 0, size);
 
-  return (ir_graph *) (ptr + additional_graph_data_size);
+       return (ir_graph *) (ptr + additional_graph_data_size);
 }
 
 /**
  * Frees an allocated IR graph
  */
 static void free_graph(ir_graph *irg) {
-  char *ptr = (char *)irg;
-  free(ptr - additional_graph_data_size);
+       char *ptr = (char *)irg;
+       free(ptr - additional_graph_data_size);
 }
 
 #if USE_EXPLICIT_PHI_IN_STACK
@@ -142,225 +143,226 @@ void free_Phi_in_stack(Phi_in_stack *s);
    Further it allocates several datastructures needed for graph construction
    and optimization.
 */
-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;
-
-  res = alloc_graph();
-  res->kind = k_ir_graph;
-
-  //edges_init_graph_kind(res, EDGE_KIND_NORMAL);
-  //edges_init_graph_kind(res, EDGE_KIND_BLOCK);
-
-  /* initialize the idx->node map. */
-  res->idx_irn_map = NEW_ARR_F(ir_node *, INITIAL_IDX_IRN_MAP_SIZE);
-  memset(res->idx_irn_map, 0, INITIAL_IDX_IRN_MAP_SIZE * sizeof(res->idx_irn_map[0]));
-
-  /* inform statistics here, as blocks will be already build on this graph */
-  hook_new_graph(res, ent);
-
-  current_ir_graph = res;
-
-  /*-- initialized for each graph. --*/
-  if (get_opt_precise_exc_context()) {
-    res->n_loc = n_loc + 1 + 1; /* number of local variables that are never
-                   dereferenced in this graph plus one for
-                   the store plus one for links to fragile
-                   operations.  n_loc is not the number of
-                   parameters to the procedure!  */
-  }
-  else {
-    res->n_loc = n_loc + 1;  /* number of local variables that are never
-                dereferenced in this graph plus one for
-                the store. This is not the number of parameters
-                to the procedure!  */
-  }
-
-  /* descriptions will be allocated on demand */
-  res->loc_descriptions = NULL;
-
-  res->visited       = 0; /* visited flag, for the ir walker */
-  res->block_visited = 0; /* visited flag, for the 'block'-walker */
+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;
+
+       res = alloc_graph();
+       res->kind = k_ir_graph;
+
+       //edges_init_graph_kind(res, EDGE_KIND_NORMAL);
+       //edges_init_graph_kind(res, EDGE_KIND_BLOCK);
+
+       /* initialize the idx->node map. */
+       res->idx_irn_map = NEW_ARR_F(ir_node *, INITIAL_IDX_IRN_MAP_SIZE);
+       memset(res->idx_irn_map, 0, INITIAL_IDX_IRN_MAP_SIZE * sizeof(res->idx_irn_map[0]));
+
+       /* inform statistics here, as blocks will be already build on this graph */
+       hook_new_graph(res, ent);
+
+       current_ir_graph = res;
+
+       /*-- initialized for each graph. --*/
+       if (get_opt_precise_exc_context()) {
+               res->n_loc = n_loc + 1 + 1; /* number of local variables that are never
+                              dereferenced in this graph plus one for
+                              the store plus one for links to fragile
+                              operations.  n_loc is not the number of
+                              parameters to the procedure!  */
+       } else {
+               res->n_loc = n_loc + 1;  /* number of local variables that are never
+                           dereferenced in this graph plus one for
+                           the store. This is not the number of parameters
+                           to the procedure!  */
+       }
+
+       /* descriptions will be allocated on demand */
+       res->loc_descriptions = NULL;
+
+       res->visited       = 0; /* visited flag, for the ir walker */
+       res->block_visited = 0; /* visited flag, for the 'block'-walker */
 
 #if USE_EXPLICIT_PHI_IN_STACK
-  res->Phi_in_stack = new_Phi_in_stack();  /* A stack needed for automatic Phi
-                                generation */
+       res->Phi_in_stack = new_Phi_in_stack();  /* A stack needed for automatic Phi
+                                                   generation */
 #endif
-  res->kind = k_ir_graph;
-  res->obst = xmalloc (sizeof(*res->obst));
-  obstack_init(res->obst);
-  res->extbb_obst = NULL;
-
-  res->last_node_idx = 0;
-
-  res->value_table = new_identities (); /* value table for global value
-                       numbering for optimizing use in
-                       iropt.c */
-  res->outs = NULL;
-
-  res->inline_property       = irg_inline_any;
-  res->additional_properties = mtp_property_inherited;  /* inherited from type */
-
-  res->phase_state         = phase_building;
-  res->irg_pinned_state    = op_pin_state_pinned;
-  res->outs_state          = outs_none;
-  res->dom_state           = dom_none;
-  res->pdom_state          = dom_none;
-  res->typeinfo_state      = ir_typeinfo_none;
-  set_irp_typeinfo_inconsistent();           /* there is a new graph with typeinfo_none. */
-  res->callee_info_state   = irg_callee_info_none;
-  res->loopinfo_state      = loopinfo_none;
-  res->class_cast_state    = ir_class_casts_transitive;
-  res->extblk_state        = ir_extblk_info_none;
-  res->execfreq_state      = exec_freq_none;
-  res->fp_model            = fp_model_precise;
-  res->adr_taken_state     = ir_address_taken_not_computed;
-  res->mem_disambig_opt    = aa_opt_inherited;
-
-  /*-- Type information for the procedure of the graph --*/
-  res->ent = ent;
-  set_entity_irg(ent, res);
-
-  /*--  a class type so that it can contain "inner" methods as in Pascal. --*/
-  res->frame_type = new_type_frame(mangle(get_entity_ident(ent), frame_type_suffix));
-
-  /*-- Nodes needed in every graph --*/
-  set_irg_end_block (res, new_immBlock());
-  end               = new_End();
-  set_irg_end       (res, end);
-  set_irg_end_reg   (res, end);
-  set_irg_end_except(res, end);
-
-  start_block = new_immBlock();
-  set_irg_start_block(res, start_block);
-  set_irg_bad        (res, new_ir_node(NULL, res, start_block, op_Bad, mode_T, 0, NULL));
-  set_irg_no_mem     (res, new_ir_node(NULL, res, start_block, op_NoMem, mode_M, 0, NULL));
-  start = new_Start();
-  set_irg_start      (res, start);
-
-  /* Proj results of start node */
-  projX                   = new_Proj(start, mode_X, pn_Start_X_initial_exec);
-  set_irg_frame           (res, new_Proj(start, mode_P_data, pn_Start_P_frame_base));
-  set_irg_globals         (res, new_Proj(start, mode_P_data, pn_Start_P_globals));
-  set_irg_tls             (res, new_Proj(start, mode_P_data, pn_Start_P_tls));
-  set_irg_args            (res, new_Proj(start, mode_T,      pn_Start_T_args));
-  set_irg_value_param_base(res, new_Proj(start, mode_P_data, pn_Start_P_value_arg_base));
-  initial_mem             = new_Proj(start, mode_M, pn_Start_M);
-  set_irg_initial_mem(res, initial_mem);
-
-  add_immBlock_pred(start_block, projX);
-  set_store(initial_mem);
+       res->kind = k_ir_graph;
+       res->obst = xmalloc (sizeof(*res->obst));
+       obstack_init(res->obst);
+       res->extbb_obst = NULL;
+
+       res->last_node_idx = 0;
+
+       res->value_table = new_identities (); /* value table for global value
+                                                numbering for optimizing use in iropt.c */
+       res->outs = NULL;
+
+       res->inline_property       = irg_inline_any;
+       res->additional_properties = mtp_property_inherited;  /* inherited from type */
+
+       res->phase_state         = phase_building;
+       res->irg_pinned_state    = op_pin_state_pinned;
+       res->outs_state          = outs_none;
+       res->dom_state           = dom_none;
+       res->pdom_state          = dom_none;
+       res->typeinfo_state      = ir_typeinfo_none;
+       set_irp_typeinfo_inconsistent();           /* there is a new graph with typeinfo_none. */
+       res->callee_info_state   = irg_callee_info_none;
+       res->loopinfo_state      = loopinfo_none;
+       res->class_cast_state    = ir_class_casts_transitive;
+       res->extblk_state        = ir_extblk_info_none;
+       res->execfreq_state      = exec_freq_none;
+       res->fp_model            = fp_model_precise;
+       res->adr_taken_state     = ir_address_taken_not_computed;
+       res->mem_disambig_opt    = aa_opt_inherited;
+
+       /*-- Type information for the procedure of the graph --*/
+       res->ent = ent;
+       set_entity_irg(ent, res);
+
+       /*--  a class type so that it can contain "inner" methods as in Pascal. --*/
+       res->frame_type = new_type_frame(mangle(get_entity_ident(ent), frame_type_suffix));
+
+       /* the Anchor node must be created first */
+       res->anchor = new_Anchor(res);
+
+       /*-- Nodes needed in every graph --*/
+       set_irg_end_block (res, new_immBlock());
+       end               = new_End();
+       set_irg_end       (res, end);
+       set_irg_end_reg   (res, end);
+       set_irg_end_except(res, end);
+
+       start_block = new_immBlock();
+       set_irg_start_block(res, start_block);
+       set_irg_bad        (res, new_ir_node(NULL, res, start_block, op_Bad, mode_T, 0, NULL));
+       set_irg_no_mem     (res, new_ir_node(NULL, res, start_block, op_NoMem, mode_M, 0, NULL));
+       start = new_Start();
+       set_irg_start      (res, start);
+
+       /* Proj results of start node */
+       projX                   = new_Proj(start, mode_X, pn_Start_X_initial_exec);
+       set_irg_frame           (res, new_Proj(start, mode_P_data, pn_Start_P_frame_base));
+       set_irg_globals         (res, new_Proj(start, mode_P_data, pn_Start_P_globals));
+       set_irg_tls             (res, new_Proj(start, mode_P_data, pn_Start_P_tls));
+       set_irg_args            (res, new_Proj(start, mode_T,      pn_Start_T_args));
+       set_irg_value_param_base(res, new_Proj(start, mode_P_data, pn_Start_P_value_arg_base));
+       initial_mem             = new_Proj(start, mode_M, pn_Start_M);
+       set_irg_initial_mem(res, initial_mem);
+
+       add_immBlock_pred(start_block, projX);
+       set_store(initial_mem);
 
 #ifdef DEBUG_libfirm
-  res->graph_nr    = get_irp_new_node_nr();
+       res->graph_nr    = get_irp_new_node_nr();
 #endif
-  res->proj_args   = NULL;
+       res->proj_args   = NULL;
 
-  /*
-   * The code generation needs it. leave it in now.
-   * Use of this edge is matter of discussion, unresolved. Also possible:
-   * add_immBlock_pred(res->start_block, res->start_block), but invalid typed.
-   */
-  mature_immBlock(res->current_block);
+       /*
+        * The code generation needs it. leave it in now.
+        * Use of this edge is matter of discussion, unresolved. Also possible:
+        * add_immBlock_pred(res->start_block, res->start_block), but invalid typed.
+        */
+       mature_immBlock(res->current_block);
 
-  /*-- Make a block to start with --*/
-  first_block = new_immBlock();
-  add_immBlock_pred(first_block, projX);
+       /*-- Make a block to start with --*/
+       first_block = new_immBlock();
+       add_immBlock_pred(first_block, projX);
 
-  res->method_execution_frequency = -1.0;
-  res->estimated_node_count       = 0;
+       res->method_execution_frequency = -1.0;
+       res->estimated_node_count       = 0;
 
-  return res;
+       return res;
 }
 
 
 ir_graph *
-new_ir_graph(ir_entity *ent, int n_loc)
-{
-  ir_graph *res = new_r_ir_graph(ent, n_loc);
-  add_irp_irg(res);          /* remember this graph global. */
-  return res;
+new_ir_graph(ir_entity *ent, int n_loc) {
+       ir_graph *res = new_r_ir_graph(ent, n_loc);
+       add_irp_irg(res);          /* remember this graph global. */
+       return res;
 }
 
 /* Make a rudimentary IR graph for the constant code.
    Must look like a correct irg, spare everything else. */
 ir_graph *new_const_code_irg(void) {
-  ir_graph *res;
-  ir_node  *end, *start_block, *start, *projX;
+       ir_graph *res;
+       ir_node  *end, *start_block, *start, *projX;
 
-  res = alloc_graph();
+       res = alloc_graph();
 
-  /* initialize the idx->node map. */
-  res->idx_irn_map = NEW_ARR_F(ir_node *, INITIAL_IDX_IRN_MAP_SIZE);
-  memset(res->idx_irn_map, 0, INITIAL_IDX_IRN_MAP_SIZE * sizeof(res->idx_irn_map[0]));
+       /* initialize the idx->node map. */
+       res->idx_irn_map = NEW_ARR_F(ir_node *, INITIAL_IDX_IRN_MAP_SIZE);
+       memset(res->idx_irn_map, 0, INITIAL_IDX_IRN_MAP_SIZE * sizeof(res->idx_irn_map[0]));
 
-  /* inform statistics here, as blocks will be already build on this graph */
-  hook_new_graph(res, NULL);
+       /* inform statistics here, as blocks will be already build on this graph */
+       hook_new_graph(res, NULL);
 
-  current_ir_graph = res;
-  res->n_loc = 1;         /* Only the memory. */
-  res->visited = 0;       /* visited flag, for the ir walker */
-  res->block_visited = 0; /* visited flag, for the 'block'-walker */
+       current_ir_graph = res;
+       res->n_loc = 1;         /* Only the memory. */
+       res->visited = 0;       /* visited flag, for the ir walker */
+       res->block_visited = 0; /* visited flag, for the 'block'-walker */
 #if USE_EXPLICIT_PHI_IN_STACK
-  res->Phi_in_stack = NULL;
+       res->Phi_in_stack = NULL;
 #endif
-  res->kind = k_ir_graph;
-  res->obst      = xmalloc (sizeof(*res->obst));
-  obstack_init (res->obst);
-  res->extbb_obst = NULL;
-
-  res->last_node_idx = 0;
-
-  res->phase_state      = phase_building;
-  res->irg_pinned_state = op_pin_state_pinned;
-  res->extblk_state     = ir_extblk_info_none;
-  res->fp_model         = fp_model_precise;
-
-  res->value_table = new_identities (); /* value table for global value
-                       numbering for optimizing use in
-                       iropt.c */
-  res->ent = NULL;
-  res->frame_type  = NULL;
-
-  /* -- The end block -- */
-  set_irg_end_block (res, new_immBlock());
-  end = new_End();
-  set_irg_end       (res, end);
-  set_irg_end_reg   (res, end);
-  set_irg_end_except(res, end);
-  mature_immBlock(get_cur_block());  /* mature the end block */
-
-  /* -- The start block -- */
-  start_block        = new_immBlock();
-  set_irg_start_block(res, start_block);
-  set_irg_bad        (res, new_ir_node (NULL, res, start_block, op_Bad, mode_T, 0, NULL));
-  set_irg_no_mem     (res, new_ir_node (NULL, res, start_block, op_NoMem, mode_M, 0, NULL));
-  start              = new_Start();
-  set_irg_start      (res, start);
-
-  /* Proj results of start node */
-  set_irg_initial_mem(res, new_Proj(start, mode_M, pn_Start_M));
-  projX = new_Proj(start, mode_X, pn_Start_X_initial_exec);
-  add_immBlock_pred(start_block, projX);
-  mature_immBlock  (start_block);  /* mature the start block */
-
-  add_immBlock_pred(new_immBlock(), projX);
-  mature_immBlock  (get_cur_block());   /* mature the 'body' block for expressions */
-
-  /* Set the visited flag high enough that the blocks will never be visited. */
-  set_irn_visited(get_cur_block(), -1);
-  set_Block_block_visited(get_cur_block(), -1);
-  set_Block_block_visited(start_block, -1);
-  set_irn_visited(start_block, -1);
-  set_irn_visited(get_irg_bad(res), -1);
-  set_irn_visited(get_irg_no_mem(res), -1);
-
-  res->phase_state = phase_high;
-
-  return res;
+       res->kind = k_ir_graph;
+       res->obst      = xmalloc (sizeof(*res->obst));
+       obstack_init (res->obst);
+       res->extbb_obst = NULL;
+
+       res->last_node_idx = 0;
+
+       res->phase_state      = phase_building;
+       res->irg_pinned_state = op_pin_state_pinned;
+       res->extblk_state     = ir_extblk_info_none;
+       res->fp_model         = fp_model_precise;
+
+       res->value_table = new_identities (); /* value table for global value
+                                          numbering for optimizing use in
+                                          iropt.c */
+       res->ent = NULL;
+       res->frame_type  = NULL;
+
+       /* the Anchor node must be created first */
+       res->anchor = new_Anchor(res);
+
+       /* -- The end block -- */
+       set_irg_end_block (res, new_immBlock());
+       end = new_End();
+       set_irg_end       (res, end);
+       set_irg_end_reg   (res, end);
+       set_irg_end_except(res, end);
+       mature_immBlock(get_cur_block());  /* mature the end block */
+
+       /* -- The start block -- */
+       start_block        = new_immBlock();
+       set_irg_start_block(res, start_block);
+       set_irg_bad        (res, new_ir_node (NULL, res, start_block, op_Bad, mode_T, 0, NULL));
+       set_irg_no_mem     (res, new_ir_node (NULL, res, start_block, op_NoMem, mode_M, 0, NULL));
+       start              = new_Start();
+       set_irg_start      (res, start);
+
+       /* Proj results of start node */
+       set_irg_initial_mem(res, new_Proj(start, mode_M, pn_Start_M));
+       projX = new_Proj(start, mode_X, pn_Start_X_initial_exec);
+       add_immBlock_pred(start_block, projX);
+       mature_immBlock  (start_block);  /* mature the start block */
+
+       add_immBlock_pred(new_immBlock(), projX);
+       mature_immBlock  (get_cur_block());   /* mature the 'body' block for expressions */
+
+       /* Set the visited flag high enough that the blocks will never be visited. */
+       set_irn_visited(get_cur_block(), -1);
+       set_Block_block_visited(get_cur_block(), -1);
+       set_Block_block_visited(start_block, -1);
+       set_irn_visited(start_block, -1);
+       set_irn_visited(get_irg_bad(res), -1);
+       set_irn_visited(get_irg_no_mem(res), -1);
+
+       res->phase_state = phase_high;
+
+       return res;
 }
 
 /* Defined in iropt.c */
@@ -374,29 +376,29 @@ void  del_identities (pset *value_table);
    Does not free types, entities or modes that are used only by this
    graph, nor the entity standing for this graph. */
 void free_ir_graph (ir_graph *irg) {
-  assert(is_ir_graph(irg));
-
-  hook_free_graph(irg);
-  if (irg->outs_state != outs_none) free_irg_outs(irg);
-  if (irg->frame_type)  free_type(irg->frame_type);
-  if (irg->value_table) del_identities(irg->value_table);
-  if (irg->ent) {
-    ir_peculiarity pec = get_entity_peculiarity (irg->ent);
-    set_entity_peculiarity (irg->ent, peculiarity_description);
-    set_entity_irg(irg->ent, NULL);  /* not set in const code irg */
-    set_entity_peculiarity (irg->ent, pec);
-  }
-
-  free_End(get_irg_end(irg));
-  obstack_free(irg->obst,NULL);
-  free(irg->obst);
+       assert(is_ir_graph(irg));
+
+       hook_free_graph(irg);
+       if (irg->outs_state != outs_none) free_irg_outs(irg);
+       if (irg->frame_type)  free_type(irg->frame_type);
+       if (irg->value_table) del_identities(irg->value_table);
+       if (irg->ent) {
+               ir_peculiarity pec = get_entity_peculiarity (irg->ent);
+               set_entity_peculiarity (irg->ent, peculiarity_description);
+               set_entity_irg(irg->ent, NULL);  /* not set in const code irg */
+               set_entity_peculiarity (irg->ent, pec);
+       }
+
+       free_End(get_irg_end(irg));
+       obstack_free(irg->obst,NULL);
+       free(irg->obst);
 #if USE_EXPLICIT_PHI_IN_STACK
-  free_Phi_in_stack(irg->Phi_in_stack);
+       free_Phi_in_stack(irg->Phi_in_stack);
 #endif
-  if (irg->loc_descriptions)
-    free(irg->loc_descriptions);
-  irg->kind = k_BAD;
-  free_graph(irg);
+       if (irg->loc_descriptions)
+               free(irg->loc_descriptions);
+       irg->kind = k_BAD;
+       free_graph(irg);
 }
 
 /* access routines for all ir_graph attributes:
@@ -406,42 +408,42 @@ void free_ir_graph (ir_graph *irg) {
 
 int
 (is_ir_graph)(const void *thing) {
-  return _is_ir_graph(thing);
+       return _is_ir_graph(thing);
 }
 
 /* Outputs a unique number for this node */
 long get_irg_graph_nr(ir_graph *irg) {
-  assert(irg);
+       assert(irg);
 #ifdef DEBUG_libfirm
-  return irg->graph_nr;
+       return irg->graph_nr;
 #else
-  return (long)PTR_TO_INT(irg);
+       return (long)PTR_TO_INT(irg);
 #endif
 }
 
 ir_node *
 (get_irg_start_block)(const ir_graph *irg) {
-  return _get_irg_start_block(irg);
+       return _get_irg_start_block(irg);
 }
 
 void
 (set_irg_start_block)(ir_graph *irg, ir_node *node) {
-  _set_irg_start_block(irg, node);
+       _set_irg_start_block(irg, node);
 }
 
 ir_node *
 (get_irg_start)(const ir_graph *irg) {
-  return _get_irg_start(irg);
+       return _get_irg_start(irg);
 }
 
 void
 (set_irg_start)(ir_graph *irg, ir_node *node) {
-  _set_irg_start(irg, node);
+       _set_irg_start(irg, node);
 }
 
 ir_node *
 (get_irg_end_block)(const ir_graph *irg) {
-  return _get_irg_end_block(irg);
+       return _get_irg_end_block(irg);
 }
 
 void
@@ -451,42 +453,43 @@ void
 
 ir_node *
 (get_irg_end)(const ir_graph *irg) {
-  return _get_irg_end(irg);
+       return _get_irg_end(irg);
 }
 
 void
 (set_irg_end)(ir_graph *irg, ir_node *node) {
-  _set_irg_end(irg, node);
+       _set_irg_end(irg, node);
 }
 
 ir_node *
 (get_irg_end_reg)(const ir_graph *irg) {
-  return _get_irg_end_reg(irg);
+       return _get_irg_end_reg(irg);
 }
 
-void     set_irg_end_reg (ir_graph *irg, ir_node *node) {
-  assert(get_irn_op(node) == op_EndReg || get_irn_op(node) == op_End);
-  irg->anchors[anchor_end_reg] = node;
+void
+(set_irg_end_reg)(ir_graph *irg, ir_node *node) {
+       _set_irg_end_reg(irg, node);
 }
 
 ir_node *
 (get_irg_end_except)(const ir_graph *irg) {
-  return _get_irg_end_except(irg);
+       return _get_irg_end_except(irg);
 }
 
-void     set_irg_end_except (ir_graph *irg, ir_node *node) {
-  assert(get_irn_op(node) == op_EndExcept || get_irn_op(node) == op_End);
-  irg->anchors[anchor_end_except] = node;
+void
+(set_irg_end_except)(ir_graph *irg, ir_node *node) {
+       assert(get_irn_op(node) == op_EndExcept || get_irn_op(node) == op_End);
+       _set_irg_end_except(irg, node);
 }
 
 ir_node *
 (get_irg_frame)(const ir_graph *irg) {
-  return _get_irg_frame(irg);
+       return _get_irg_frame(irg);
 }
 
 void
 (set_irg_frame)(ir_graph *irg, ir_node *node) {
-  _set_irg_frame(irg, node);
+       _set_irg_frame(irg, node);
 }
 
 ir_node *
@@ -496,125 +499,123 @@ ir_node *
 
 void
 (set_irg_globals)(ir_graph *irg, ir_node *node) {
-  _set_irg_globals(irg, node);
+       _set_irg_globals(irg, node);
 }
 
 ir_node *
 (get_irg_tls)(const ir_graph *irg) {
-  return _get_irg_tls(irg);
+       return _get_irg_tls(irg);
 }
 
 void
 (set_irg_tls)(ir_graph *irg, ir_node *node) {
-  _set_irg_tls(irg, node);
+       _set_irg_tls(irg, node);
 }
 
 ir_node *
 (get_irg_initial_mem)(const ir_graph *irg) {
-  return _get_irg_initial_mem(irg);
+       return _get_irg_initial_mem(irg);
 }
 
 void
 (set_irg_initial_mem)(ir_graph *irg, ir_node *node) {
-  _set_irg_initial_mem(irg, node);
+       _set_irg_initial_mem(irg, node);
 }
 
 ir_node *
 (get_irg_args)(const ir_graph *irg) {
-  return _get_irg_args(irg);
+       return _get_irg_args(irg);
 }
 
 void
 (set_irg_args)(ir_graph *irg, ir_node *node) {
-  _set_irg_args(irg, node);
+       _set_irg_args(irg, node);
 }
 
 ir_node *
 (get_irg_value_param_base)(const ir_graph *irg) {
-  return _get_irg_value_param_base(irg);
+       return _get_irg_value_param_base(irg);
 }
 
 void
 (set_irg_value_param_base)(ir_graph *irg, ir_node *node) {
-  _set_irg_value_param_base(irg, node);
+       _set_irg_value_param_base(irg, node);
 }
 
 ir_node **
 (get_irg_proj_args) (const ir_graph *irg) {
-  return _get_irg_proj_args (irg);
+       return _get_irg_proj_args (irg);
 }
 
 void
 (set_irg_proj_args) (ir_graph *irg, ir_node **nodes) {
-  _set_irg_proj_args (irg, nodes);
+       _set_irg_proj_args (irg, nodes);
 }
 
 ir_node *
 (get_irg_bad)(const ir_graph *irg) {
-  return _get_irg_bad(irg);
+       return _get_irg_bad(irg);
 }
 
 void
 (set_irg_bad)(ir_graph *irg, ir_node *node) {
-  _set_irg_bad(irg, node);
+       _set_irg_bad(irg, node);
 }
 
 ir_node *
 (get_irg_no_mem)(const ir_graph *irg) {
-  return _get_irg_no_mem(irg);
+       return _get_irg_no_mem(irg);
 }
 
 void
 (set_irg_no_mem)(ir_graph *irg, ir_node *node) {
-  _set_irg_no_mem(irg, node);
+       _set_irg_no_mem(irg, node);
 }
 
 ir_node *
 (get_irg_current_block)(const ir_graph *irg) {
-  return _get_irg_current_block(irg);
+       return _get_irg_current_block(irg);
 }
 
 void
 (set_irg_current_block)(ir_graph *irg, ir_node *node) {
-  _set_irg_current_block(irg, node);
+       _set_irg_current_block(irg, node);
 }
 
 ir_entity *
 (get_irg_entity)(const ir_graph *irg) {
-  return _get_irg_entity(irg);
+       return _get_irg_entity(irg);
 }
 
 void
 (set_irg_entity)(ir_graph *irg, ir_entity *ent) {
-  _set_irg_entity(irg, ent);
+       _set_irg_entity(irg, ent);
 }
 
 ir_type *
 (get_irg_frame_type)(ir_graph *irg) {
-  return _get_irg_frame_type(irg);
+       return _get_irg_frame_type(irg);
 }
 
 void
 (set_irg_frame_type)(ir_graph *irg, ir_type *ftp) {
-  _set_irg_frame_type(irg, ftp);
+       _set_irg_frame_type(irg, ftp);
 }
 
 int
-get_irg_n_locs (ir_graph *irg)
-{
-  if (get_opt_precise_exc_context())
-    return irg->n_loc - 1 - 1;
-  else
-    return irg->n_loc - 1;
+get_irg_n_locs(ir_graph *irg) {
+       if (get_opt_precise_exc_context())
+               return irg->n_loc - 1 - 1;
+       else
+               return irg->n_loc - 1;
 }
 
 void
-set_irg_n_loc (ir_graph *irg, int n_loc)
-{
-  if (get_opt_precise_exc_context())
-    irg->n_loc = n_loc + 1 + 1;
-  else
-    irg->n_loc = n_loc + 1;
+set_irg_n_loc(ir_graph *irg, int n_loc) {
+       if (get_opt_precise_exc_context())
+               irg->n_loc = n_loc + 1 + 1;
+       else
+               irg->n_loc = n_loc + 1;
 }
 
 
@@ -622,7 +623,7 @@ set_irg_n_loc (ir_graph *irg, int n_loc)
 /* Returns the obstack associated with the graph. */
 struct obstack *
 (get_irg_obstack)(const ir_graph *irg) {
-  return _get_irg_obstack(irg);
+       return _get_irg_obstack(irg);
 }
 
 /*
@@ -630,144 +631,143 @@ 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)
-{
-  struct _obstack_chunk *p;
+int node_is_in_irgs_storage(ir_graph *irg, ir_node *n) {
+       struct _obstack_chunk *p;
 
-  /*
-   * checks weather the ir_node pointer is on the obstack.
-   * A more sophisticated check would test the "whole" ir_node
-   */
-  for (p = irg->obst->chunk; p; p = p->prev) {
-    if (((char *)p->contents <= (char *)n) && ((char *)n < (char *)p->limit))
-      return 1;
-  }
+       /*
+        * checks weather the ir_node pointer is on the obstack.
+        * A more sophisticated check would test the "whole" ir_node
+        */
+       for (p = irg->obst->chunk; p; p = p->prev) {
+               if (((char *)p->contents <= (char *)n) && ((char *)n < (char *)p->limit))
+                       return 1;
+       }
 
-  return 0;
+       return 0;
 }
 
 irg_phase_state
 (get_irg_phase_state)(const ir_graph *irg) {
-  return _get_irg_phase_state(irg);
+       return _get_irg_phase_state(irg);
 }
 
 void
 (set_irg_phase_state)(ir_graph *irg, irg_phase_state state) {
-  _set_irg_phase_state(irg, state);
+       _set_irg_phase_state(irg, state);
 }
 
 op_pin_state
 (get_irg_pinned)(const ir_graph *irg) {
-  return _get_irg_pinned(irg);
+       return _get_irg_pinned(irg);
 }
 
 irg_outs_state
 (get_irg_outs_state)(const ir_graph *irg) {
-  return _get_irg_outs_state(irg);
+       return _get_irg_outs_state(irg);
 }
 
 void
 (set_irg_outs_inconsistent)(ir_graph *irg) {
-  _set_irg_outs_inconsistent(irg);
+       _set_irg_outs_inconsistent(irg);
 }
 
 irg_extblk_state
 (get_irg_extblk_state)(const ir_graph *irg) {
-  return _get_irg_extblk_state(irg);
+       return _get_irg_extblk_state(irg);
 }
 
 void
 (set_irg_extblk_inconsistent)(ir_graph *irg) {
-  _set_irg_extblk_inconsistent(irg);
+       _set_irg_extblk_inconsistent(irg);
 }
 
 irg_dom_state
 (get_irg_dom_state)(const ir_graph *irg) {
-  return _get_irg_dom_state(irg);
+       return _get_irg_dom_state(irg);
 }
 
 irg_dom_state
 (get_irg_postdom_state)(const ir_graph *irg) {
-  return _get_irg_postdom_state(irg);
+       return _get_irg_postdom_state(irg);
 }
 
 void
 (set_irg_doms_inconsistent)(ir_graph *irg) {
-  _set_irg_doms_inconsistent(irg);
+       _set_irg_doms_inconsistent(irg);
 }
 
 irg_loopinfo_state
 (get_irg_loopinfo_state)(const ir_graph *irg) {
-  return _get_irg_loopinfo_state(irg);
+       return _get_irg_loopinfo_state(irg);
 }
 
 void
 (set_irg_loopinfo_state)(ir_graph *irg, irg_loopinfo_state s) {
-  _set_irg_loopinfo_state(irg, s);
+       _set_irg_loopinfo_state(irg, s);
 }
 
 void
 (set_irg_loopinfo_inconsistent)(ir_graph *irg) {
-  _set_irg_loopinfo_inconsistent(irg);
+       _set_irg_loopinfo_inconsistent(irg);
 }
 
 void set_irp_loopinfo_inconsistent(void) {
-  int i, n_irgs = get_irp_n_irgs();
-  for (i = 0; i < n_irgs; ++i) {
-    set_irg_loopinfo_inconsistent(get_irp_irg(i));
-  }
+       int i;
+       for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
+               set_irg_loopinfo_inconsistent(get_irp_irg(i));
+       }
 }
 
 
 
 void
 (set_irg_pinned)(ir_graph *irg, op_pin_state p) {
-  _set_irg_pinned(irg, p);
+       _set_irg_pinned(irg, p);
 }
 
 irg_callee_info_state
 (get_irg_callee_info_state)(const ir_graph *irg) {
-  return _get_irg_callee_info_state(irg);
+       return _get_irg_callee_info_state(irg);
 }
 
 void
 (set_irg_callee_info_state)(ir_graph *irg, irg_callee_info_state s) {
-  _set_irg_callee_info_state(irg, s);
+       _set_irg_callee_info_state(irg, s);
 }
 
 irg_inline_property
 (get_irg_inline_property)(const ir_graph *irg) {
-  return _get_irg_inline_property(irg);
+       return _get_irg_inline_property(irg);
 }
 
 void
 (set_irg_inline_property)(ir_graph *irg, irg_inline_property s) {
-  _set_irg_inline_property(irg, s);
+       _set_irg_inline_property(irg, s);
 }
 
 unsigned
 (get_irg_additional_properties)(const ir_graph *irg) {
-  return _get_irg_additional_properties(irg);
+       return _get_irg_additional_properties(irg);
 }
 
 void
 (set_irg_additional_properties)(ir_graph *irg, unsigned property_mask) {
-  _set_irg_additional_properties(irg, property_mask);
+       _set_irg_additional_properties(irg, property_mask);
 }
 
 void
 (set_irg_additional_property)(ir_graph *irg, mtp_additional_property flag) {
-  _set_irg_additional_property(irg, flag);
+       _set_irg_additional_property(irg, flag);
 }
 
 void
 (set_irg_link)(ir_graph *irg, void *thing) {
-  _set_irg_link(irg, thing);
+       _set_irg_link(irg, thing);
 }
 
 void *
 (get_irg_link)(const ir_graph *irg) {
-  return _get_irg_link(irg);
+       return _get_irg_link(irg);
 }
 
 /** maximum visited flag content of all ir_graph visited fields. */
@@ -775,61 +775,56 @@ static unsigned long max_irg_visited = 0;
 
 unsigned long
 (get_irg_visited)(const ir_graph *irg) {
-  return _get_irg_visited(irg);
+       return _get_irg_visited(irg);
 }
 
 void
-set_irg_visited (ir_graph *irg, unsigned long visited)
-{
-  irg->visited = visited;
-  if (irg->visited > max_irg_visited) {
-    max_irg_visited = irg->visited;
-  }
+set_irg_visited(ir_graph *irg, unsigned long visited) {
+       irg->visited = visited;
+       if (irg->visited > max_irg_visited) {
+               max_irg_visited = irg->visited;
+       }
 }
 
 void
-inc_irg_visited (ir_graph *irg)
-{
-  if (++irg->visited > max_irg_visited) {
-    max_irg_visited = irg->visited;
-  }
+inc_irg_visited(ir_graph *irg) {
+       if (++irg->visited > max_irg_visited) {
+               max_irg_visited = irg->visited;
+       }
 }
 
 unsigned long
-get_max_irg_visited(void)
-{
-  /*
-  int i;
-  for(i = 0; i < get_irp_n_irgs(); i++)
-  assert(max_irg_visited >= get_irg_visited(get_irp_irg(i)));
-   */
-  return max_irg_visited;
+get_max_irg_visited(void) {
+       /*
+       int i;
+       for(i = 0; i < get_irp_n_irgs(); i++)
+       assert(max_irg_visited >= get_irg_visited(get_irp_irg(i)));
+        */
+       return max_irg_visited;
 }
 
 void set_max_irg_visited(int val) {
-  max_irg_visited = val;
+       max_irg_visited = val;
 }
 
 unsigned long
-inc_max_irg_visited(void)
-{
-  /*
-  int i;
-  for(i = 0; i < get_irp_n_irgs(); i++)
-  assert(max_irg_visited >= get_irg_visited(get_irp_irg(i)));
-  */
-  max_irg_visited++;
-  return max_irg_visited;
+inc_max_irg_visited(void) {
+       /*
+       int i;
+       for(i = 0; i < get_irp_n_irgs(); i++)
+       assert(max_irg_visited >= get_irg_visited(get_irp_irg(i)));
+       */
+       return ++max_irg_visited;
 }
 
 unsigned long
 (get_irg_block_visited)(const ir_graph *irg) {
-  return _get_irg_block_visited(irg);
+       return _get_irg_block_visited(irg);
 }
 
 void
 (set_irg_block_visited)(ir_graph *irg, unsigned long visited) {
-  _set_irg_block_visited(irg, visited);
+       _set_irg_block_visited(irg, visited);
 }
 
 void
@@ -839,12 +834,12 @@ void
 
 /* Return the floating point model of this graph. */
 unsigned (get_irg_fp_model)(const ir_graph *irg) {
-  return _get_irg_fp_model(irg);
+       return _get_irg_fp_model(irg);
 }
 
 /* Sets the floating point model for this graph. */
 void set_irg_fp_model(ir_graph *irg, unsigned model) {
-  irg->fp_model = model;
+       irg->fp_model = model;
 }
 
 /**
@@ -854,37 +849,36 @@ void set_irg_fp_model(ir_graph *irg, unsigned model) {
  * @param n    the node
  * @param env  ignored
  */
-static void normalize_proj_walker(ir_node *n, void *env)
-{
-  (void) env;
-  if (is_Proj(n)) {
-    ir_node *pred  = get_Proj_pred(n);
-    ir_node *block = get_nodes_block(pred);
+static void normalize_proj_walker(ir_node *n, void *env) {
+       (void) env;
+       if (is_Proj(n)) {
+               ir_node *pred  = get_Proj_pred(n);
+               ir_node *block = get_nodes_block(pred);
 
-    set_nodes_block(n, block);
-  }
+               set_nodes_block(n, block);
+       }
 }
 
 /* move Proj nodes into the same block as its predecessors */
 void normalize_proj_nodes(ir_graph *irg) {
-  irg_walk_graph(irg, NULL, normalize_proj_walker, NULL);
-  set_irg_outs_inconsistent(irg);
+       irg_walk_graph(irg, NULL, normalize_proj_walker, NULL);
+       set_irg_outs_inconsistent(irg);
 }
 
 /* set a description for local value n */
 void set_irg_loc_description(ir_graph *irg, int n, void *description) {
-  assert(0 <= n && n < irg->n_loc);
+       assert(0 <= n && n < irg->n_loc);
 
-  if (! irg->loc_descriptions)
-    irg->loc_descriptions = xcalloc(sizeof(*irg->loc_descriptions), irg->n_loc);
+       if (! irg->loc_descriptions)
+               irg->loc_descriptions = xcalloc(sizeof(*irg->loc_descriptions), irg->n_loc);
 
-  irg->loc_descriptions[n] = description;
+       irg->loc_descriptions[n] = description;
 }
 
 /* get the description for local value n */
 void *get_irg_loc_description(ir_graph *irg, int n) {
-  assert(0 <= n && n < irg->n_loc);
-  return irg->loc_descriptions ? irg->loc_descriptions[n] : NULL;
+       assert(0 <= n && n < irg->n_loc);
+       return irg->loc_descriptions ? irg->loc_descriptions[n] : NULL;
 }
 
 #ifndef NDEBUG
@@ -899,7 +893,7 @@ void clear_using_block_visited(ir_graph *irg) {
 }
 
 int using_block_visited(const ir_graph *irg) {
-       return irg->using_block_visited;
+       return irg->using_block_visited;
 }
 
 
@@ -914,7 +908,7 @@ void clear_using_visited(ir_graph *irg) {
 }
 
 int using_visited(const ir_graph *irg) {
-       return irg->using_visited;
+       return irg->using_visited;
 }
 
 
@@ -929,27 +923,26 @@ void clear_using_irn_link(ir_graph *irg) {
 }
 
 int using_irn_link(const ir_graph *irg) {
-       return irg->using_irn_link;
+       return irg->using_irn_link;
 }
 #endif
 
 /* Returns a estimated node count of the irg. */
 unsigned (get_irg_estimated_node_cnt)(const ir_graph *irg) {
-  return _get_irg_estimated_node_cnt(irg);
+       return _get_irg_estimated_node_cnt(irg);
 }
 
 /* Returns the last irn index for this graph. */
 unsigned get_irg_last_idx(const ir_graph *irg) {
-  return irg->last_node_idx;
+       return irg->last_node_idx;
 }
 
 /* register additional space in an IR graph */
-size_t register_additional_graph_data(size_t size)
-{
-  assert(!forbid_new_data && "Too late to register additional node data");
+size_t register_additional_graph_data(size_t size) {
+       assert(!forbid_new_data && "Too late to register additional node data");
 
-  if (forbid_new_data)
-    return 0;
+       if (forbid_new_data)
+               return 0;
 
-  return additional_graph_data_size += size;
+       return additional_graph_data_size += size;
 }
index 586f338..9bea0ee 100644 (file)
@@ -97,112 +97,123 @@ _is_ir_graph(const void *thing) {
 /** Returns the start block of a graph. */
 static INLINE ir_node *
 _get_irg_start_block(const ir_graph *irg) {
-       return irg->anchors[anchor_start_block];
+       return get_irn_intra_n(irg->anchor, anchor_start_block);
 }
 
 static INLINE void
 _set_irg_start_block(ir_graph *irg, ir_node *node) {
-       irg->anchors[anchor_start_block] = node;
+       set_irn_n(irg->anchor, anchor_start_block, node);
 }
 
 static INLINE ir_node *
 _get_irg_start(const ir_graph *irg) {
-       return irg->anchors[anchor_start];
+       return get_irn_intra_n(irg->anchor, anchor_start);
 }
 
 static INLINE void
 _set_irg_start(ir_graph *irg, ir_node *node) {
-       irg->anchors[anchor_start] = node;
+       set_irn_n(irg->anchor, anchor_start, node);
 }
 
 static INLINE ir_node *
 _get_irg_end_block(const ir_graph *irg) {
-  return irg->anchors[anchor_end_block];
+       return get_irn_intra_n(irg->anchor, anchor_end_block);
 }
 
 static INLINE void
 _set_irg_end_block(ir_graph *irg, ir_node *node) {
-       irg->anchors[anchor_end_block] = node;
+       set_irn_n(irg->anchor, -1, node);
+       set_irn_n(irg->anchor, anchor_end_block, node);
 }
 
 static INLINE ir_node *
 _get_irg_end(const ir_graph *irg) {
-       return irg->anchors[anchor_end];
+       return get_irn_intra_n(irg->anchor, anchor_end);
 }
 
 static INLINE void
 _set_irg_end(ir_graph *irg, ir_node *node) {
-       irg->anchors[anchor_end] = node;
+       set_irn_n(irg->anchor, anchor_end, node);
 }
 
 static INLINE ir_node *
 _get_irg_end_reg(const ir_graph *irg) {
-       return irg->anchors[anchor_end_reg];
+       return get_irn_intra_n(irg->anchor, anchor_end_reg);
+}
+
+static INLINE void
+_set_irg_end_reg(ir_graph *irg, ir_node *node) {
+       set_irn_n(irg->anchor, anchor_end_reg, node);
 }
 
 static INLINE ir_node *
-_get_irg_end_except (const ir_graph *irg) {
-       return irg->anchors[anchor_end_except];
+_get_irg_end_except(const ir_graph *irg) {
+       return get_irn_intra_n(irg->anchor, anchor_end_except);
+}
+
+static INLINE void
+_set_irg_end_except(ir_graph *irg, ir_node *node) {
+       set_irn_n(irg->anchor, anchor_end_except, node);
 }
 
 static INLINE ir_node *
 _get_irg_frame(const ir_graph *irg) {
-       return irg->anchors[anchor_frame];
+       return get_irn_intra_n(irg->anchor, anchor_frame);
 }
 
 static INLINE void
 _set_irg_frame(ir_graph *irg, ir_node *node) {
-       irg->anchors[anchor_frame] = node;
+       set_irn_n(irg->anchor, anchor_frame, node);
 }
 
 static INLINE ir_node *
 _get_irg_globals(const ir_graph *irg) {
-       return irg->anchors[anchor_globals];
+       return get_irn_intra_n(irg->anchor, anchor_globals);
 }
 
 static INLINE void
 _set_irg_globals(ir_graph *irg, ir_node *node) {
-       irg->anchors[anchor_globals] = node;
+       set_irn_n(irg->anchor, anchor_globals, node);
 }
 
 static INLINE ir_node *
 _get_irg_tls(const ir_graph *irg) {
-       return irg->anchors[anchor_tls];
+       return get_irn_intra_n(irg->anchor, anchor_tls);
 }
 
 static INLINE void
 _set_irg_tls(ir_graph *irg, ir_node *node) {
-       irg->anchors[anchor_tls] = node;
+       set_irn_n(irg->anchor, anchor_tls, node);
 }
 
 static INLINE ir_node *
 _get_irg_initial_mem(const ir_graph *irg) {
-       return irg->anchors[anchor_initial_mem];
+       return get_irn_intra_n(irg->anchor, anchor_initial_mem);
 }
 
 static INLINE void
 _set_irg_initial_mem(ir_graph *irg, ir_node *node) {
-       irg->anchors[anchor_initial_mem] = node;
+       set_irn_n(irg->anchor, anchor_initial_mem, node);
 }
 
 static INLINE ir_node *
 _get_irg_args(const ir_graph *irg) {
-       return irg->anchors[anchor_args];
+       return get_irn_intra_n(irg->anchor, anchor_args);
 }
 
 static INLINE void
 _set_irg_args(ir_graph *irg, ir_node *node) {
-       irg->anchors[anchor_args] = node;
+       set_irn_n(irg->anchor, anchor_args, node);
 }
 
 static INLINE ir_node *
 _get_irg_value_param_base(const ir_graph *irg) {
-       return irg->anchors[anchor_value_param_base];
+       return get_irn_intra_n(irg->anchor, anchor_value_param_base);
 }
 
 static INLINE void
 _set_irg_value_param_base(ir_graph *irg, ir_node *node) {
-       irg->anchors[anchor_value_param_base] = node;
+       set_irn_n(irg->anchor, anchor_value_param_base, node);
 }
 
 static INLINE ir_node **
@@ -217,23 +228,24 @@ _set_irg_proj_args(ir_graph *irg, ir_node **nodes) {
 
 static INLINE ir_node *
 _get_irg_bad(const ir_graph *irg) {
-       return irg->anchors[anchor_bad];
+       return get_irn_intra_n(irg->anchor, anchor_bad);
 }
 
 static INLINE void
 _set_irg_bad(ir_graph *irg, ir_node *node) {
-       irg->anchors[anchor_bad] = node;
+       set_irn_n(irg->anchor, anchor_bad, node);
 }
 
 static INLINE ir_node *
 _get_irg_no_mem(const ir_graph *irg) {
-       return irg->anchors[anchor_no_mem];
+       return get_irn_intra_n(irg->anchor, anchor_no_mem);
 }
 
 static INLINE void
 _set_irg_no_mem(ir_graph *irg, ir_node *node) {
-       irg->anchors[anchor_no_mem] = node;
+       set_irn_n(irg->anchor, anchor_no_mem, node);
 }
+
 static INLINE ir_node *
 _get_irg_current_block(const ir_graph *irg) {
        return irg->current_block;
@@ -485,6 +497,31 @@ get_idx_irn(ir_graph *irg, unsigned idx) {
        return irg->idx_irn_map[idx];
 }
 
+/**
+ * Return the number of anchors in this graph.
+ */
+static INLINE int
+get_irg_n_anchors(const ir_graph *irg) {
+       return get_irn_arity(irg->anchor);
+}
+
+/**
+ * Return anchor for given index
+ */
+static INLINE ir_node *
+get_irg_anchor(const ir_graph *irg, int idx) {
+       return get_irn_intra_n(irg->anchor, idx);
+}
+
+/**
+ * Set anchor for given index
+ */
+static INLINE void
+set_irg_anchor(ir_graph *irg, int idx, ir_node *irn) {
+       set_irn_n(irg->anchor, idx, irn);
+}
+
+
 #define get_interprocedural_view()            _get_interprocedural_view()
 #define is_ir_graph(thing)                    _is_ir_graph(thing)
 #define get_irg_start_block(irg)              _get_irg_start_block(irg)
@@ -496,7 +533,9 @@ get_idx_irn(ir_graph *irg, unsigned idx) {
 #define get_irg_end(irg)                      _get_irg_end(irg)
 #define set_irg_end(irg, node)                _set_irg_end(irg, node)
 #define get_irg_end_reg(irg)                  _get_irg_end_reg(irg)
+#define set_irg_end_reg(irg, node)            _set_irg_end_reg(irg, node)
 #define get_irg_end_except(irg)               _get_irg_end_except(irg)
+#define set_irg_end_except(irg, node)         _set_irg_end_except(irg, node)
 #define get_irg_frame(irg)                    _get_irg_frame(irg)
 #define set_irg_frame(irg, node)              _set_irg_frame(irg, node)
 #define get_irg_globals(irg)                  _get_irg_globals(irg)
@@ -512,7 +551,7 @@ get_idx_irn(ir_graph *irg, unsigned idx) {
 #define get_irg_bad(irg)                      _get_irg_bad(irg)
 #define set_irg_bad(irg, node)                _set_irg_bad(irg, node)
 #define get_irg_no_mem(irg)                   _get_irg_no_mem(irg)
-#define set_irg_no_mem(irg, node)             _set_irg_no_mem(irg, node)
+#define set_irn_no_mem(irg, node)             _set_irn_no_mem(irg, node)
 #define get_irg_current_block(irg)            _get_irg_current_block(irg)
 #define set_irg_current_block(irg, node)      _set_irg_current_block(irg, node)
 #define get_irg_entity(irg)                   _get_irg_entity(irg)
index cb3935c..3fc2fa9 100644 (file)
@@ -653,15 +653,12 @@ void irg_block_walk_graph(ir_graph *irg, irg_walk_func *pre,
  * Additionally walk over all anchors. Do NOT increase the visit flag.
  */
 void irg_walk_anchors(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env) {
-       int i;
        ir_graph * rem = current_ir_graph;
        current_ir_graph = irg;
 
-       for (i = 0; i < anchor_max; ++i) {
-               ir_node *anchor = irg->anchors[i];
+       inc_irg_visited(irg);
+       irg_walk_2(irg->anchor, pre, post, env);
 
-               irg_walk_2(anchor, pre, post, env);
-       }
        current_ir_graph = rem;
 }
 
@@ -694,7 +691,7 @@ static void walk_entity(ir_entity *ent, void *env)
 
 /* Walks over all code in const_code_irg. */
 void walk_const_code(irg_walk_func *pre, irg_walk_func *post, void *env) {
-       int i, j;
+       int i, j, n_types;
        walk_env my_env;
 
        ir_graph *rem = current_ir_graph;
@@ -707,16 +704,18 @@ void walk_const_code(irg_walk_func *pre, irg_walk_func *post, void *env) {
 
        /* Walk all types that can contain constant entities.  */
        walk_types_entities(get_glob_type(), &walk_entity, &my_env);
-       for (i = 0; i < get_irp_n_types(); i++)
+       n_types = get_irp_n_types();
+       for (i = 0; i < n_types; i++)
                walk_types_entities(get_irp_type(i), &walk_entity, &my_env);
        for (i = 0; i < get_irp_n_irgs(); i++)
                walk_types_entities(get_irg_frame_type(get_irp_irg(i)), &walk_entity, &my_env);
 
        /* Walk constant array bounds. */
-       for (i = 0; i < get_irp_n_types(); i++) {
+       for (i = 0; i < n_types; i++) {
                ir_type *tp = get_irp_type(i);
                if (is_Array_type(tp)) {
-                       for (j = 0; j < get_array_n_dimensions(tp); j++) {
+                       int n_dim = get_array_n_dimensions(tp);
+                       for (j = 0; j < n_dim; j++) {
                                ir_node *n = get_array_lower_bound(tp, j);
                                if (n) irg_walk(n, pre, post, env);
                                n = get_array_upper_bound(tp, j);
index 0a1d401..75fbced 100644 (file)
@@ -193,8 +193,8 @@ _get_irn_intra_n(const ir_node *node, int n) {
 
        nn = node->in[n + 1];
        if (nn == NULL) {
-               /* only block inputs are allowed to be NULL */
-               assert(n == -1 && "NULL input of a node");
+               /* only block and Anchor inputs are allowed to be NULL */
+               assert((node->op == op_Anchor || n == -1) && "NULL input of a node");
                return NULL;
        }
        if (nn->op != op_Id) return nn;
@@ -626,6 +626,11 @@ _is_ASM(const ir_node *node) {
        return (_get_irn_op(node) == op_ASM);
 }
 
+static INLINE int
+_is_Anchor(const ir_node *node) {
+       return (_get_irn_op(node) == op_Anchor);
+}
+
 static INLINE int
 _is_no_Block(const ir_node *node) {
        assert(node && _is_ir_node(node));
@@ -862,6 +867,7 @@ static INLINE void _set_irn_dbg_info(ir_node *n, dbg_info *db) {
 #define is_Jmp(node)                          _is_Jmp(node)
 #define is_Raise(node)                        _is_Raise(node)
 #define is_ASM(node)                          _is_ASM(node)
+#define is_Anchor(node)                       _is_Anchor(node)
 #define is_Bad(node)                          _is_Bad(node)
 #define is_NoMem(node)                        _is_NoMem(node)
 #define is_Start(node)                        _is_Start(node)
index 84c0690..e2c8620 100644 (file)
@@ -368,13 +368,13 @@ typedef struct _irg_edge_info_t {
 typedef irg_edge_info_t irg_edges_info_t[EDGE_KIND_LAST];
 
 /**
- * Index constants for nodes that can be accessed through the graph itself.
+ * Index constants for nodes that can be accessed through the graph anchor node.
  */
 enum irg_anchors {
-       anchor_start_block = 0,  /**< block the start node will belong to */
-       anchor_start,            /**< start node of this ir_graph */
-       anchor_end_block,        /**< block the end node will belong to */
+       anchor_end_block = 0,    /**< block the end node will belong to, same as Anchors block */
+       anchor_start_block,      /**< block the start node will belong to */
        anchor_end,              /**< end node of this ir_graph */
+       anchor_start,            /**< start node of this ir_graph */
        anchor_end_reg,          /**< end node of this ir_graph */
        anchor_end_except,       /**< end node of this ir_graph */
        anchor_frame,            /**< method's frame */
@@ -388,7 +388,7 @@ enum irg_anchors {
        anchor_bad,              /**< bad node of this ir_graph, the one and
                                      only in this graph */
        anchor_no_mem,           /**< NoMem node of this ir_graph, the one and only in this graph */
-       anchor_max
+       anchor_last
 };
 
 /** A callgraph entry for callees. */
@@ -409,7 +409,7 @@ struct ir_graph {
                                            class it belongs to. */
        ir_type *frame_type;           /**< A class type representing the stack frame.
                                            Can include "inner" methods. */
-       ir_node *anchors[anchor_max];  /**< List of anchor nodes. */
+       ir_node *anchor;               /**< The anchor node. */
        ir_node **proj_args;           /**< Projs of the methods arguments. */
        struct obstack *obst;          /**< The obstack where all of the ir_nodes live. */
        ir_node *current_block;        /**< Current block for newly gen_*()-erated ir_nodes. */
index a0bea16..31da296 100644 (file)
@@ -1816,7 +1816,7 @@ static int verify_node_Bound(ir_node *n, ir_graph *irg) {
  */
 static int check_dominance_for_node(ir_node *use) {
        /* This won't work for blocks and the end node */
-       if (!is_Block(use) && use != get_irg_end(current_ir_graph)) {
+       if (!is_Block(use) && use != get_irg_end(current_ir_graph) && use != current_ir_graph->anchor) {
                int i;
                ir_node *bl = get_nodes_block(use);
 
@@ -1931,8 +1931,9 @@ static void vrfy_wrap_ssa(ir_node *node, void *env) {
        int *res = env;
 
        *res = irn_vrfy(node);
-       if (*res)
+       if (*res) {
                *res = check_dominance_for_node(node);
+       }
 }
 
 #endif /* DEBUG_libfirm */
@@ -1956,7 +1957,7 @@ int irg_verify(ir_graph *irg, unsigned flags) {
        if (flags & VRFY_ENFORCE_SSA)
                compute_doms(irg);
 
-       irg_walk_graph(
+       irg_walk_anchors(
                irg,
                get_irg_dom_state(irg) == dom_consistent &&
                get_irg_pinned(irg) == op_pin_state_pinned ? vrfy_wrap_ssa : vrfy_wrap,
index b0402da..b3050a9 100644 (file)
@@ -355,9 +355,9 @@ int opt_tail_rec_irg(ir_graph *irg) {
                        continue;
 
                /*
-               * Check, that the types match. At least in C
-               * this might fail.
-               */
+                * Check, that the types match. At least in C
+                * this might fail.
+                */
                mtd_type  = get_entity_type(ent);
                call_type = get_Call_type(call);
 
@@ -372,7 +372,7 @@ int opt_tail_rec_irg(ir_graph *irg) {
                        dump_type(mtd_type);
                        dump_type(call_type);
 #endif
-                       return 0;
+                       continue;
                }
 
                /* here, we have found a call */