normalized names of functions, enums ...
authorBeyhan <beyhan@ipd.info.uni-karlsruhe.de>
Fri, 13 Aug 2004 08:58:00 +0000 (08:58 +0000)
committerBeyhan <beyhan@ipd.info.uni-karlsruhe.de>
Fri, 13 Aug 2004 08:58:00 +0000 (08:58 +0000)
added suffix as argument to dumpers, removed global variable
removed support for tarval/Const

[r3694]

83 files changed:
ir/ana/cgana.c
ir/ana/ircfscc.c
ir/ana/irdom.c
ir/ana/irdom.h
ir/ana/irouts.c
ir/ana/irouts.h
ir/ana/irscc.c
ir/ana/irsimpletype.c
ir/ana/rta.c
ir/common/firm.c
ir/common/firm.h
ir/common/firm_common.c
ir/common/firmwalk.c
ir/common/old_fctnames.h
ir/ident/ident.c
ir/ident/ident.h
ir/ident/ident_t.h
ir/ir/ircgcons.c
ir/ir/ircgopt.c
ir/ir/ircons.c
ir/ir/ircons.h
ir/ir/ircons_t.h
ir/ir/irdump.c
ir/ir/irdump.h
ir/ir/irflag.h
ir/ir/irgmod.c
ir/ir/irgopt.c
ir/ir/irgopt.h
ir/ir/irgraph.c
ir/ir/irgraph.h
ir/ir/irgraph_t.h
ir/ir/irgwalk.c
ir/ir/irmode.c
ir/ir/irmode.h
ir/ir/irmode_t.h
ir/ir/irnode.c
ir/ir/irnode.h
ir/ir/irnode_t.h
ir/ir/irop.c
ir/ir/irop.h
ir/ir/irop_t.h
ir/ir/iropt.c
ir/ir/irprog.c
ir/ir/irprog.h
ir/ir/irprog_t.h
ir/ir/irvrfy.c
ir/ir/irvrfy.h
ir/opt/tailrec.c
ir/st/st.c
ir/stat/firmstat.c
ir/stat/firmstat.h
ir/tr/entity.c
ir/tr/mangle.c
ir/tr/tpop.c
ir/tr/type.c
ir/tr/typewalk.c
ir/tv/tv.c
ir/tv/tv.h
testprograms/array-heap_example.c
testprograms/array-stack_example.c
testprograms/call_str_example.c
testprograms/cond_example.c
testprograms/const_ent_example.c
testprograms/const_eval_example.c
testprograms/dead_block_example.c
testprograms/empty.c
testprograms/endless_loop.c
testprograms/float_example.c
testprograms/global_cse.c
testprograms/global_var_example.c
testprograms/identify_types.c
testprograms/if_else_example.c
testprograms/if_example.c
testprograms/if_while_example.c
testprograms/inheritance_example.c
testprograms/irr_cf_example.c
testprograms/irr_loop_example.c
testprograms/memory_example.c
testprograms/oo_inline_example.c
testprograms/oo_program_example.c
testprograms/recursions.c
testprograms/three_cfpred_example.c
testprograms/while_example.c

index 21b70e0..7755f59 100644 (file)
@@ -80,10 +80,7 @@ static entity *get_inherited_methods_implementation(entity *inh_meth) {
   entity *impl_meth = NULL;
   ir_node *addr = get_atomic_ent_value(inh_meth);
   assert(addr && "constant entity without value");
-
-  if (get_irn_op(addr) == op_Const) {
-    impl_meth = get_tarval_entity(get_Const_tarval(addr));
-  } else if ((get_irn_op(addr) == op_SymConst) &&
+  if ((get_irn_op(addr) == op_SymConst) &&
             (get_SymConst_kind(addr) == symconst_addr_ent)) {
     impl_meth = get_SymConst_entity(addr);
   } else {
@@ -232,7 +229,7 @@ static void sel_methods_walker(ir_node * node, pmap * ldname_map) {
       symconst_symbol sym;
       assert(get_entity_irg(ent));
       sym.entity_p = ent;
-      set_irg_current_block(current_ir_graph, get_nodes_Block(node));
+      set_irg_current_block(current_ir_graph, get_nodes_block(node));
       new_node = new_d_SymConst(get_irn_dbg_info(node), sym, symconst_addr_ent);       DBG_OPT_NORMALIZE;
       DDMN(new_node);
       exchange(node, new_node);
@@ -249,14 +246,14 @@ static void sel_methods_walker(ir_node * node, pmap * ldname_map) {
       /* We know which method will be called, no dispatch necessary. */
 #if 0
       assert(get_entity_peculiarity(ent) != peculiarity_description);
-      set_irg_current_block(current_ir_graph, get_nodes_Block(node));
+      set_irg_current_block(current_ir_graph, get_nodes_block(node));
       /* @@@ Is this correct?? Alloc could reference a subtype of the owner
          of Sel that overwrites the method referenced in Sel. */
       /* @@@ Yes, this is wrong. GL, 10.3.04 */
       new_node = copy_const_value(get_atomic_ent_value(ent));              DBG_OPT_POLY_ALLOC;
 #else
       called_ent = resolve_ent_polymorphy(get_Alloc_type(skip_Proj(get_Sel_ptr(node))), ent);
-      set_irg_current_block(current_ir_graph, get_nodes_Block(node));
+      set_irg_current_block(current_ir_graph, get_nodes_block(node));
       /* called_ent may not be description: has no Address/Const to Call! */
       assert(get_entity_peculiarity(called_ent) != peculiarity_description);
       new_node = copy_const_value(get_atomic_ent_value(called_ent));       DBG_OPT_POLY_ALLOC;
@@ -281,8 +278,8 @@ static void sel_methods_walker(ir_node * node, pmap * ldname_map) {
           /* @@@ GL Methode um Fehler anzuzeigen aufrufen! */
           printf("WARNING: Calling method description %s\n  in method %s\n  of class %s\n  which has "
                  "no implementation!\n", get_entity_name(ent),
-                 get_entity_name(get_irg_ent(current_ir_graph)),
-                 get_type_name(get_entity_owner(get_irg_ent(current_ir_graph))));
+                 get_entity_name(get_irg_entity(current_ir_graph)),
+                 get_type_name(get_entity_owner(get_irg_entity(current_ir_graph))));
           printf("This happens when compiling a Java Interface that's never really used, i.e., "
                  "no class implementing the interface is ever used.\n");
         } else {
@@ -294,7 +291,7 @@ static void sel_methods_walker(ir_node * node, pmap * ldname_map) {
 #if 0
         int i;
         printf("\nCall site "); DDMN(node);
-        printf("  in "); DDME(get_irg_ent(current_ir_graph));
+        printf("  in "); DDME(get_irg_entity(current_ir_graph));
         printf("  can call:\n");
         for (i = 0; i < ARR_LEN(arr); i++) {
           printf("   - "); DDME(arr[i]);
@@ -310,7 +307,7 @@ static void sel_methods_walker(ir_node * node, pmap * ldname_map) {
            * interne Methode zurückgeben. Wir können daher die
            * Sel-Operation durch eine Const- bzw. SymConst-Operation
            * ersetzen. */
-          set_irg_current_block(current_ir_graph, get_nodes_Block(node));
+          set_irg_current_block(current_ir_graph, get_nodes_block(node));
           /* assert(get_entity_peculiarity(tarval_to_entity(get_Const_tarval(get_atomic_ent_value(arr[0])))) == peculiarity_existent); */
           new_node = copy_const_value(get_atomic_ent_value(arr[0]));         DBG_OPT_POLY;
           exchange (node, new_node);
@@ -330,7 +327,7 @@ static void sel_methods_init(void) {
   assert(entities == NULL);
   entities = eset_create();
   for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
-    entity * ent = get_irg_ent(get_irp_irg(i));
+    entity * ent = get_irg_entity(get_irp_irg(i));
     /* Nur extern sichtbare Methode können Ã¼berhaupt mit SymConst
      * aufgerufen werden. */
     if (get_entity_visibility(ent) != visibility_local) {
@@ -471,23 +468,6 @@ static void callee_ana_node(ir_node * node, eset * methods) {
       eset_insert(methods, MARK); /* free method -> unknown */
     }
     break;
-
-  case iro_Const: {
-    /* interne Methode */
-    entity * ent = get_tarval_entity(get_Const_tarval(node));
-    assert(ent && is_method_type(get_entity_type(ent)));
-    if (get_entity_visibility(ent) != visibility_external_allocated) {
-      if (!get_entity_irg(ent)) {
-    dump_entity(ent);
-    assert(get_entity_irg(ent));
-      }
-      eset_insert(methods, ent);
-    } else {
-      eset_insert(methods, MARK); /* free method -> unknown */
-    }
-    break;
-  }
-
   case iro_Sel:
     /* polymorphe Methode */
     for (i = get_Sel_n_methods(node) - 1; i >= 0; --i) {
@@ -539,7 +519,7 @@ static void callee_walker(ir_node * call, void * env) {
     eset * methods = eset_create();
     entity * ent;
     entity ** arr = NEW_ARR_F(entity *, 0);
-    callee_ana_node(skip_nop(get_Call_ptr(call)), methods);
+    callee_ana_node(skip_Id(get_Call_ptr(call)), methods);
     if (eset_contains(methods, MARK)) { /* unknown method */
       ARR_APP1(entity *, arr, NULL);
     }
@@ -665,16 +645,7 @@ static void free_mark(ir_node * node, eset * set) {
       /* nothing: SymConst points to extern method */
     }
     break;
-  case iro_Const: {
-    tarval * val = get_Const_tarval(node);
-    if (tarval_is_entity(val)) { /* filter null pointer */
-      entity * ent = get_tarval_entity(val);
-      if (is_method_type(get_entity_type(ent))) {
-        eset_insert(set, ent);
-      }
-    }
-    break;
-  }
+
   case iro_Phi:
     for (i = get_Phi_n_preds(node) - 1; i >= 0; --i) {
       free_mark(get_Phi_pred(node, i), set);
@@ -753,7 +724,7 @@ static entity ** get_free_methods(int whole)
   if (! whole) {
     for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
       ir_graph * irg = get_irp_irg(i);
-      entity * ent = get_irg_ent(irg);
+      entity * ent = get_irg_entity(irg);
       /* insert "external visible" methods. */
       if (get_entity_visibility(ent) != visibility_local) {
         eset_insert(set, ent);
@@ -767,7 +738,7 @@ static entity ** get_free_methods(int whole)
   /* insert sticky methods, too */
   for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
     ir_graph * irg = get_irp_irg(i);
-    entity * ent = get_irg_ent(irg);
+    entity * ent = get_irg_entity(irg);
     /* insert "external visible" methods. */
     if (get_entity_stickyness (ent) == stickyness_sticky) {
       eset_insert(set, ent);
@@ -777,7 +748,7 @@ static entity ** get_free_methods(int whole)
   /* Hauptprogramm ist auch dann frei, wenn es nicht "external
    * visible" ist. */
   if (get_irp_main_irg()) {
-    eset_insert(set, get_irg_ent(get_irp_main_irg()));
+    eset_insert(set, get_irg_entity(get_irp_main_irg()));
   }
   /* Wandle Menge in Feld um.  Effizienter. */
   for (ent = eset_first(set); ent; ent = eset_next(set)) {
@@ -842,7 +813,7 @@ void opt_call_addrs(void) {
   assert(entities == NULL);
   entities = eset_create();
   for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
-    entity * ent = get_irg_ent(get_irp_irg(i));
+    entity * ent = get_irg_entity(get_irp_irg(i));
     /* Nur extern sichtbare Methoden können Ã¼berhaupt mit SymConst
      * aufgerufen werden. */
     if (get_entity_visibility(ent) != local) {
index d986b42..bc1d712 100644 (file)
@@ -274,7 +274,7 @@ static bool is_outermost_StartBlock(ir_node *n) {
   assert(is_Block(n));
   if ((get_Block_n_cfgpreds(n) == 1)  &&
       (get_irn_op(skip_Proj(get_Block_cfgpred(n, 0))) == op_Start) &&
-      (get_nodes_Block(skip_Proj(get_Block_cfgpred(n, 0))) == n)) {
+      (get_nodes_block(skip_Proj(get_Block_cfgpred(n, 0))) == n)) {
     return true;
   }
   return false;
index 9002334..1bc8e47 100644 (file)
@@ -215,7 +215,7 @@ void compute_doms(ir_graph *irg) {
     /* Step 2 */
     irn_arity = get_irn_arity(w->block);
     for (j = 0;  j < irn_arity;  j++) {
-      ir_node *pred = get_nodes_Block(get_Block_cfgpred(w->block, j));
+      ir_node *pred = get_nodes_block(get_Block_cfgpred(w->block, j));
       tmp_dom_info *u;
 
       if ((is_Bad(get_Block_cfgpred(w->block, j))) ||
@@ -267,7 +267,7 @@ void compute_doms(ir_graph *irg) {
 void free_dom_and_peace(ir_graph *irg) {
   /* Update graph state */
   assert(get_irg_phase_state(current_ir_graph) != phase_building);
-  current_ir_graph->dom_state = no_dom;
+  current_ir_graph->dom_state = dom_none;
 
   /* With the implementation right now there is nothing to free,
      but better call it anyways... */
index 73db60b..dddfddd 100644 (file)
@@ -65,7 +65,7 @@ void set_Block_pre_num(ir_node *bl, int num);
  */
 void compute_doms(ir_graph *irg);
 
-/** Frees the dominator datastructures.  Sets the flag in irg to "no_dom". */
+/** Frees the dominator datastructures.  Sets the flag in irg to "dom_none". */
 void free_dom_and_peace(ir_graph *irg);
 
 #endif /* _IRDOM_H_ */
index 10e07e0..a4b01cd 100644 (file)
@@ -139,7 +139,7 @@ void irg_out_walk(ir_node *node,
             irg_walk_func *pre, irg_walk_func *post,
             void *env) {
   assert(node);
-  if (get_irg_outs_state(current_ir_graph) != no_outs) {
+  if (get_irg_outs_state(current_ir_graph) != outs_none) {
     inc_irg_visited (current_ir_graph);
     irg_out_walk_2(node, pre, post, env);
   }
@@ -290,7 +290,7 @@ void compute_outs(ir_graph *irg) {
 
   /* Update graph state */
   assert(get_irg_phase_state(current_ir_graph) != phase_building);
-  if (current_ir_graph->outs_state != no_outs) free_outs(current_ir_graph);
+  if (current_ir_graph->outs_state != outs_none) free_outs(current_ir_graph);
   current_ir_graph->outs_state = outs_consistent;
 
   /* This first iteration counts the overall number of out edges and the
@@ -453,7 +453,7 @@ void compute_ip_outs(void) {
   assert(get_irp_ip_view_state() == ip_view_valid &&
      "Cannot construct outs for invalid ip view.");
 
-  if (irp->outs_state != no_outs) {
+  if (irp->outs_state != outs_none) {
     free_ip_outs();
   }
 
@@ -470,14 +470,14 @@ void free_ip_outs(void)
     free(out_edges);
     set_irp_ip_outedges(NULL);
   }
-  irp->outs_state = no_outs;
+  irp->outs_state = outs_none;
 }
 
 
 void free_outs(ir_graph *irg) {
 
-  /*   current_ir_graph->outs_state = no_outs; */
-  irg->outs_state = no_outs;
+  /*   current_ir_graph->outs_state = outs_none; */
+  irg->outs_state = outs_none;
 
   if (irg->outs) {
 #ifdef DEBUG_libfirm
index 11eceb1..6ec3cde 100644 (file)
@@ -36,7 +36,7 @@
 
 /** To iterate through the successors iterate from 0 to i < get_irn_outs(). No
    order of successors guaranteed.  Will return edges from block to floating
-   nodes even if irgraph is in state "floats". */
+   nodes even if irgraph is in state "op_pin_state_floats". */
 /* returns the number of successors of the node: */
 int             get_irn_n_outs (ir_node *node);
 
@@ -79,11 +79,11 @@ void irg_out_block_walk(ir_node *node,
 /** Computes the out edges.  Sets a flag in irg to "outs_consistent".  If the
    graph is changed this flag must be set to "outs_inconsistent".  Computes
    out edges from block to floating nodes even if graph is in state
-   "floats".   Optimizes Tuple nodes. */
+   "op_pin_state_floats".   Optimizes Tuple nodes. */
 void compute_outs(ir_graph *irg);
 /** Computes the out edges in interprocedural view */
 void compute_ip_outs(void);
-/** Frees the out datastructures.  Sets the flag in irg to "no_outs". */
+/** Frees the out datastructures.  Sets the flag in irg to "outs_none". */
 void free_ip_outs(void);
 void free_outs(ir_graph *irg);
 
index fce58c9..dd59101 100644 (file)
@@ -522,7 +522,7 @@ init_node (ir_node *n, void *env) {
     (get_irn_op(cb) == op_EndReg) ||
     (get_irn_op(cb) == op_EndExcept)) {
       init_node(cb, NULL);
-      init_node(get_nodes_Block(cb), NULL);
+      init_node(get_nodes_block(cb), NULL);
     }
   }
 #endif
@@ -561,7 +561,7 @@ static bool is_outermost_Start(ir_node *n) {
   if ((get_irn_op(n) == op_Block)     &&
       (get_Block_n_cfgpreds(n) == 1)  &&
       (get_irn_op(skip_Proj(get_Block_cfgpred(n, 0))) == op_Start) &&
-      (get_nodes_Block(skip_Proj(get_Block_cfgpred(n, 0))) == n)) {
+      (get_nodes_block(skip_Proj(get_Block_cfgpred(n, 0))) == n)) {
     return true;
   }
 #if 0
@@ -595,8 +595,8 @@ get_start_index(ir_node *n) {
   if (get_irn_op(n) == op_Phi   ||
       get_irn_op(n) == op_Block ||
       (get_irn_op(n) == op_Filter && interprocedural_view) ||
-      (get_irg_pinned(get_irn_irg(n)) == floats &&
-       get_op_pinned(get_irn_op(n)) == floats))
+      (get_irg_pinned(get_irn_irg(n)) == op_pin_state_floats &&
+       get_op_pinned(get_irn_op(n)) == op_pin_state_floats))
     // Here we could test for backedge at -1 which is illegal
     return 0;
   else
@@ -1185,7 +1185,7 @@ void construct_ip_backedges (void) {
     /* Find real entry points */
     sb = get_irg_start_block(current_ir_graph);
     if ((get_Block_n_cfgpreds(sb) > 1) ||
-    (get_nodes_Block(get_Block_cfgpred(sb, 0)) != sb)) continue;
+    (get_nodes_block(get_Block_cfgpred(sb, 0)) != sb)) continue;
     /* Compute scc for this graph */
     outermost_ir_graph = current_ir_graph;
     set_irg_visited(outermost_ir_graph, get_max_irg_visited());
index 82ade35..1e7f93a 100644 (file)
@@ -77,7 +77,7 @@ static type *find_type_for_Proj(ir_node *n) {
     assert(get_irn_mode(pred) == mode_T);
     pred_pred = get_Proj_pred(pred);
     if (get_irn_op(pred_pred) == op_Start)  {
-      type *mtp = get_entity_type(get_irg_ent(get_Start_irg(pred_pred)));
+      type *mtp = get_entity_type(get_irg_entity(get_irn_irg(pred_pred)));
       tp = get_method_param_type(mtp, get_Proj_proj(n));
     } else if (get_irn_op(pred_pred) == op_Call) {
       type *mtp = get_Call_type(pred_pred);
@@ -89,13 +89,13 @@ static type *find_type_for_Proj(ir_node *n) {
   } break;
   case iro_Start: {
     /* globals and frame pointer */
-    if (get_Proj_proj(n) == pns_frame_base)
-      tp = find_pointer_type_to(get_irg_frame_type(get_Start_irg(pred)));
-    else if (get_Proj_proj(n) == pns_globals)
+    if (get_Proj_proj(n) ==  pn_Start_P_frame_base)
+      tp = find_pointer_type_to(get_irg_frame_type(get_irn_irg(pred)));
+    else if (get_Proj_proj(n) == pn_Start_P_globals)
       tp = find_pointer_type_to(get_glob_type());
-    else  if (get_Proj_proj(n) == pns_value_arg_base) {
+    else  if (get_Proj_proj(n) == pn_Start_P_value_arg_base) {
       VERBOSE_UNKNOWN_TYPE(("Value arg base proj %ld from Start: unknown type\n", get_irn_node_nr(n)));
-      tp =  unknown_type; /* find_pointer_type_to(get....(get_entity_type(get_irg_ent(get_Start_irg(pred))))); */
+      tp =  unknown_type; /* find_pointer_type_to(get....(get_entity_type(get_irg_entity(get_irn_irg(pred))))); */
     } else {
       VERBOSE_UNKNOWN_TYPE(("Proj %ld %ld from Start: unknown type\n", get_Proj_proj(n), get_irn_node_nr(n)));
       tp = unknown_type;
@@ -103,7 +103,7 @@ static type *find_type_for_Proj(ir_node *n) {
   } break;
   case iro_Call: {
     /* value args pointer */
-    if (get_Proj_proj(n) == pncl_value_res_base) {
+    if (get_Proj_proj(n) == pn_Call_P_value_res_base) {
       VERBOSE_UNKNOWN_TYPE(("Value res base Proj %ld from Call: unknown type\n", get_irn_node_nr(n)));
       tp = unknown_type; /* find_pointer_type_to(get....get_Call_type(pred)); */
     } else {
@@ -147,7 +147,7 @@ static type *find_type_for_node(ir_node *n) {
     /* Check returned type. */
     /*
     int i;
-    type *meth_type = get_entity_type(get_irg_ent(current_ir_graph));
+    type *meth_type = get_entity_type(get_irg_entity(current_ir_graph));
     for (i = 0; i < get_method_n_ress(meth_type); i++) {
       type *res_type = get_method_res_type(meth_type, i);
       type *ana_res_type = get_irn_type(get_Return_res(n, i));
@@ -232,9 +232,6 @@ static type *find_type_for_node(ir_node *n) {
     ir_node *a = get_Load_ptr(n);
     if (get_irn_op(a) == op_Sel)
       tp = get_entity_type(get_Sel_entity(a));
-    else if ((get_irn_op(a) == op_Const) &&
-    (tarval_is_entity(get_Const_tarval(a))))
-      tp = get_entity_type(get_tarval_entity(get_Const_tarval(a)));
     else if (is_pointer_type(compute_irn_type(a))) {
       tp = get_pointer_points_to_type(get_irn_type(a));
       if (is_array_type(tp)) tp = get_array_element_type(tp);
index 3728f80..1382439 100644 (file)
@@ -76,7 +76,7 @@ static int add_graph (ir_graph *graph)
   if (!eset_contains (_live_graphs, graph)) {
     if (verbose > 1) {
       fprintf(stdout, "RTA:        new graph of ");
-      DDMEO(get_irg_ent (graph));
+      DDMEO(get_irg_entity (graph));
     }
 
     eset_insert (_live_graphs, graph);
@@ -156,15 +156,6 @@ static void rta_act (ir_node *node, void *env)
     if (iro_Sel == get_irn_opcode (ptr)) { /* CALL SEL */
       ent = get_Sel_entity (ptr);
       *change = add_implementing_graphs (ent);
-    } else if (iro_Const == get_irn_opcode (ptr)) { /* CALL CONST */
-      ent = get_tarval_entity (get_Const_tarval (ptr));
-      ir_graph *graph = get_entity_irg (ent);
-      /* don't use get_implementing_graph on a Const! */
-      if (graph) {
-        *change = add_graph (graph);
-      } else {
-        /* it's an external allocated thing. */
-      }
     } else if (iro_SymConst == get_irn_opcode (ptr)) { /* CALL SYMCONST */
       if (get_SymConst_kind(ptr) == symconst_addr_ent) {
        ent = get_SymConst_entity (ptr);
@@ -258,7 +249,7 @@ static int rta_fill_incremental (void)
 
       if (verbose > 1) {
         fprintf(stdout, "RTA: RUN %i: considering graph of ", n_runs);
-        DDMEO(get_irg_ent (graph));
+        DDMEO(get_irg_entity (graph));
       }
 
       rerun |= rta_fill_graph (graph);
@@ -342,7 +333,7 @@ static void remove_irg (ir_graph *graph)
   entity *ent = get_irg_entity (graph);
   peculiarity pec = get_entity_peculiarity (ent);
 
-  /*   DDMEO (get_irg_ent(graph)); */
+  /*   DDMEO (get_irg_entity(graph)); */
 
   /* delete the ir_graph data */
   set_entity_peculiarity (ent, peculiarity_description);
@@ -366,7 +357,7 @@ static void remove_irg (ir_graph *graph)
     set_entity_peculiarity (ent, peculiarity_inherited);
 
     exchange (get_atomic_ent_value (ent),
-              get_atomic_ent_value (get_irg_ent(graph)));
+              get_atomic_ent_value (get_irg_entity(graph)));
   }
 }
 
@@ -472,7 +463,7 @@ void rta_delete_dead_graphs (void)
 
     if ((verbose > 1) || get_opt_dead_method_elimination_verbose ()) {
       fprintf(stdout, "RTA: removing graph of ");
-      DDMEO(get_irg_ent (graph));
+      DDMEO(get_irg_entity (graph));
     }
 
     remove_irg (graph);
@@ -536,7 +527,7 @@ void rta_report (void)
   for (i = 0; i < get_irp_n_irgs(); i++) {
     if (rta_is_alive_graph (get_irp_irg(i))) {
       fprintf(stdout, "RTA: considered called: graph of ");
-      DDMEO(get_irg_ent (get_irp_irg(i)));
+      DDMEO(get_irg_entity (get_irp_irg(i)));
     }
   }
 }
@@ -544,6 +535,11 @@ void rta_report (void)
 
 /*
  * $Log$
+ * Revision 1.22  2004/08/13 08:57:15  beyhan
+ * normalized names of functions, enums ...
+ * added suffix as argument to dumpers, removed global variable
+ * removed support for tarval/Const
+ *
  * Revision 1.21  2004/07/08 15:50:56  goetz
  * firmstat added
  *
index e87c9cd..4c52d94 100644 (file)
@@ -48,9 +48,9 @@ init_firm(const firm_parameter_t *param)
   }
 
   /* initialize all ident stuff */
-  id_init(1024);
+  init_ident (1024);
   /* enhanced statistics, need idents */
-  stat_init(def_params.enable_statistics);
+  init_stat();
   /* create the type kinds. */
   init_tpop();
   /* create an obstack and put all tarvals in a pdeq */
@@ -95,5 +95,5 @@ void free_firm(void) {
   finish_op();
   finish_mode();
   finish_tpop();
-  id_finish();
+  finish_ident();
 }
index d4ac3ad..3fd1563 100644 (file)
@@ -69,7 +69,8 @@
 extern "C" {
 #endif
 
-#include "old_fctnames.h"
+//  #include "old_fctnames.h"
+
 
 /* The representations */
 #include "firm_common.h"   /* common type tags. */
index 6922cef..2a79301 100644 (file)
@@ -73,7 +73,7 @@ void firm_identify_thing(void *X)
     printf("type: %s %s: %ld (%p)\n", get_type_tpop_name(X), get_type_name(X), get_type_nr(X), X);
     break;
   case k_ir_graph:
-    printf("graph: %s: %ld (%p)\n", get_entity_name(get_irg_ent(X)), get_irg_graph_nr(X), X);
+    printf("graph: %s: %ld (%p)\n", get_entity_name(get_irg_entity(X)), get_irg_graph_nr(X), X);
     break;
   case k_ir_node:
     printf("irnode: %s%s %ld (%p)\n", get_irn_opname(X), get_mode_name(get_irn_mode(X)), get_irn_node_nr(X), X);
index 468fb3b..efb05ad 100644 (file)
@@ -283,7 +283,7 @@ void fw_collect_irn(ir_node *irn, void *env)
   else
   {
     /* add this node to block's node list */
-    ir_node *block = get_nodes_Block(irn);
+    ir_node *block = get_nodes_block(irn);
     data = fw_get_data(block);
     ARR_APP1(ir_node *, FW_GET_DATA_LIST(data), irn);
   }
index 5f75ea0..8809c41 100644 (file)
 #ifndef __OLD_FCTNAMES_H__
 #define __OLD_FCTNAMES_H__
 
+/* firmstat */
+#define stat_init init_stat
+
+/* ircons */
+#define add_in_edge(X, Y)     add_immBlock_pred(X, Y)
+#define mature_block(X)              mature_immBlock(X)
+#define switch_block(X)              set_cur_block(X)
+
+
 /* irgraph */
-#define get_irg_params     get_irg_n_locs
-#define get_irg_n_loc      get_irg_n_locs
-#define set_irg_params     set_irg_n_loc
+#define get_irg_ent(X)        get_irg_entity(X)
+#define get_irg_params        get_irg_n_locs
+#define get_irg_n_loc         get_irg_n_locs
+#define set_irg_ent(X, Y)     set_irg_entity(X, Y)
+#define set_irg_params        set_irg_n_loc
+#define no_dom                dom_none
+#define no_outs               outs_none
 
 /* irnode.h */
-#define get_Return_n_res     get_Return_n_ress
-#define get_Sel_n_index      get_Sel_n_indexs
-#define get_SymConst_ptrinfo get_SymConst_name
-#define set_SymConst_ptrinfo set_SymConst_name
+#define get_Return_n_res      get_Return_n_ress
+#define get_Sel_n_index       get_Sel_n_indexs
+#define get_SymConst_ptrinfo  get_SymConst_name
+#define set_SymConst_ptrinfo  set_SymConst_name
+#define get_nodes_Block(X)    get_nodes_block(X)
+#define set_nodes_Block(X, Y) set_nodes_block(X, Y)
+#define get_Start_irg(X)      get_irn_irg(X)
+#define get_EndReg_irg(X)     get_irn_irg(X)
+#define get_EndExcept_irg(X)  get_irn_irg(X)
+#define get_CallBegin_irg(X)  get_irn_irg(X)
+#define get_ip_cfop_irg(X)    get_irn_irg(X)
+#define skip_nop(X)           skip_Id(X)
+
 
 /* irmode.h */
-#define get_ident_of_mode     get_mode_ident
-#define get_size_of_mode      get_mode_size
-#define get_ld_align_of_mode  get_mode_ld_align
-#define get_min_of_mode       get_mode_min
-#define get_max_of_mode       get_mode_max
-#define get_null_of_mode      get_mode_null
-#define get_fsigned_of_mode   get_mode_fsigned
-#define get_ffloat_of_mode    get_mode_ffloat
-#define get_mode_size(X)      { assert(get_mode_size_bytes(X) != -1); get_mode_size_bytes(X); }
+#define get_ident_of_mode        get_mode_ident
+#define get_size_of_mode         get_mode_size
+#define get_ld_align_of_mode     get_mode_ld_align
+#define get_min_of_mode          get_mode_min
+#define get_max_of_mode          get_mode_max
+#define get_mode_vector_elems(X) get_mode_n_vector_elems(X)
+#define get_null_of_mode         get_mode_null
+#define get_fsigned_of_mode      get_mode_fsigned
+#define get_ffloat_of_mode       get_mode_ffloat
+#define get_mode_size(X)         { assert(get_mode_size_bytes(X) != -1); get_mode_size_bytes(X); }
+
+
+/* irop */
+#define floats                   op_pin_state_floats
+#define pinned                  op_pin_state_pinned
+#define op_pinned               op_pin_state
 
 /* type.h */
 #define get_type_nameid(_t_)     get_type_ident(_t_)
 #define tarval_from_long(X, Y) new_tarval_from_long(Y, X)
 #define tarval_P_from_entity(X) new_tarval_from_entity(X, mode_P_mach)
 #define tarval_to_entity(X) get_tarval_entity(X)
-
+#define tarval_to_long(X) get_tarval_long(X)
+#define tarval_to_double(X) get_tarval_double(X)
+#define tarval_set_mode_output_option(X, Y) set_tarval_mode_output_option(X, Y)
+#define tarval_get_mode_output_option(X) get_tarval_mode_output_option(X)
+#define tarval_bitpattern(X) get_tarval_bitpattern(X)
+#define tarval_sub_bits(X, Y) get_tarval_sub_bits(X, Y)
+#define tarval_classify(X) classify_tarval(X)
 
 /* ident.h */
-#define id_to_strlen get_id_strlen
-#define id_to_str    get_id_str
-
+#define id_to_strlen(X) get_id_strlen(X)
+#define id_to_str(X)    get_id_str(X)
 #endif
index 5d63240..19d9aab 100644 (file)
 
 set *__id_set;
 
-void id_init(int initial_n_idents)
+void init_ident(int initial_n_idents)
 {
   __id_set = new_set(memcmp, initial_n_idents);
 }
 
-void id_finish (void) {
+void finish_ident (void) {
   del_set(__id_set);
   __id_set = NULL;
 }
 
-ident *(id_from_str)(const char *str, int len)
+ident *(new_id_from_chars)(const char *str, int len)
 {
   return __id_from_str(str, len);
 }
@@ -42,7 +42,7 @@ ident *(id_from_str)(const char *str, int len)
 ident *new_id_from_str(const char *str)
 {
   assert(str);
-  return id_from_str(str, strlen(str));
+  return new_id_from_chars(str, strlen(str));
 }
 
 const char *(get_id_str)(ident *id)
index 621d3ef..5e7a7c8 100644 (file)
@@ -62,7 +62,7 @@ ident *new_id_from_str (const char *str);
  *
  * @see new_id_from_str(), get_id_strlen()
  */
-ident *id_from_str (const char *str, int len);
+ident *new_id_from_chars (const char *str, int len);
 
 /**
  * Returns a string represented by an ident.
@@ -74,7 +74,7 @@ ident *id_from_str (const char *str, int len);
  *
  * @return cp - a string
  *
- * @see new_id_from_str(), id_from_str(), get_id_strlen()
+ * @see new_id_from_str(), new_id_from_chars(), get_id_strlen()
  */
 const char *get_id_str  (ident *id);
 
@@ -85,7 +85,7 @@ const char *get_id_str  (ident *id);
  *
  * @return len - the length of the string
  *
- * @see new_id_from_str(), id_from_str(), get_id_str()
+ * @see new_id_from_str(), new_id_from_chars(), get_id_str()
  */
 int  get_id_strlen(ident *id);
 /**
@@ -94,7 +94,7 @@ int  get_id_strlen(ident *id);
  * @param prefix - the prefix
  * @param id     - the ident
  *
- * @see new_id_from_str(), id_from_str(), get_id_str(), id_is_prefix()
+ * @see new_id_from_str(), new_id_from_chars(), get_id_str(), id_is_prefix()
  */
 int id_is_prefix (ident *prefix, ident *id);
 
@@ -104,7 +104,7 @@ int id_is_prefix (ident *prefix, ident *id);
  * @param suffix - the suffix
  * @param id     - the ident
  *
- * @see new_id_from_str(), id_from_str(), get_id_str(), id_is_prefix()
+ * @see new_id_from_str(), new_id_from_chars(), get_id_str(), id_is_prefix()
  */
 int id_is_suffix (ident *suffix, ident *id);
 
@@ -114,7 +114,7 @@ int id_is_suffix (ident *suffix, ident *id);
  * @param infix  - the infix
  * @param id     - the ident to search in
  *
- * @see new_id_from_str(), id_from_str(), get_id_str(), id_is_prefix()
+ * @see new_id_from_str(), new_id_from_chars(), get_id_str(), id_is_prefix()
  */
 /* int id_contains(ident *infix, ident *id); */
 
@@ -124,7 +124,7 @@ int id_is_suffix (ident *suffix, ident *id);
  * @param id     - the ident
  * @param c      - the character
  *
- * @see new_id_from_str(), id_from_str(), get_id_str()
+ * @see new_id_from_str(), new_id_from_chars(), get_id_str()
  */
 int id_contains_char (ident *id, char c);
 
@@ -136,7 +136,7 @@ int id_contains_char (ident *id, char c);
  * @return
  *    number of bytes written
  *
- * @see new_id_from_str(), id_from_str(), get_id_str(), id_is_prefix(), fprint_id()
+ * @see new_id_from_str(), new_id_from_chars(), get_id_str(), id_is_prefix(), fprint_id()
  */
 int print_id (ident *id);
 
@@ -149,7 +149,7 @@ int print_id (ident *id);
  * @return
  *    number of btes written
  *
- * @see new_id_from_str(), id_from_str(), get_id_str(), id_is_prefix(), print_id()
+ * @see new_id_from_str(), new_id_from_chars(), get_id_str(), id_is_prefix(), print_id()
  */
 int fprint_id (FILE *F, ident *id);
 
index ae48cd9..fd18d85 100644 (file)
@@ -16,8 +16,8 @@
 # include "ident.h"
 # include "set.h"
 
-void id_init (int initial_n_idents);
-void id_finish (void);
+void init_ident (int initial_n_idents);
+void finish_ident (void);
 
 #define ID_HASH(str, len) \
   (((  ((unsigned char *)(str))[0] * 33 \
@@ -43,7 +43,7 @@ static INLINE const char * __get_id_str(ident *id) { return (const char *)id->dp
 static INLINE int __get_id_strlen(ident *id) { return id->size; }
 
 
-#define id_from_str(str, len)    __id_from_str(str, len)
+#define new_id_from_chars(str, len)    __id_from_str(str, len)
 #define get_id_str(id)           __get_id_str(id)
 #define get_id_strlen(id)        __get_id_strlen(id)
 
index e85fe02..3e0f65c 100644 (file)
@@ -65,7 +65,7 @@ static irg_data_t * irg_data_create(void) {
 static void caller_init(int arr_length, entity ** free_methods) {
   int i, j;
   for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
-    set_entity_link(get_irg_ent(get_irp_irg(i)), irg_data_create());
+    set_entity_link(get_irg_entity(get_irp_irg(i)), irg_data_create());
   }
   for (i = arr_length - 1; i >= 0; --i) {
     irg_data_t * data = get_entity_link(free_methods[i]);
@@ -125,7 +125,7 @@ static void collect_phicallproj_walker(ir_node * node, ir_node ** call_tail) {
       *call_tail = node;
     }
   } else if (get_irn_op(node) == op_Phi) {
-    ir_node * block = get_nodes_Block(node);
+    ir_node * block = get_nodes_block(node);
     set_irn_link(node, get_irn_link(block));
     set_irn_link(block, node);
   }
@@ -171,7 +171,7 @@ static ir_node * exchange_proj(ir_node * proj) {
   filter = new_Filter(get_Proj_pred(proj), get_irn_mode(proj), get_Proj_proj(proj));
   /* Die Proj- (Id-) Operation sollte im gleichen Grundblock stehen, wie die
    * Filter-Operation. */
-  set_nodes_Block(proj, get_nodes_Block(filter));
+  set_nodes_block(proj, get_nodes_block(filter));
   exchange(proj, filter);
   return filter;
 }
@@ -225,11 +225,11 @@ static void prepare_irg(ir_graph * irg, irg_data_t * data) {
    * den Start-Block verschieben. */
   for (proj = get_irn_link(get_irg_start(irg)); proj; proj = get_irn_link(proj)) {
     if (get_Proj_pred(proj) != get_irg_start(irg)
-    || (get_Proj_proj(proj) != pns_initial_exec && get_Proj_proj(proj) != pns_args)) {
+    || (get_Proj_proj(proj) != pn_Start_X_initial_exec && get_Proj_proj(proj) != pn_Start_T_args)) {
       ir_node * filter = exchange_proj(proj);
       set_Filter_cg_pred_arr(filter, n_callers, in);
     } else {
-      set_nodes_Block(proj, start_block);
+      set_nodes_block(proj, start_block);
     }
   }
 
@@ -249,9 +249,9 @@ static void prepare_irg(ir_graph * irg, irg_data_t * data) {
     }
   }
   /* Globle Einträge für ersetzte Operationen korrigieren. */
-  set_irg_frame      (irg, skip_nop(get_irg_frame(irg)));
-  set_irg_globals    (irg, skip_nop(get_irg_globals(irg)));
-  set_irg_initial_mem(irg, skip_nop(get_irg_initial_mem(irg)));
+  set_irg_frame      (irg, skip_Id(get_irg_frame(irg)));
+  set_irg_globals    (irg, skip_Id(get_irg_globals(irg)));
+  set_irg_initial_mem(irg, skip_Id(get_irg_initial_mem(irg)));
 
   /* Unbekannten Aufrufer sofort eintragen. */
   if (data->open) {
@@ -293,12 +293,12 @@ static void prepare_irg_end(ir_graph * irg, irg_data_t * data) {
   }
 
   if (n_ret > 0) {
-    int n_res = get_method_n_ress(get_entity_type(get_irg_ent(irg)));
+    int n_res = get_method_n_ress(get_entity_type(get_irg_entity(irg)));
     ir_node ** in = NEW_ARR_F(ir_node *, n_ret);
 
     /* block */
     for (i = n_ret - 1; i >= 0; --i) {
-      set_irg_current_block(irg, get_nodes_Block(ret_arr[i]));
+      set_irg_current_block(irg, get_nodes_block(ret_arr[i]));
       in[i] = new_Jmp();
     }
     create_Block(n_ret, in);
@@ -368,13 +368,13 @@ static void prepare_irg_end_except(ir_graph * irg, irg_data_t * data) {
     for (i = n_except - 1; i >= 0; --i) {
       ir_node * node = skip_Proj(skip_Tuple(except_arr[i]));
       if (get_irn_op(node) == op_Call) {
-    in[i] = new_r_Proj(irg, get_nodes_Block(node), node, mode_M, 3);
+    in[i] = new_r_Proj(irg, get_nodes_block(node), node, mode_M, 3);
       } else if (get_irn_op(node) == op_Raise) {
-    in[i] = new_r_Proj(irg, get_nodes_Block(node), node, mode_M, 1);
+    in[i] = new_r_Proj(irg, get_nodes_block(node), node, mode_M, 1);
       } else {
     assert(is_fragile_op(node));
     /* We rely that all cfops have the memory output at the same position. */
-    in[i] = new_r_Proj(irg, get_nodes_Block(node), node, mode_M, 0);
+    in[i] = new_r_Proj(irg, get_nodes_block(node), node, mode_M, 0);
       }
     }
     data->except_mem = new_Phi(n_except, in, mode_M);
@@ -391,7 +391,7 @@ static void prepare_irg_end_except(ir_graph * irg, irg_data_t * data) {
 
 /* Zwischengespeicherte Daten wieder freigeben. */
 static void cleanup_irg(ir_graph * irg) {
-  entity * ent = get_irg_ent(irg);
+  entity * ent = get_irg_entity(irg);
   irg_data_t * data = get_entity_link(ent);
   assert(data);
   if (data->res) DEL_ARR_F(data->res);
@@ -406,7 +406,7 @@ static void cleanup_irg(ir_graph * irg) {
 static void move_phis(ir_node * from_block, ir_node * to_block) {
   ir_node * phi;
   for (phi = get_irn_link(from_block); phi != NULL; phi = get_irn_link(phi)) {
-    set_nodes_Block(phi, to_block);
+    set_nodes_block(phi, to_block);
   }
   assert(get_irn_link(to_block) == NULL);
   set_irn_link(to_block, get_irn_link(from_block));
@@ -423,18 +423,18 @@ static void move_nodes(ir_node * from_block, ir_node * to_block, ir_node * node)
 
   for (i = arity - 1; i >= 0; --i) {
     ir_node * pred = get_irn_n(node, i);
-    if (get_nodes_Block(pred) == from_block) {
+    if (get_nodes_block(pred) == from_block) {
       move_nodes(from_block, to_block, pred);
     }
   }
-  set_nodes_Block(node, to_block);
+  set_nodes_block(node, to_block);
 
   /* Move projs of this node. */
   proj = get_irn_link(node);
   for (; proj; proj = skip_Id(get_irn_link(proj))) {
     if (get_irn_op(proj) != op_Proj && get_irn_op(proj) != op_Filter) continue;
-    if ((get_nodes_Block(proj) == from_block) && (skip_Proj(get_irn_n(proj, 0)) == node))
-      set_nodes_Block(proj, to_block);
+    if ((get_nodes_block(proj) == from_block) && (skip_Proj(get_irn_n(proj, 0)) == node))
+      set_nodes_block(proj, to_block);
   }
 }
 
@@ -451,23 +451,23 @@ static void construct_start(entity * caller, entity * callee,
   assert(irg);
   assert(get_entity_peculiarity(callee) == peculiarity_existent); /* Else data is not initalized. */
   assert((0 <= data->count) &&
-     (data->count < get_Block_cg_n_cfgpreds(get_nodes_Block(start))));
+     (data->count < get_Block_cg_n_cfgpreds(get_nodes_block(start))));
 
-  set_Block_cg_cfgpred(get_nodes_Block(start), data->count, exec);
+  set_Block_cg_cfgpred(get_nodes_block(start), data->count, exec);
   for (filter = get_irn_link(start); filter; filter = get_irn_link(filter)) {
     if (get_irn_op(filter) != op_Filter) continue;
     if (get_Proj_pred(filter) == start) {
       switch ((int) get_Proj_proj(filter)) {
-      case pns_global_store:
+      case pn_Start_M:
     set_Filter_cg_pred(filter, data->count, get_Call_mem(call));
     break;
-      case pns_frame_base:
+      case  pn_Start_P_frame_base:
     /* "frame_base" wird nur durch Unknown dargestellt. Man kann ihn aber
      * auch explizit darstellen, wenn sich daraus Vorteile für die
      * Datenflussanalyse ergeben. */
     set_Filter_cg_pred(filter, data->count, get_cg_Unknown(get_irn_mode(filter)));
     break;
-      case pns_globals:
+      case pn_Start_P_globals:
     /* "globals" wird nur durch Unknown dargestellt. Man kann ihn aber auch
      * explizit darstellen, wenn sich daraus Vorteile für die
      * Datenflussanalyse ergeben. */
@@ -565,7 +565,7 @@ static bool exc_branches_to_end(ir_graph *irg, ir_node *exc) {
 
 /* Returns true if only caller of irg is "Unknown". */
 static bool is_outermost_graph(ir_graph *irg) {
-  irg_data_t * data = get_entity_link(get_irg_ent(irg));
+  irg_data_t * data = get_entity_link(get_irg_entity(irg));
   if (data->count) {
     return false;
   } else if (data->open) {
@@ -586,7 +586,7 @@ static bool is_outermost_graph(ir_graph *irg) {
  * aufgerufenen Methoden eintragen. */
 static void construct_call(ir_node * call) {
   int n_callees = get_Call_n_callees(call);
-  ir_node * post_block = get_nodes_Block(call); /* block nach dem Aufruf */
+  ir_node * post_block = get_nodes_block(call); /* block nach dem Aufruf */
   ir_node * pre_block = create_Block(get_Block_n_cfgpreds(post_block),
                      get_Block_cfgpred_arr(post_block)); /* block vor dem Aufruf (mit CallBegin) */
   ir_node * except_block = NULL, * proj;
@@ -596,7 +596,7 @@ static void construct_call(ir_node * call) {
   /* CallBegin might be entry to endless recursion. */
   add_End_keepalive(get_irg_end(get_irn_irg(pre_block)), pre_block);
   ir_node ** in = NEW_ARR_F(ir_node *, n_callees);
-  entity * caller = get_irg_ent(current_ir_graph); /* entity des aktuellen ir_graph */
+  entity * caller = get_irg_entity(current_ir_graph); /* entity des aktuellen ir_graph */
   entity ** callees = NEW_ARR_F(entity *, n_callees); /* aufgerufene Methoden: entity */
   ir_graph ** irgs = NEW_ARR_F(ir_graph *, n_callees); /* aufgerufene Methoden: ir_graph */
   irg_data_t ** data = NEW_ARR_F(irg_data_t *, n_callees); /* aufgerufene Methoden: irg_data_t */
@@ -633,7 +633,7 @@ static void construct_call(ir_node * call) {
   for (i = 0; i < n_callees; ++i) {
     if (data[i]) { /* explicit */
       if (data[i]->reg) {
-    in[i] = new_r_Proj(irgs[i], get_nodes_Block(data[i]->reg),
+    in[i] = new_r_Proj(irgs[i], get_nodes_block(data[i]->reg),
                data[i]->reg, mode_X, data[i]->count);
       } else {
     in[i] = new_Bad();
@@ -660,13 +660,13 @@ static void construct_call(ir_node * call) {
       if (is_outermost_graph(current_ir_graph)) {
     except_block = get_irg_end_block(current_ir_graph);
       } else {
-    irg_data_t * tmp_data = get_entity_link(get_irg_ent(current_ir_graph));
+    irg_data_t * tmp_data = get_entity_link(get_irg_entity(current_ir_graph));
     except_block = get_nodes_block(tmp_data->except);
       }
     } else
       {
       except_block = create_Block(1, &proj);
-      set_nodes_Block(proj, except_block);
+      set_nodes_block(proj, except_block);
       exchange(proj, new_Break());
       set_irg_current_block(current_ir_graph, pre_block);
       set_irn_n(except_block, 0, new_Proj(call, mode_X, 1));
@@ -683,7 +683,7 @@ static void construct_call(ir_node * call) {
       entity * callee = get_Call_callee(call, i);
       if (data[i]) { /* explicit */
     if (data[i]->except) {
-      in[i] = new_r_Proj(get_entity_irg(callee), get_nodes_Block(data[i]->except),
+      in[i] = new_r_Proj(get_entity_irg(callee), get_nodes_block(data[i]->except),
                  data[i]->except, mode_X, data[i]->count);
     } else {
       in[i] = new_Bad();
@@ -729,7 +729,7 @@ static void construct_call(ir_node * call) {
       if (get_Proj_proj(proj) == 0) { /* memory */
     ir_node * filter;
 
-    set_nodes_Block(proj, post_block);
+    set_nodes_block(proj, post_block);
     filter = exchange_proj(proj);
     /* filter in die Liste der Phis aufnehmen */
     if (get_irn_link(filter) == NULL) { /* note CSE */
@@ -745,7 +745,7 @@ static void construct_call(ir_node * call) {
       } else if (get_Proj_proj(proj) == 3) { /* except_mem */
         ir_node * filter;
 
-    set_nodes_Block(proj, post_block);
+    set_nodes_block(proj, post_block);
     assert(except_block);
     set_irg_current_block(current_ir_graph, except_block);
     filter = exchange_proj(proj);
@@ -764,7 +764,7 @@ static void construct_call(ir_node * call) {
       ir_node * filter;
 
       assert(is_Proj(get_Proj_pred(proj)) && get_Proj_pred(get_Proj_pred(proj)) == call);
-      set_nodes_Block(proj, post_block);
+      set_nodes_block(proj, post_block);
       filter = exchange_proj(proj);
       /* filter in die Liste der Phis aufnehmen */
       if (get_irn_link(filter) == NULL) { /* not CSE */
@@ -797,7 +797,7 @@ void cg_construct(int arr_len, entity ** free_methods_arr) {
   /* prepare irgs */
   for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
     ir_graph * irg = get_irp_irg(i);
-    entity * ent = get_irg_ent(irg);
+    entity * ent = get_irg_entity(irg);
     irg_data_t * data = get_entity_link(ent);
     if (data->count) {
       prepare_irg(irg, data);
@@ -842,10 +842,10 @@ static void destruct_walker(ir_node * node, void * env) {
   if (get_irn_op(node) == op_Block) {
     remove_Block_cg_cfgpred_arr(node);
   } else if (get_irn_op(node) == op_Filter) {
-    set_irg_current_block(current_ir_graph, get_nodes_Block(node));
+    set_irg_current_block(current_ir_graph, get_nodes_block(node));
     exchange(node, new_Proj(get_Filter_pred(node), get_irn_mode(node), get_Filter_proj(node)));
   } else if (get_irn_op(node) == op_Break) {
-    set_irg_current_block(current_ir_graph, get_nodes_Block(node));
+    set_irg_current_block(current_ir_graph, get_nodes_block(node));
     exchange(node, new_Jmp());
   } else if (get_irn_op(node) == op_Call) {
     remove_Call_callee_arr(node);
@@ -862,9 +862,9 @@ void cg_destruct(void) {
     for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
       ir_graph * irg = get_irp_irg(i);
       irg_walk_graph(irg, destruct_walker, clear_link, NULL);
-      set_irg_frame(irg, skip_nop(get_irg_frame(irg)));
-      set_irg_globals(irg, skip_nop(get_irg_globals(irg)));
-      set_irg_initial_mem(irg, skip_nop(get_irg_initial_mem(irg)));
+      set_irg_frame(irg, skip_Id(get_irg_frame(irg)));
+      set_irg_globals(irg, skip_Id(get_irg_globals(irg)));
+      set_irg_initial_mem(irg, skip_Id(get_irg_initial_mem(irg)));
       set_irg_callee_info_state(irg, irg_callee_info_none);
       set_irg_end_reg(irg, get_irg_end(irg));
       set_irg_end_except(irg, get_irg_end(irg));
index cf1bd51..340590f 100644 (file)
@@ -83,7 +83,7 @@ void gc_irgs(int n_keep, entity ** keep_arr) {
   /* clean */
   for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
     ir_graph * irg = get_irp_irg(i);
-    entity * ent = get_irg_ent(irg);
+    entity * ent = get_irg_entity(irg);
     /* Removing any graph invalidates all interprocedural loop trees. */
     if (get_irg_loopinfo_state(irg) == loopinfo_ip_consistent ||
         get_irg_loopinfo_state(irg) == loopinfo_ip_inconsistent) {
index adf1739..901fe61 100644 (file)
@@ -155,9 +155,6 @@ new_rd_Const (dbg_info* db, ir_graph *irg, ir_node *block, ir_mode *mode, tarval
 {
   type *tp = unknown_type;
   /* removing this somehow causes errors in jack. */
-  if (tarval_is_entity(con))
-    tp = find_pointer_type_to_type(get_entity_type(get_tarval_entity(con)));
-
   return new_rd_Const_type (db, irg, block, mode, con, tp);
 }
 
@@ -1147,7 +1144,7 @@ new_d_Block (dbg_info* db, int arity, ir_node **in)
 
   Call Graph:   ( A ---> B == A "calls" B)
 
-       get_value         mature_block
+       get_value         mature_immBlock
           |                   |
           |                   |
           |                   |
@@ -1369,7 +1366,7 @@ phi_merge (ir_node *block, int pos, ir_mode *mode, ir_node **nin, int ins)
      The call order
        get_value    (makes Phi0, put's it into graph_arr)
        set_value    (overwrites Phi0 in graph_arr)
-       mature_block (upgrades Phi0, puts it again into graph_arr, overwriting
+       mature_immBlock (upgrades Phi0, puts it again into graph_arr, overwriting
                      the proper value.)
      fails. */
   if (!block->attr.block.graph_arr[pos]) {
@@ -1460,7 +1457,7 @@ get_r_value_internal (ir_node *block, int pos, ir_mode *mode)
     /* The block is not mature, we don't know how many in's are needed.  A Phi
        with zero predecessors is created.  Such a Phi node is called Phi0
        node.  (There is also an obsolete Phi0 opcode.) The Phi0 is then added
-       to the list of Phi0 nodes in this block to be matured by mature_block
+       to the list of Phi0 nodes in this block to be matured by mature_immBlock
        later.
        The Phi0 has to remember the pos of it's internal value.  If the real
        Phi is computed, pos is used to update the array with the local
@@ -1764,7 +1761,7 @@ phi_merge (ir_node *block, int pos, ir_mode *mode, ir_node **nin, int ins)
      optimization possibilities.
      The Phi0 node either is allocated in this function, or it comes from
      a former call to get_r_value_internal. In this case we may not yet
-     exchange phi0, as this is done in mature_block. */
+     exchange phi0, as this is done in mature_immBlock. */
   if (!phi0) {
     phi0_all = block->attr.block.graph_arr[pos];
     if (!((get_irn_op(phi0_all) == op_Phi) &&
@@ -1861,7 +1858,7 @@ get_r_value_internal (ir_node *block, int pos, ir_mode *mode)
     /* The block is not mature, we don't know how many in's are needed.  A Phi
        with zero predecessors is created.  Such a Phi node is called Phi0
        node.  The Phi0 is then added to the list of Phi0 nodes in this block
-       to be matured by mature_block later.
+       to be matured by mature_immBlock later.
        The Phi0 has to remember the pos of it's internal value.  If the real
        Phi is computed, pos is used to update the array with the local
        values. */
@@ -1893,7 +1890,7 @@ get_r_value_internal (ir_node *block, int pos, ir_mode *mode)
 /** Finalize a Block node, when all control flows are known.  */
 /** Acceptable parameters are only Block nodes.               */
 void
-mature_block (ir_node *block)
+mature_immBlock (ir_node *block)
 {
 
   int ins;
@@ -2406,7 +2403,7 @@ new_immBlock (void) {
 
 /* add an adge to a jmp/control flow node */
 void
-add_in_edge (ir_node *block, ir_node *jmp)
+add_immBlock_pred (ir_node *block, ir_node *jmp)
 {
   if (block->attr.block.matured) {
     assert(0 && "Error: Block already matured!\n");
@@ -2419,7 +2416,7 @@ add_in_edge (ir_node *block, ir_node *jmp)
 
 /* changing the current block */
 void
-switch_block (ir_node *target)
+set_cur_block (ir_node *target)
 {
   current_ir_graph->current_block = target;
 }
@@ -2479,7 +2476,7 @@ keep_alive (ir_node *ka)
 
 /** Useful access routines **/
 /* Returns the current block of the current graph.  To set the current
-   block use switch_block(). */
+   block use set_cur_block. */
 ir_node *get_cur_block() {
   return get_irg_current_block(current_ir_graph);
 }
index 38d111b..120de4a 100644 (file)
@@ -84,7 +84,7 @@
  *
  *      *args        The ir_node that produces the arguments of the method as
  *               it's result.  This is a Proj node on the fourth output of
- *               the start node.  This output is tagged as pns_args.
+ *               the start node.  This output is tagged as pn_Start_T_args.
  *
  *      *bad             The bad node is an auxiliary node. It is needed only once,
  *                       so there is this globally reachable node.
@@ -95,7 +95,7 @@
  *
  *      *current_block   A pointer to the current block.  Any node created with
  *                       one of the node constructors (new_<opcode>) are assigned
- *                       to this block.  It can be set with switch_block(block).
+ *                       to this block.  It can be set with set_cur_block(block).
  *                       Only needed for ir construction.
  *
  *      params/n_loc     An int giving the number of local variables in this
  *      *link            A pointer to an ir_node.  With this pointer all Phi nodes
  *                       are attached to a Block, i.e., a Block points to it's
  *                       first Phi node, this node points to the second Phi node
- *                       in the Block and so fourth.  Used in mature_block
+ *                       in the Block and so fourth.  Used in mature_immBlock
  *                       to find all Phi nodes to be matured.  It's also used to
  *               annotate a node with a better, optimized version of it.
  *
  *      (new_<Node> constructurs and a set of additional routines.)
  *    * A less comfortable interface where all predecessors except the block
  *      an operation belongs to need to be specified.  SSA must be constructed
- *      by hand.  (new_<Node> constructors and switch_block()).  This interface
+ *      by hand.  (new_<Node> constructors and set_cur_block()).  This interface
  *      is called "block oriented".  It automatically calles the local optimizations
  *      for each new node.
  *    * An even less comfortable interface where the block needs to be specified
  *
  *    A global variable holds the current basic block.  All (non block) nodes
  *    generated are added to this block.  The current block can be set with
- *    switch_block(block).  If several blocks are constructed in parallel block
+ *    set_cur_block(block).  If several blocks are constructed in parallel block
  *    switches need to be performed constantly.
  *
  *    To generate a Block node (with the comfortable interface) it's predecessor
  *    control flow nodes need not be known.  In case of cyclic control flow these
- *    can not be known when the block is constructed.  With add_in_edge(block,
+ *    can not be known when the block is constructed.  With add_immBlock_pred(block,
  *    cfnode) predecessors can be added to the block.  If all predecessors are
- *    added to the block mature_block(b) needs to be called.  Calling mature_block
+ *    added to the block mature_immBlock(b) needs to be called.  Calling mature_immBlock
  *    early improves the efficiency of the Phi node construction algorithm.
- *    But if several  blocks are constructed at once, mature_block must only
+ *    But if several  blocks are constructed at once, mature_immBlock must only
  *    be called after performing all set_values and set_stores in the block!
  *    (See documentation of new_immBlock constructor.)
  *
  *    ir_node *this_block, *cf_pred1, *cf_pred2, *a_val, *mem, *div, *res, *cf_op;
  *
  *    this_block = new_immBlock();
- *    add_in_edge(this_block, cf_pred1);
- *    add_in_edge(this_block, cf_pred2);
- *    mature_block(this_block);
+ *    add_immBlock_pred(this_block, cf_pred1);
+ *    add_immBlock_pred(this_block, cf_pred2);
+ *    mature_immBlock(this_block);
  *    a_val = get_value(42, mode_Iu);
  *    mem = get_store();
  *    div = new_Div(mem, a_val, a_val);
  *    ir_node *new_FuncCall (ir_node *store, ir_node *callee, int arity,
  *                       ir_node **in, type_method *type);
  *
- *    void add_in_edge (ir_node *block, ir_node *jmp);
- *    void mature_block (ir_node *block);
- *    void switch_block (ir_node *target);
+ *    void add_immBlock_pred (ir_node *block, ir_node *jmp);
+ *    void mature_immBlock (ir_node *block);
+ *    void set_cur_block (ir_node *target);
  *    ir_node *get_value (int pos, ir_mode *mode);
  *    void set_value (int pos, ir_node *value);
  *    ir_node *get_store (void);
  *    Creates a new block.  Sets current_block to itself.  When a new block is
  *    created it cannot be known how many predecessors this block will have in the
  *    control flow graph. Therefore the list of inputs can not be fixed at
- *    creation.  Predecessors can be added with add_in_edge (block, control flow
+ *    creation.  Predecessors can be added with add_immBlock_pred (block, control flow
  *    operation).  With every added predecessor the number of inputs to Phi nodes
  *    also changes.
  *
- *    The block can be completed by mature_block(block) if all predecessors are
- *    known.  If several blocks are built at once, mature_block can only be called
+ *    The block can be completed by mature_immBlock(block) if all predecessors are
+ *    known.  If several blocks are built at once, mature_immBlock can only be called
  *    after set_value has been called for all values that are life at the end
- *    of the block.  This is necessary so that Phi nodes created by mature_block
- *    get the right predecessors in case of cyclic dependencies.  If all set_values
+ *    of the block.  This is necessary so that Phi nodes created mature_immBlock *    get the right predecessors in case of cyclic dependencies.  If all set_values
  *    of this block are called after maturing it and before calling get_value
  *    in some block that is control flow dependent on this block, the construction
  *    is correct.
  *
  *      block_before_loop = new_block();
  *      set_value(x);
- *      mature_block(block_before_loop);
+ *      mature_immBlock(block_before_loop);
  *      before2header = new_Jmp;
  *
  *      loop_header = new_block ();
  *      loop_body = new_block ();
  *      body2header = new_Jmp();
  *
- *      add_in_edge(loop_header, before2header);
- *      add_in_edge(loop_header, body2header);
- *      add_in_edge(loop_body, header2body);
+ *      add_immBlock_pred(loop_header, before2header);
+ *      add_immBlock_pred(loop_header, body2header);
+ *      add_immBlock_pred(loop_body, header2body);
  *
- *      mature_block(loop_header);
- *      mature_block(loop_body);
+ *      mature_immBlock(loop_header);
+ *      mature_immBlock(loop_body);
  *
  *      get_value(loop_body, x);   //  gets the Phi in loop_header
  *      set_value(loop_header, x); //  sets the value the above get_value should
  *                                 //  have returned!!!
  *
- *    Mature_block also fixes the number of inputs to the Phi nodes.  Mature_block
+ *    Mature_immBlock also fixes the number of inputs to the Phi nodes.  Mature_immBlock
  *    should be called as early as possible, as afterwards the generation of Phi
  *   nodes is more efficient.
  *
  *      No inputs except the block it belogns to.
  *    Output:
  *      A tuple of 4 (5, 6) distinct values. These are labeled by the following
- *      projection numbers (pns_number):
- *      * pns_initial_exec
- *                       mode X, points to the first block to be executed.
- *      * pns_global_store
- *                       mode M, the global store
- *      * pns_frame_base mode P, a pointer to the base of the procedures
- *                       stack frame.
- *      * pns_globals    mode P, a pointer to the part of the memory containing
- *                               _all_ global things.
- *      * pns_args       mode T, a tuple containing all arguments of the procedure.
+ *      projection numbers (pn_Start):
+ *      * pn_Start_X_initial_exec    mode X, points to the first block to be exe *                                   cuted.
+ *      * pn_Start_M                 mode M, the global store
+ *      * pn_Start_P_frame_base      mode P, a pointer to the base of the proce  *                                   dures stack frame.
+ *      * pn_Start_P_globals         mode P, a pointer to the part of the memory *                                   containing_all_ global things.
+ *      * pn_Start_T_args            mode T, a tuple containing all arguments of *                                   the procedure.
  *
  *
  *    ir_node *new_End (void)
@@ -2566,7 +2561,7 @@ ir_node *new_r_FuncCall (ir_graph *irg, ir_node *block,
  *
  *  @param target  The new current block.
  */
-void     switch_block (ir_node *target);
+void     set_cur_block (ir_node *target);
 
 /** Returns the current block of the current graph. */
 ir_node *get_cur_block(void);
@@ -3300,7 +3295,7 @@ ir_node *new_d_FuncCall (dbg_info* db, ir_node *callee, int arity, ir_node *in[]
 /*-----------------------------------------------------------------------*/
 
 /* Needed from the interfase with debug support:
-void switch_block (ir_node *target);   */
+void set_cur_block (ir_node *target);   */
 
 /** Constructor for a Block node.
  *
@@ -3936,10 +3931,10 @@ ir_node *new_d_immBlock (dbg_info* db);
 ir_node *new_immBlock (void);
 
 /** Add a control flow edge to an immature block. */
-void add_in_edge (ir_node *immblock, ir_node *jmp);
+void add_immBlock_pred (ir_node *immblock, ir_node *jmp);
 
 /** Fix the number of predecessors of an immature block. */
-void mature_block (ir_node *block);
+void mature_immBlock (ir_node *block);
 
 
 /** Get the current value of a local variable.
@@ -4016,11 +4011,5 @@ void finalize_cons (ir_graph *irg);
  */
 typedef ir_node *default_initialize_local_variable_func_t(ir_mode *mode, int pos);
 
-/**
- * Initializes the graph construction.
- *
- * @param func  @see default_initialize_local_variable_func_t
- */
-void init_cons (default_initialize_local_variable_func_t *func);
 
 # endif /* _IRCONS_H_ */
index 0650fd9..c2bccfb 100644 (file)
 #include "ircons.h"
 # include "irgraph_t.h"
 
+/**
+ * Initializes the graph construction.
+ *
+ * @param func  @see default_initialize_local_variable_func_t
+ */
+void init_cons (default_initialize_local_variable_func_t *func);
+
 /* inline functions */
 
 static INLINE ir_node *
index a62b899..3f25a2d 100644 (file)
@@ -234,7 +234,6 @@ static void print_enum_item_edge(FILE *F, type *E, int item, const char *fmt, ..
 /*******************************************************************/
 
 /* A suffix to manipulate the file name. */
-char *dump_file_suffix = "";
 
 char *dump_file_filter = "";
 
@@ -291,8 +290,8 @@ static void clear_link(ir_node * node, void * env) {
 
 
 static int node_floats(ir_node *n) {
-  return ((get_op_pinned(get_irn_op(n)) == floats) &&
-      (get_irg_pinned(current_ir_graph) == floats));
+  return ((get_op_pinned(get_irn_op(n)) == op_pin_state_floats) &&
+      (get_irg_pinned(current_ir_graph) == op_pin_state_floats));
 }
 
 static const char *get_ent_dump_name(entity *ent) {
@@ -305,7 +304,7 @@ static const char *get_ent_dump_name(entity *ent) {
 
 static const char *get_irg_dump_name(ir_graph *irg) {
   /* Don't use get_entity_ld_ident (ent) as it computes the mangled name! */
-  entity *ent = get_irg_ent(irg);
+  entity *ent = get_irg_entity(irg);
   return get_ent_dump_name(ent);
 }
 
@@ -327,7 +326,7 @@ static void collect_node(ir_node * node, void *env) {
 
 /** Construct lists to walk ir block-wise.
  *
- * Collects all blocks, nodes not pinned,
+ * Collects all blocks, nodes not op_pin_state_pinned,
  * Bad and Unknown into a flexible array in link field of
  * irg they belong to.  Sets the irg link field to NULL in all
  * graphs not visited.
@@ -496,7 +495,7 @@ dump_node_opcode(FILE *F, ir_node *n)
 
   case iro_Start: {
     if (interprocedural_view) {
-      fprintf(F, "%s %s", get_irn_opname(n), get_ent_dump_name(get_irg_ent(get_irn_irg(n))));
+      fprintf(F, "%s %s", get_irn_opname(n), get_ent_dump_name(get_irg_entity(get_irn_irg(n))));
       break;
     }
   } /* fall through */
@@ -565,7 +564,7 @@ dump_node_nodeattr(FILE *F, ir_node *n)
   switch (get_irn_opcode(n)) {
   case iro_Start:
     if (false && interprocedural_view) {
-      fprintf (F, "%s", get_ent_dump_name(get_irg_ent(current_ir_graph)));
+      fprintf (F, "%s", get_ent_dump_name(get_irg_entity(current_ir_graph)));
     }
     break;
   case iro_Proj:
@@ -667,7 +666,7 @@ static INLINE int dump_node_info(FILE *F, ir_node *n)
   /* Source types */
   switch (get_irn_opcode(n)) {
   case iro_Start: {
-    type *tp = get_entity_type(get_irg_ent(get_irn_irg(n)));
+    type *tp = get_entity_type(get_irg_entity(get_irn_irg(n)));
     fprintf(F, "start of method of type %s \n", get_type_name_ex(tp, &bad));
     for (i = 0; i < get_method_n_params(tp); ++i)
       fprintf(F, "  param %d type: %s \n", i, get_type_name_ex(get_method_param_type(tp, i), &bad));
@@ -723,7 +722,7 @@ static INLINE int dump_node_info(FILE *F, ir_node *n)
   } break;
   case iro_Return: {
     if (!interprocedural_view) {
-      type *tp = get_entity_type(get_irg_ent(get_irn_irg(n)));
+      type *tp = get_entity_type(get_irg_entity(get_irn_irg(n)));
       fprintf(F, "return in method of type %s \n", get_type_name_ex(tp, &bad));
       for (i = 0; i < get_method_n_ress(tp); ++i)
     fprintf(F, "  res %d type: %s \n", i, get_type_name_ex(get_method_res_type(tp, i), &bad));
@@ -1118,7 +1117,7 @@ dump_whole_block(FILE *F, ir_node *block) {
 }
 
 /** dumps a graph block-wise. Expects all blockless nodes in arr in irgs link.
- *  The outermost nodes: blocks and nodes not pinned, Bad, Unknown. */
+ *  The outermost nodes: blocks and nodes not op_pin_state_pinned, Bad, Unknown. */
 static void
 dump_block_graph(FILE *F, ir_graph *irg) {
   int i;
@@ -1152,7 +1151,7 @@ static void dump_graph(FILE *F, ir_graph *irg) {
   fprintf(F, "graph: { title: \"");
   PRINT_IRGID(irg);
   fprintf(F, "\" label: \"%s\" status:clustered color:white \n",
-      get_ent_dump_name(get_irg_ent(irg)));
+      get_ent_dump_name(get_irg_entity(irg)));
 
   dump_block_graph(F, irg);
 
@@ -1800,21 +1799,18 @@ vcg_close (FILE *F) {
 /** Routine to dump a graph, blocks as conventional nodes.
  */
 void
-dump_ir_graph (ir_graph *irg)
+dump_ir_graph (ir_graph *irg, char *suffix )
 {
   FILE *f;
   ir_graph *rem;
-  char *suffix;
+  char *suffix1;
   rem = current_ir_graph;
 
-  /* if a filter is set, dump only the irg's that match the filter */
-  if (strncmp(get_entity_name(get_irg_ent(irg)), dump_file_filter, strlen(dump_file_filter)) != 0)
-    return;
-
+  if(strncmp(get_entity_name(get_irg_entity(irg)),dump_file_filter,strlen(dump_file_filter))!=0) return;
   current_ir_graph = irg;
-  if (interprocedural_view) suffix = "-pure-ip";
-  else                      suffix = "-pure";
-  f = vcg_open(irg, dump_file_suffix, suffix);
+  if (interprocedural_view) suffix1 = "-pure-ip";
+  else                      suffix1 = "-pure";
+  f = vcg_open(irg, suffix, suffix1);
   dump_vcg_header(f, get_irg_dump_name(irg), NULL);
 
   /* walk over the graph */
@@ -1822,8 +1818,8 @@ dump_ir_graph (ir_graph *irg)
   irg_walk(get_irg_end(irg), NULL, dump_whole_node, f);
 
   /* dump the out edges in a separate walk */
-  if ((dump_out_edge_flag) && (get_irg_outs_state(irg) != no_outs)) {
-    irg_out_walk(get_irg_start(irg), dump_out_edge, NULL, f);
+  if ((dump_out_edge_flag) && (get_irg_outs_state(irg) != outs_none)) {
+    irg_out_walk(get_irg_start(irg), dump_out_edge, NULL, NULL);
   }
 
   vcg_close(f);
@@ -1833,19 +1829,16 @@ dump_ir_graph (ir_graph *irg)
 
 
 void
-dump_ir_block_graph (ir_graph *irg)
+dump_ir_block_graph (ir_graph *irg, char *suffix)
 {
   FILE *f;
   int i;
-  char *suffix;
-
-  /* if a filter is set, dump only the irg's that match the filter */
-  if (strncmp(get_entity_name(get_irg_ent(irg)), dump_file_filter, strlen(dump_file_filter)) != 0)
-    return;
+  char *suffix1;
 
-  if (interprocedural_view) suffix = "-ip";
-  else                      suffix = "";
-  f = vcg_open(irg, dump_file_suffix, suffix);
+  if(strncmp(get_entity_name(get_irg_entity(irg)),dump_file_filter,strlen(dump_file_filter))!=0) return;
+  if (interprocedural_view) suffix1 = "-ip";
+  else                      suffix1 = "";
+  f = vcg_open(irg, suffix, suffix1);
   dump_vcg_header(f, get_irg_dump_name(irg), NULL);
 
   construct_block_lists(irg);
@@ -1864,11 +1857,11 @@ dump_ir_block_graph (ir_graph *irg)
 /** dumps a graph with type information
  */
 void
-dump_ir_graph_w_types (ir_graph *irg)
+dump_ir_graph_w_types (ir_graph *irg, char *suffix)
 {
   FILE *f;
   ir_graph *rem = current_ir_graph;
-  char *suffix;
+  char *suffix1;
 
   /* if a filter is set, dump only the irg's that match the filter */
   if (strncmp(get_irg_dump_name(irg), dump_file_filter, strlen(dump_file_filter)) != 0)
@@ -1876,9 +1869,9 @@ dump_ir_graph_w_types (ir_graph *irg)
 
   current_ir_graph = irg;
 
-  if (interprocedural_view) suffix = "-pure-wtypes-ip";
-  else                      suffix = "-pure-wtypes";
-  f = vcg_open(irg, dump_file_suffix, suffix);
+  if (interprocedural_view) suffix1 = "-pure-wtypes-ip";
+  else                      suffix1 = "-pure-wtypes";
+  f = vcg_open(irg,suffix, suffix1);
   dump_vcg_header(f, get_irg_dump_name(irg), NULL);
 
   /* dump common ir graph */
@@ -1894,20 +1887,20 @@ dump_ir_graph_w_types (ir_graph *irg)
 }
 
 void
-dump_ir_block_graph_w_types (ir_graph *irg)
+dump_ir_block_graph_w_types (ir_graph *irg, char *suffix)
 {
   FILE *f;
   int i;
-  char *suffix;
+  char *suffix1;
   ir_graph *rem = current_ir_graph;
 
   /* if a filter is set, dump only the irg's that match the filter */
   if (strncmp(get_irg_dump_name(irg), dump_file_filter, strlen(dump_file_filter)) != 0)
     return;
 
-  if (interprocedural_view) suffix = "-wtypes-ip";
-  else                      suffix = "-wtypes";
-  f = vcg_open(irg, dump_file_suffix, suffix);
+  if (interprocedural_view) suffix1 = "-wtypes-ip";
+  else                      suffix1 = "-wtypes";
+  f = vcg_open(irg, suffix, suffix1);
   dump_vcg_header(f, get_irg_dump_name(irg), NULL);
 
   /* dump common blocked ir graph */
@@ -1976,7 +1969,7 @@ dump_block_to_cfg(ir_node *block, void *env) {
 }
 
 void
-dump_cfg (ir_graph *irg)
+dump_cfg (ir_graph *irg, char *suffix)
 {
   FILE *f;
   ir_graph *rem = current_ir_graph;
@@ -1989,7 +1982,7 @@ dump_cfg (ir_graph *irg)
 
   current_ir_graph = irg;
 
-  f = vcg_open(irg, dump_file_suffix, "-cfg");
+  f = vcg_open(irg, suffix, "-cfg");
   dump_vcg_header(f, get_irg_dump_name(irg), NULL);
 
   if (interprocedural_view) {
@@ -2021,7 +2014,7 @@ void dump_callgraph(char *filesuffix) {
 
   for (i = 0; i < n_irgs; ++i) {
     ir_graph *irg = get_irp_irg(i);
-    entity *ent = get_irg_ent(irg);
+    entity *ent = get_irg_entity(irg);
     int j, n_callees = get_irg_n_callees(irg);
 
     dump_entity_node(F, ent);
@@ -2041,13 +2034,13 @@ void dump_callgraph(char *filesuffix) {
 
 
 /* Dump all irgs in interprocedural view to a single file. */
-void dump_all_cg_block_graph(void) {
+void dump_all_cg_block_graph(char *suffix) {
   FILE *f;
   int i;
   int rem_view = interprocedural_view;
   interprocedural_view = 1;
 
-  f = vcg_open_name("All_graphs", dump_file_suffix);
+  f = vcg_open_name("All_graphs", suffix);
   dump_vcg_header(f, "All_graphs", NULL);
 
   /* collect nodes in all irgs reachable in call graph*/
@@ -2073,7 +2066,7 @@ void dump_all_cg_block_graph(void) {
 /***********************************************************************/
 
 void
-dump_type_graph (ir_graph *irg)
+dump_type_graph (ir_graph *irg, char *suffix)
 {
   FILE *f;
   ir_graph *rem;
@@ -2084,7 +2077,7 @@ dump_type_graph (ir_graph *irg)
 
   current_ir_graph = irg;
 
-  f = vcg_open(irg, dump_file_suffix, "-type");
+  f = vcg_open(irg, suffix, "-type");
   dump_vcg_header(f, get_irg_dump_name(irg), NULL);
 
   /* walk over the blocks in the graph */
@@ -2100,9 +2093,9 @@ dump_type_graph (ir_graph *irg)
 }
 
 void
-dump_all_types (void)
+dump_all_types (char *suffix)
 {
-  FILE *f = vcg_open_name("All_types", dump_file_suffix);
+  FILE *f = vcg_open_name("All_types", suffix);
   dump_vcg_header(f, "All_types", NULL);
   type_walk(dump_type_info, NULL, f);
   inc_irg_visited(get_const_code_irg());
@@ -2110,9 +2103,9 @@ dump_all_types (void)
 }
 
 void
-dump_class_hierarchy (bool entities)
+dump_class_hierarchy (bool entities, char *suffix)
 {
-  FILE *f = vcg_open_name("class_hierarchy", dump_file_suffix);
+  FILE *f = vcg_open_name("class_hierarchy", suffix);
   h_env_t env;
 
   env.f = f;
@@ -2134,10 +2127,10 @@ dump_class_hierarchy (bool entities)
 /*  dump_ir_graph_w_types                                              */
 /***********************************************************************/
 
-void dump_all_ir_graphs(dump_graph_func *dmp_grph) {
+void dump_all_ir_graphs(dump_graph_func *dmp_grph, char *suffix) {
   int i;
   for (i=0; i < get_irp_n_irgs(); i++) {
-    dmp_grph(get_irp_irg(i));
+    dmp_grph(get_irp_irg(i), suffix);
   }
 }
 
index b094b2f..a9773c9 100644 (file)
@@ -63,7 +63,7 @@ extern char *dump_file_filter;
  *
  * @see turn_off_edge_labels()
  */
-void dump_ir_graph (ir_graph *irg);
+void dump_ir_graph (ir_graph *irg, char *suffix);
 #define dump_cg_graph dump_ir_graph
 
 /**
@@ -83,12 +83,12 @@ void dump_ir_graph (ir_graph *irg);
  *
  * @see turn_off_edge_labels()
  */
-void dump_ir_block_graph (ir_graph *irg);
+void dump_ir_block_graph (ir_graph *irg, char *suffix);
 #define dump_cg_block_graph dump_ir_block_graph
 
 /** Dumps all graphs in interprocedural view to a file named All_graphs.vcg.
  */
-void dump_all_cg_block_graph(void);
+void dump_all_cg_block_graph(char *suffix);
 
 /**
  *  Dumps a firm graph and  all the type information needed for Calls,
@@ -105,7 +105,7 @@ void dump_all_cg_block_graph(void);
  *
  * @see turn_off_edge_labels()
  */
-void dump_ir_graph_w_types (ir_graph *irg);
+void dump_ir_graph_w_types (ir_graph *irg, char *suffix);
 
 /**
  *  Dumps a firm graph and  all the type information needed for Calls,
@@ -123,14 +123,14 @@ void dump_ir_graph_w_types (ir_graph *irg);
  *
  * @see turn_off_edge_labels()
  */
-void dump_ir_block_graph_w_types (ir_graph *irg);
+void dump_ir_block_graph_w_types (ir_graph *irg, char *suffix);
 
 /**
  *   The type of a walker function that is called for each graph.
  *
  *   @param irg   current visited graph
  */
-typedef void dump_graph_func(ir_graph *irg);
+typedef void dump_graph_func(ir_graph *irg, char *suffix);
 
 /**
  *   A walker that calls a dumper for each graph.
@@ -150,7 +150,7 @@ typedef void dump_graph_func(ir_graph *irg);
  *
  * @see turn_off_edge_labels()
  */
-void dump_all_ir_graphs (dump_graph_func *dump_graph);
+void dump_all_ir_graphs (dump_graph_func *dump_graph, char *suffix);
 
 
 /**
@@ -168,7 +168,7 @@ void dump_all_ir_graphs (dump_graph_func *dump_graph);
  *
  * @see turn_off_edge_labels()
  */
-void dump_cfg (ir_graph *irg);
+void dump_cfg (ir_graph *irg, char *suffix);
 
 
 /** Dump the call graph.
@@ -191,7 +191,7 @@ void dump_callgraph(char *filesuffix);
  *
  * @see turn_off_edge_labels()
  */
-void dump_type_graph (ir_graph *irg);
+void dump_type_graph (ir_graph *irg, char *suffix);
 
 /**
  *   Dumps all type information.
@@ -206,7 +206,7 @@ void dump_type_graph (ir_graph *irg);
  *
  * @see turn_off_edge_labels()
  */
-void dump_all_types (void);
+void dump_all_types (char *suffix);
 
 /**
  *   Dumps the class hierarchy with or without entities.
@@ -224,7 +224,7 @@ void dump_all_types (void);
  *   is dumped along with the entities.
  *   Dumps to a file class_hierarchy.vcg
  */
-void dump_class_hierarchy (bool entities);
+void dump_class_hierarchy (bool entities, char *suffix);
 
 
 /**
index 69421ef..fa81a3c 100644 (file)
@@ -59,7 +59,7 @@ void set_opt_cse (int value);
  * If opt_global_cse == 1 and opt_cse == 1 perform intra procedure
  * constant subexpression elimination for floating nodes.  Intra
  * procedure cse gets the graph into state "floating".  It is necessary
- * to run pre/code motion to get the graph back into state "pinned".
+ * to run pre/code motion to get the graph back into state "op_pin_state_pinned".
  * right after a call to local_optimize with global cse turned on.
  * Default: opt_global_cse == 0.
  */
index 9a5392e..3de1fa2 100644 (file)
@@ -37,9 +37,9 @@ turn_into_tuple (ir_node *node, int arity)
     /* keep old array */
   } else {
     /* Allocate new array, don't free old in_array, it's on the obstack. */
-    ir_node *block = get_nodes_Block(node);
+    ir_node *block = get_nodes_block(node);
     node->in = NEW_ARR_D (ir_node *, current_ir_graph->obst, arity+1);
-    set_nodes_Block(node, block);
+    set_nodes_block(node, block);
   }
 }
 
@@ -84,8 +84,8 @@ static void
 collect (ir_node *n, void *env) {
   ir_node *pred;
   if (get_irn_op(n) == op_Phi) {
-    set_irn_link(n, get_irn_link(get_nodes_Block(n)));
-    set_irn_link(get_nodes_Block(n), n);
+    set_irn_link(n, get_irn_link(get_nodes_block(n)));
+    set_irn_link(get_nodes_block(n), n);
   }
   if (get_irn_op(n) == op_Proj) {
     pred = n;
@@ -122,14 +122,14 @@ static void move (ir_node *node, ir_node *from_bl, ir_node *to_bl) {
   ir_node *proj, *pred;
 
   /* move this node */
-  set_nodes_Block(node, to_bl);
+  set_nodes_block(node, to_bl);
 
   /* move its projs */
   if (get_irn_mode(node) == mode_T) {
     proj = get_irn_link(node);
     while (proj) {
-      if (get_nodes_Block(proj) == from_bl)
-       set_nodes_Block(proj, to_bl);
+      if (get_nodes_block(proj) == from_bl)
+       set_nodes_block(proj, to_bl);
       proj = get_irn_link(proj);
     }
   }
@@ -140,7 +140,7 @@ static void move (ir_node *node, ir_node *from_bl, ir_node *to_bl) {
   arity = get_irn_arity(node);
   for (i = 0; i < arity; i++) {
     pred = get_irn_n(node, i);
-    if (get_nodes_Block(pred) == from_bl)
+    if (get_nodes_block(pred) == from_bl)
       move(pred, from_bl, to_bl);
   }
 }
@@ -155,7 +155,7 @@ void part_block(ir_node *node) {
   set_optimize(0);
 
   /* Transform the control flow */
-  old_block = get_nodes_Block(node);
+  old_block = get_nodes_block(node);
   new_block = new_Block(get_Block_n_cfgpreds(old_block),
             get_Block_cfgpred_arr(old_block));
   set_irg_current_block(current_ir_graph, new_block);
@@ -174,10 +174,10 @@ void part_block(ir_node *node) {
   set_irn_link(new_block, phi);
   set_irn_link(old_block, NULL);
   while (phi) {
-    if(get_nodes_Block(phi) == old_block);   /* @@@ inlinening chokes on phis that don't
+    if(get_nodes_block(phi) == old_block);   /* @@@ inlinening chokes on phis that don't
                            obey this condition.  How do they get into
                            the list??? Example: InterfaceIII */
-      set_nodes_Block(phi, new_block);
+      set_nodes_block(phi, new_block);
     phi = get_irn_link(phi);
   }
 
index 7f704b4..af007b4 100644 (file)
@@ -90,7 +90,7 @@ static INLINE void do_local_optimize(ir_node *n) {
   /* Handle graph state */
   assert(get_irg_phase_state(current_ir_graph) != phase_building);
   if (get_opt_global_cse())
-    set_irg_pinned(current_ir_graph, floats);
+    set_irg_pinned(current_ir_graph, op_pin_state_floats);
   if (get_irg_outs_state(current_ir_graph) == outs_consistent)
     set_irg_outs_inconsistent(current_ir_graph);
   if (get_irg_dom_state(current_ir_graph) == dom_consistent)
@@ -223,7 +223,7 @@ copy_node (ir_node *n, void *env) {
     new_arity = compute_new_arity(n);
     n->attr.block.graph_arr = NULL;
   } else {
-    block = get_nodes_Block(n);
+    block = get_nodes_block(n);
     if (get_irn_opcode(n) == iro_Phi) {
       new_arity = compute_new_arity(block);
     } else {
@@ -285,7 +285,7 @@ copy_preds (ir_node *n, void *env) {
     if ((get_opt_control_flow_straightening()) &&
     (get_Block_n_cfgpreds(nn) == 1) &&
     (get_irn_op(get_Block_cfgpred(nn, 0)) == op_Jmp)) {
-      ir_node *old = get_nodes_Block(get_Block_cfgpred(nn, 0));
+      ir_node *old = get_nodes_block(get_Block_cfgpred(nn, 0));
       if (nn == old) {
     /* Jmp jumps into the block it is in -- deal self cycle. */
     assert(is_Bad(get_new_node(get_irg_bad(current_ir_graph))));
@@ -297,7 +297,7 @@ copy_preds (ir_node *n, void *env) {
   } else if (get_irn_opcode(n) == iro_Phi) {
     /* Don't copy node if corresponding predecessor in block is Bad.
        The Block itself should not be Bad. */
-    block = get_nodes_Block(n);
+    block = get_nodes_block(n);
     set_irn_n (nn, -1, get_new_node(block));
     j = 0;
     irn_arity = get_irn_arity(n);
@@ -309,7 +309,7 @@ copy_preds (ir_node *n, void *env) {
       }
     /* If the pre walker reached this Phi after the post walker visited the
        block block_visited is > 0. */
-    set_Block_block_visited(get_nodes_Block(n), 0);
+    set_Block_block_visited(get_nodes_block(n), 0);
     /* Compacting the Phi's ins might generate Phis with only one
        predecessor. */
     if (get_irn_arity(n) == 1)
@@ -358,10 +358,10 @@ copy_graph (void) {
   set_new_node(ob, nb);
 
   /* copy the live nodes */
-  irg_walk(get_nodes_Block(oe), copy_node, copy_preds, NULL);
+  irg_walk(get_nodes_block(oe), copy_node, copy_preds, NULL);
   /* copy_preds for the end node ... */
-  set_nodes_Block(ne, get_new_node(get_nodes_Block(oe)));
-  set_nodes_Block(nb, get_new_node(get_nodes_Block(ob)));
+  set_nodes_block(ne, get_new_node(get_nodes_block(oe)));
+  set_nodes_block(nb, get_new_node(get_nodes_block(ob)));
 
   /*- ... and now the keep alives. -*/
   /* First pick the not marked block nodes and walk them.  We must pick these
@@ -576,7 +576,7 @@ static void relink_bad_predecessors(ir_node *n, void *env) {
   if (get_irn_op(n) == op_Phi) {
 
     /* Relink predeseccors of phi's block */
-    block = get_nodes_Block(n);
+    block = get_nodes_block(n);
     if (get_irn_link(block) == NULL)
       relink_bad_block_predecessors(block, env);
 
@@ -704,6 +704,7 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
   if ( (prop != irg_inline_forced) && (!get_opt_optimize() || !get_opt_inline() ||
                                        (prop == irg_inline_forbidden))) return 0;
 
+
   /*
    * currently, we cannot inline two cases:
    * - call with compound arguments
@@ -718,8 +719,8 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
 
   /* Handle graph state */
   assert(get_irg_phase_state(current_ir_graph) != phase_building);
-  assert(get_irg_pinned(current_ir_graph) == pinned);
-  assert(get_irg_pinned(called_graph) == pinned);
+  assert(get_irg_pinned(current_ir_graph) == op_pin_state_pinned);
+  assert(get_irg_pinned(called_graph) == op_pin_state_pinned);
   if (get_irg_outs_state(current_ir_graph) == outs_consistent)
     set_irg_outs_inconsistent(current_ir_graph);
   set_irg_loopinfo_inconsistent(current_ir_graph);
@@ -727,8 +728,8 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
   /* -- Check preconditions -- */
   assert(get_irn_op(call) == op_Call);
   /* @@@ does not work for InterfaceIII.java after cgana
-     assert(get_Call_type(call) == get_entity_type(get_irg_ent(called_graph)));
-     assert(smaller_type(get_entity_type(get_irg_ent(called_graph)),
+     assert(get_Call_type(call) == get_entity_type(get_irg_entity(called_graph)));
+     assert(smaller_type(get_entity_type(get_irg_entity(called_graph)),
      get_Call_type(call)));
   */
   assert(get_type_tpop(get_Call_type(call)) == type_method);
@@ -762,7 +763,7 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
      the procedure and later replaces the Start node of the called graph.
      Post_call is the old Call node and collects the results of the called
      graph. Both will end up being a tuple.  -- */
-  post_bl = get_nodes_Block(call);
+  post_bl = get_nodes_block(call);
   set_irg_current_block(current_ir_graph, post_bl);
   /* XxMxPxP of Start + parameter of Call */
   in[pn_Start_X_initial_exec] = new_Jmp();
@@ -793,7 +794,7 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
      copying. */
   set_irn_link(get_irg_start(called_graph), pre_call);
   set_irn_visited(get_irg_start(called_graph), get_irg_visited(current_ir_graph));
-  set_irn_link(get_irg_start_block(called_graph), get_nodes_Block(pre_call));
+  set_irn_link(get_irg_start_block(called_graph), get_nodes_block(pre_call));
   set_irn_visited(get_irg_start_block(called_graph), get_irg_visited(current_ir_graph));
   set_irn_link(get_irg_bad(called_graph), get_irg_bad(current_ir_graph));
   set_irn_visited(get_irg_bad(called_graph), get_irg_visited(current_ir_graph));
@@ -867,7 +868,7 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
     ir_node *ret;
     ret = get_irn_n(end_bl, i);
     if (get_irn_op(ret) == op_Return) {
-      cf_pred[n_ret] = new_r_Jmp(current_ir_graph, get_nodes_Block(ret));
+      cf_pred[n_ret] = new_r_Jmp(current_ir_graph, get_nodes_block(ret));
       n_ret++;
     }
   }
@@ -888,7 +889,7 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
   phi = new_Phi(n_ret, cf_pred, mode_M);
   set_Tuple_pred(call, pn_Call_M_regular, phi);
   /* Conserve Phi-list for further inlinings -- but might be optimized */
-  if (get_nodes_Block(phi) == post_bl) {
+  if (get_nodes_block(phi) == post_bl) {
     set_irn_link(phi, get_irn_link(post_bl));
     set_irn_link(post_bl, phi);
   }
@@ -904,12 +905,12 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
         }
       }
       if (n_ret > 0)
-        phi = new_Phi(n_ret, cf_pred, get_irn_mode(cf_pred[0]));
+       phi = new_Phi(n_ret, cf_pred, get_irn_mode(cf_pred[0]));
       else
-        phi = new_Bad();
+       phi = new_Bad();
       res_pred[j] = phi;
       /* Conserve Phi-list for further inlinings -- but might be optimized */
-      if (get_nodes_Block(phi) == post_bl) {
+      if (get_nodes_block(phi) == post_bl) {
         set_irn_link(phi, get_irn_link(post_bl));
         set_irn_link(post_bl, phi);
       }
@@ -947,14 +948,14 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
         ir_node *ret;
         ret = skip_Proj(get_irn_n(end_bl, i));
         if (get_irn_op(ret) == op_Call) {
-          cf_pred[n_exc] = new_r_Proj(current_ir_graph, get_nodes_Block(ret), ret, mode_M, 3);
+          cf_pred[n_exc] = new_r_Proj(current_ir_graph, get_nodes_block(ret), ret, mode_M, 3);
           n_exc++;
         } else if (is_fragile_op(ret)) {
           /* We rely that all cfops have the memory output at the same position. */
-          cf_pred[n_exc] = new_r_Proj(current_ir_graph, get_nodes_Block(ret), ret, mode_M, 0);
+          cf_pred[n_exc] = new_r_Proj(current_ir_graph, get_nodes_block(ret), ret, mode_M, 0);
           n_exc++;
         } else if (get_irn_op(ret) == op_Raise) {
-          cf_pred[n_exc] = new_r_Proj(current_ir_graph, get_nodes_Block(ret), ret, mode_M, 1);
+          cf_pred[n_exc] = new_r_Proj(current_ir_graph, get_nodes_block(ret), ret, mode_M, 1);
           n_exc++;
         }
       }
@@ -1022,7 +1023,7 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
     }
     /* repair */
     if (i < get_Block_n_cfgpreds(end_bl)) {
-      bl = get_nodes_Block(cf_op);
+      bl = get_nodes_block(cf_op);
       arity = get_Block_n_cfgpreds(end_bl) + get_Block_n_cfgpreds(bl) - 1;
       cf_pred = (ir_node **) malloc (arity * sizeof (ir_node *));
       for (j = 0; j < i; j++)
@@ -1076,32 +1077,23 @@ static ir_graph *get_call_called_irg(ir_node *call) {
   if (get_irn_op(addr) == op_Const) {
     /* Check whether the constant is the pointer to a compiled entity. */
     tv = get_Const_tarval(addr);
-    if (get_tarval_entity(tv))
-      called_irg = get_entity_irg(get_tarval_entity(tv));
-  } else if (get_irn_op(addr) == op_SymConst && get_SymConst_kind(addr) == symconst_addr_ent) {
-    called_irg = get_entity_irg(get_SymConst_entity(addr));
   }
   return called_irg;
 }
 
 static void collect_calls(ir_node *call, void *env) {
-  inline_env_t *ienv = env;
   ir_node *addr;
-  tarval *tv;
-  ir_graph *called_irg;
 
   if (get_irn_op(call) != op_Call) return;
 
   addr = get_Call_ptr(call);
-  if (get_irn_op(addr) == op_Const) {
-    /* Check whether the constant is the pointer to a compiled entity. */
-    tv = get_Const_tarval(addr);
-    if (get_tarval_entity(tv)) {
-      called_irg = get_entity_irg(get_tarval_entity(tv));
-      if (called_irg && ienv->pos < MAX_INLINE) {
-        /* The Call node calls a locally defined method.  Remember to inline. */
-        ienv->calls[ienv->pos++] = call;
-      }
+
+  if (get_irn_op(addr) == op_SymConst) {
+    ir_graph *called_irg = get_entity_irg(get_SymConst_entity(addr));
+    inline_env_t *ienv = (inline_env_t *)env;
+    if (called_irg && ienv->pos < MAX_INLINE) {
+      /* The Call node calls a locally defined method.  Remember to inline. */
+      ienv->calls[ienv->pos++] = call;
     }
   }
 }
@@ -1117,7 +1109,7 @@ static void collect_calls(ir_node *call, void *env) {
 void inline_small_irgs(ir_graph *irg, int size) {
   int i;
   ir_graph *rem = current_ir_graph;
-  inline_env_t env;
+  inline_env_t env /* = {0, NULL}*/;
 
   if (!(get_opt_optimize() && get_opt_inline())) return;
 
@@ -1138,10 +1130,10 @@ void inline_small_irgs(ir_graph *irg, int size) {
     /* There are calls to inline */
     collect_phiprojs(irg);
     for (i = 0; i < env.pos; i++) {
-      tarval *tv;
       ir_graph *callee;
-      tv = get_Const_tarval(get_Call_ptr(env.calls[i]));
-      callee = get_entity_irg(get_tarval_entity(tv));
+      //tv = get_Const_tarval(get_Call_ptr(env.calls[i]));
+      //      callee = get_entity_irg(get_tarval_entity(tv));
+      callee = get_entity_irg(get_SymConst_entity(get_Call_ptr(env.calls[i])));
       if (((_obstack_memory_used(callee->obst) - obstack_room(callee->obst)) < size) ||
         (get_irg_inline_property(callee) == irg_inline_forced)) {
         inline_method(env.calls[i], callee);
@@ -1282,12 +1274,12 @@ void inline_leave_functions(int maxsize, int leavesize, int size) {
 /*         get_entity_name(get_irg_entity(callee))); */
           if (inline_method(call, callee)) {
             did_inline = 1;
-            env->n_call_nodes--;
-            eset_insert_all(env->call_nodes, callee_env->call_nodes);
-            env->n_call_nodes += callee_env->n_call_nodes;
-            env->n_nodes += callee_env->n_nodes;
-            callee_env->n_callers--;
-          }
+        env->n_call_nodes--;
+        eset_insert_all(env->call_nodes, callee_env->call_nodes);
+        env->n_call_nodes += callee_env->n_call_nodes;
+        env->n_nodes += callee_env->n_nodes;
+        callee_env->n_callers--;
+      }
         } else {
           eset_insert(env->call_nodes, call);
         }
@@ -1374,7 +1366,7 @@ place_floats_early(ir_node *n, pdeq *worklist)
   mark_irn_visited(n);
 
   /* Place floating nodes. */
-  if (get_op_pinned(get_irn_op(n)) == floats) {
+  if (get_op_pinned(get_irn_op(n)) == op_pin_state_floats) {
     int depth         = 0;
     ir_node *b        = new_Bad();   /* The block to place this node in */
     int bad_recursion = is_Bad(get_nodes_block(n));
@@ -1382,9 +1374,9 @@ place_floats_early(ir_node *n, pdeq *worklist)
     assert(get_irn_op(n) != op_Block);
 
     if ((get_irn_op(n) == op_Const) ||
-        (get_irn_op(n) == op_SymConst) ||
-        (is_Bad(n)) ||
-        (get_irn_op(n) == op_Unknown)) {
+    (get_irn_op(n) == op_SymConst) ||
+    (is_Bad(n)) ||
+    (get_irn_op(n) == op_Unknown)) {
       /* These nodes will not be placed by the loop below. */
       b = get_irg_start_block(current_ir_graph);
       depth = 1;
@@ -1397,8 +1389,8 @@ place_floats_early(ir_node *n, pdeq *worklist)
       ir_node *dep_block;
 
       if ((irn_not_visited(dep))
-          && (get_op_pinned(get_irn_op(dep)) == floats)) {
-        place_floats_early(dep, worklist);
+     && (get_op_pinned(get_irn_op(dep)) == op_pin_state_floats)) {
+    place_floats_early(dep, worklist);
       }
 
       /*
@@ -1408,23 +1400,23 @@ place_floats_early(ir_node *n, pdeq *worklist)
       if (bad_recursion)
         continue;
 
-      /* Because all loops contain at least one pinned node, now all
-         our inputs are either pinned or place_early has already
+      /* Because all loops contain at least one op_pin_state_pinned node, now all
+         our inputs are either op_pin_state_pinned or place_early has already
          been finished on them.  We do not have any unfinished inputs!  */
-      dep_block = get_nodes_Block(dep);
+      dep_block = get_nodes_block(dep);
       if ((!is_Bad(dep_block)) &&
-          (get_Block_dom_depth(dep_block) > depth)) {
-        b = dep_block;
-        depth = get_Block_dom_depth(dep_block);
+      (get_Block_dom_depth(dep_block) > depth)) {
+    b = dep_block;
+    depth = get_Block_dom_depth(dep_block);
       }
       /* Avoid that the node is placed in the Start block */
-      if ((depth == 1) && (get_Block_dom_depth(get_nodes_Block(n)) > 1)) {
-        b = get_Block_cfg_out(get_irg_start_block(current_ir_graph), 0);
-        assert(b != get_irg_start_block(current_ir_graph));
-        depth = 2;
+      if ((depth == 1) && (get_Block_dom_depth(get_nodes_block(n)) > 1)) {
+    b = get_Block_cfg_out(get_irg_start_block(current_ir_graph), 0);
+    assert(b != get_irg_start_block(current_ir_graph));
+    depth = 2;
       }
     }
-    set_nodes_Block(n, b);
+    set_nodes_block(n, b);
   }
 
   /* Add predecessors of non floating nodes on worklist. */
@@ -1440,9 +1432,9 @@ place_floats_early(ir_node *n, pdeq *worklist)
 
 /**
  * Floating nodes form subgraphs that begin at nodes as Const, Load,
- * Start, Call and that end at pinned nodes as Store, Call.  Place_early
+ * Start, Call and that end at op_pin_state_pinned nodes as Store, Call.  Place_early
  * places all floating nodes reachable from its argument through floating
- * nodes and adds all beginnings at pinned nodes to the worklist.
+ * nodes and adds all beginnings at op_pin_state_pinned nodes to the worklist.
  */
 static INLINE void place_early(pdeq* worklist) {
   assert(worklist);
@@ -1458,7 +1450,7 @@ static INLINE void place_early(pdeq* worklist) {
   }
 
   set_irg_outs_inconsistent(current_ir_graph);
-  current_ir_graph->pinned = pinned;
+  current_ir_graph->op_pin_state_pinned = op_pin_state_pinned;
 }
 
 
@@ -1474,16 +1466,16 @@ consumer_dom_dca (ir_node *dca, ir_node *consumer, ir_node *producer)
     /* our consumer is a Phi-node, the effective use is in all those
        blocks through which the Phi-node reaches producer */
     int i, irn_arity;
-    ir_node *phi_block = get_nodes_Block(consumer);
+    ir_node *phi_block = get_nodes_block(consumer);
     irn_arity = get_irn_arity(consumer);
     for (i = 0;  i < irn_arity; i++) {
       if (get_irn_n(consumer, i) == producer) {
-        block = get_nodes_Block(get_Block_cfgpred(phi_block, i));
+    block = get_nodes_block(get_Block_cfgpred(phi_block, i));
       }
     }
   } else {
     assert(is_no_Block(consumer));
-    block = get_nodes_Block(consumer);
+    block = get_nodes_block(consumer);
   }
 
   /* Compute the deepest common ancestor of block and dca. */
@@ -1517,7 +1509,7 @@ move_out_of_loops (ir_node *n, ir_node *early)
   /* Find the region deepest in the dominator tree dominating
      dca with the least loop nesting depth, but still dominated
      by our early placement. */
-  dca = get_nodes_Block(n);
+  dca = get_nodes_block(n);
   best = dca;
   while (dca != early) {
     dca = get_Block_idom(dca);
@@ -1526,14 +1518,14 @@ move_out_of_loops (ir_node *n, ir_node *early)
       best = dca;
     }
   }
-  if (best != get_nodes_Block(n)) {
+  if (best != get_nodes_block(n)) {
     /* debug output
     printf("Moving out of loop: "); DDMN(n);
     printf(" Outermost block: "); DDMN(early);
     printf(" Best block: "); DDMN(best);
-    printf(" Innermost block: "); DDMN(get_nodes_Block(n));
+    printf(" Innermost block: "); DDMN(get_nodes_block(n));
     */
-    set_nodes_Block(n, best);
+    set_nodes_block(n, best);
   }
 }
 
@@ -1559,34 +1551,34 @@ place_floats_late(ir_node *n, pdeq *worklist)
       (get_irn_mode(n) != mode_X)) {
     /* Remember the early placement of this block to move it
        out of loop no further than the early placement. */
-    early = get_nodes_Block(n);
+    early = get_nodes_block(n);
     /* Assure that our users are all placed, except the Phi-nodes.
        --- Each data flow cycle contains at least one Phi-node.  We
        have to break the `user has to be placed before the
        producer' dependence cycle and the Phi-nodes are the
        place to do so, because we need to base our placement on the
        final region of our users, which is OK with Phi-nodes, as they
-       are pinned, and they never have to be placed after a
+       are op_pin_state_pinned, and they never have to be placed after a
        producer of one of their inputs in the same block anyway. */
     for (i = 0; i < get_irn_n_outs(n); i++) {
       ir_node *succ = get_irn_out(n, i);
       if (irn_not_visited(succ) && (get_irn_op(succ) != op_Phi))
-        place_floats_late(succ, worklist);
+    place_floats_late(succ, worklist);
     }
 
     /* We have to determine the final block of this node... except for
        constants. */
-    if ((get_op_pinned(get_irn_op(n)) == floats) &&
-        (get_irn_op(n) != op_Const) &&
-        (get_irn_op(n) != op_SymConst)) {
+    if ((get_op_pinned(get_irn_op(n)) == op_pin_state_floats) &&
+    (get_irn_op(n) != op_Const) &&
+    (get_irn_op(n) != op_SymConst)) {
       ir_node *dca = NULL;  /* deepest common ancestor in the
                    dominator tree of all nodes'
                    blocks depending on us; our final
                    placement has to dominate DCA. */
       for (i = 0; i < get_irn_n_outs(n); i++) {
-        dca = consumer_dom_dca (dca, get_irn_out(n, i), n);
+    dca = consumer_dom_dca (dca, get_irn_out(n, i), n);
       }
-      set_nodes_Block(n, dca);
+      set_nodes_block(n, dca);
 
       move_out_of_loops (n, early);
     }
@@ -1603,7 +1595,7 @@ place_floats_late(ir_node *n, pdeq *worklist)
   }
 }
 
-static INLINE void place_late(pdeq *worklist) {
+static INLINE void place_late(pdeqworklist) {
   assert(worklist);
   inc_irg_visited(current_ir_graph);
 
@@ -1676,14 +1668,14 @@ static void merge_blocks(ir_node *n, void *env) {
       /* GL @@@ : is this possible? if (get_opt_normalize()) -- added, all tests go through.
        A different order of optimizations might cause problems. */
       if (get_opt_normalize())
-        set_Block_cfgpred(n, i, skip_Tuple(get_Block_cfgpred(n, i)));
+    set_Block_cfgpred(n, i, skip_Tuple(get_Block_cfgpred(n, i)));
   } else if (get_opt_optimize() && (get_irn_mode(n) == mode_X)) {
     /* We will soon visit a block.  Optimize it before visiting! */
-    ir_node *b = get_nodes_Block(n);
+    ir_node *b = get_nodes_block(n);
     ir_node *new_node = equivalent_node(b);
     while (irn_not_visited(b) && (!is_Bad(new_node)) && (new_node != b)) {
       /* We would have to run gigo if new is bad, so we
-         promote it directly below. */
+     promote it directly below. */
       assert(((b == new_node) ||
           get_opt_control_flow_straightening() ||
           get_opt_control_flow_weak_simplification()) &&
@@ -1700,59 +1692,16 @@ static void merge_blocks(ir_node *n, void *env) {
  * Collects all Phi nodes in link list of Block.
  * Marks all blocks "block_visited" if they contain a node other
  * than Jmp.
- *
- * Colelct Conds and its Projs in the cond_list
  */
 static void collect_nodes(ir_node *n, void *env) {
-  ir_node **cond_list = env;
-
   if (is_no_Block(n)) {
-    ir_node *b = get_nodes_Block(n);
+    ir_node *b = get_nodes_block(n);
 
-    switch (get_irn_opcode(n)) {
-
-    case iro_Phi:
+    if ((get_irn_op(n) == op_Phi)) {
       /* Collect Phi nodes to compact ins along with block's ins. */
       set_irn_link(n, get_irn_link(b));
       set_irn_link(b, n);
-      break;
-
-    case iro_Cond:
-      {
-        ir_node *value = get_Cond_selector(n);
-        tarval *tv = computed_value(value);
-
-        if (tv != tarval_bad && mode_is_int(get_tarval_mode(tv))) {
-          set_irn_link(n, *cond_list);
-          *cond_list = n;
-        }
-        else { /* mark the cond, we cannot optimize it */
-          set_irn_link(n, NULL);
-        }
-      }
-      break;
-
-    case iro_Proj:
-      {
-        ir_node *cond = get_Proj_pred(n);
-
-        if (get_irn_op(cond) == op_Cond) {
-          void *link = get_irn_link(cond);
-
-          if (link) {
-            /* the cond node can be optimized, collect Proj */
-            set_irn_link(n, link);
-            set_irn_link(cond, n);
-          }
-        }
-      }
-      break;
-
-    default:
-      break;
-    }
-
-    if ((get_irn_op(n) != op_Jmp) && !is_Bad(b)) {  /* Check for non empty block. */
+    } else if ((get_irn_op(n) != op_Jmp) && !is_Bad(b)) {  /* Check for non empty block. */
       mark_Block_block_visited(b);
     }
   }
@@ -1762,7 +1711,7 @@ static void collect_nodes(ir_node *n, void *env) {
 static int is_pred_of(ir_node *pred, ir_node *b) {
   int i;
   for (i = 0; i < get_Block_n_cfgpreds(b); i++) {
-    ir_node *b_pred = get_nodes_Block(get_Block_cfgpred(b, i));
+    ir_node *b_pred = get_nodes_block(get_Block_cfgpred(b, i));
     if (b_pred == pred) return 1;
   }
   return 0;
@@ -1772,7 +1721,7 @@ static int test_whether_dispensable(ir_node *b, int pos) {
   int i, j, n_preds = 1;
   int dispensable = 1;
   ir_node *cfop = get_Block_cfgpred(b, pos);
-  ir_node *pred = get_nodes_Block(cfop);
+  ir_node *pred = get_nodes_block(cfop);
 
   if (get_Block_block_visited(pred) + 1
       < get_irg_block_visited(current_ir_graph)) {
@@ -1787,26 +1736,26 @@ static int test_whether_dispensable(ir_node *b, int pos) {
       n_preds = get_Block_n_cfgpreds(pred);
     } else {
       /* b's pred blocks and pred's pred blocks must be pairwise disjunct.
-         Work preds < pos as if they were already removed. */
+     Work preds < pos as if they were already removed. */
       for (i = 0; i < pos; i++) {
-        ir_node *b_pred = get_nodes_Block(get_Block_cfgpred(b, i));
-        if (get_Block_block_visited(b_pred) + 1
-            < get_irg_block_visited(current_ir_graph)) {
-          for (j = 0; j < get_Block_n_cfgpreds(b_pred); j++) {
-            ir_node *b_pred_pred = get_nodes_Block(get_Block_cfgpred(b_pred, j));
-            if (is_pred_of(b_pred_pred, pred)) dispensable = 0;
-          }
-        } else {
-          if (is_pred_of(b_pred, pred)) dispensable = 0;
-        }
+    ir_node *b_pred = get_nodes_block(get_Block_cfgpred(b, i));
+    if (get_Block_block_visited(b_pred) + 1
+        < get_irg_block_visited(current_ir_graph)) {
+      for (j = 0; j < get_Block_n_cfgpreds(b_pred); j++) {
+        ir_node *b_pred_pred = get_nodes_block(get_Block_cfgpred(b_pred, j));
+        if (is_pred_of(b_pred_pred, pred)) dispensable = 0;
+      }
+    } else {
+      if (is_pred_of(b_pred, pred)) dispensable = 0;
+    }
       }
       for (i = pos +1; i < get_Block_n_cfgpreds(b); i++) {
-        ir_node *b_pred = get_nodes_Block(get_Block_cfgpred(b, i));
-        if (is_pred_of(b_pred, pred)) dispensable = 0;
+    ir_node *b_pred = get_nodes_block(get_Block_cfgpred(b, i));
+    if (is_pred_of(b_pred, pred)) dispensable = 0;
       }
       if (!dispensable) {
-        set_Block_block_visited(pred, get_irg_block_visited(current_ir_graph)-1);
-        n_preds = 1;
+    set_Block_block_visited(pred, get_irg_block_visited(current_ir_graph)-1);
+    n_preds = 1;
       } else {
         n_preds = get_Block_n_cfgpreds(pred);
       }
@@ -1832,7 +1781,7 @@ static void optimize_blocks(ir_node *b, void *env) {
 /*-
   printf(" working on "); DDMN(b);
   for (i = 0; i < get_Block_n_cfgpreds(b); i++) {
-    pred = get_nodes_Block(get_Block_cfgpred(b, i));
+    pred = get_nodes_block(get_Block_cfgpred(b, i));
     if (is_Bad(get_Block_cfgpred(b, i))) {
       printf("  removing Bad %i\n ", i);
     } else if (get_Block_block_visited(pred) +1
@@ -1849,37 +1798,37 @@ static void optimize_blocks(ir_node *b, void *env) {
     /* Find the new predecessors for the Phi */
     n_preds = 0;
     for (i = 0; i < get_Block_n_cfgpreds(b); i++) {
-      pred = get_nodes_Block(get_Block_cfgpred(b, i));
+      pred = get_nodes_block(get_Block_cfgpred(b, i));
       if (is_Bad(get_Block_cfgpred(b, i))) {
-        /* Do nothing */
+    /* Do nothing */
       } else if (get_Block_block_visited(pred) +1
-                 < get_irg_block_visited(current_ir_graph)) {
-        /* It's an empty block and not yet visited. */
-        ir_node *phi_pred = get_Phi_pred(phi, i);
-        for (j = 0; j < get_Block_n_cfgpreds(pred); j++) {
-          if (get_nodes_Block(phi_pred) == pred) {
-            assert(get_irn_op(phi_pred) == op_Phi);  /* Block is empty!! */
-            in[n_preds] = get_Phi_pred(phi_pred, j);
-          } else {
-            in[n_preds] = phi_pred;
-          }
-          n_preds++;
-        }
-        /* The Phi_pred node is replaced now if it is a Phi.
-           In Schleifen kann offenbar der entfernte Phi Knoten legal verwendet werden.
-           Daher muss der Phiknoten durch den neuen ersetzt werden.
-           Weiter muss der alte Phiknoten entfernt werden (durch ersetzen oder
-           durch einen Bad) damit er aus den keep_alive verschwinden kann.
-           Man sollte also, falls keine Schleife vorliegt, exchange mit new_Bad
-           aufrufen.  */
-        if (get_nodes_Block(phi_pred) == pred) {
-          /* remove the Phi as it might be kept alive. Further there
-             might be other users. */
-          exchange(phi_pred, phi);  /* geht, ist aber doch semantisch falsch! Warum?? */
-        }
+         < get_irg_block_visited(current_ir_graph)) {
+    /* It's an empty block and not yet visited. */
+    ir_node *phi_pred = get_Phi_pred(phi, i);
+    for (j = 0; j < get_Block_n_cfgpreds(pred); j++) {
+      if (get_nodes_block(phi_pred) == pred) {
+        assert(get_irn_op(phi_pred) == op_Phi);  /* Block is empty!! */
+        in[n_preds] = get_Phi_pred(phi_pred, j);
       } else {
-        in[n_preds] = get_Phi_pred(phi, i);
-        n_preds ++;
+        in[n_preds] = phi_pred;
+      }
+      n_preds++;
+    }
+    /* The Phi_pred node is replaced now if it is a Phi.
+       In Schleifen kann offenbar der entfernte Phi Knoten legal verwendet werden.
+       Daher muss der Phiknoten durch den neuen ersetzt werden.
+       Weiter muss der alte Phiknoten entfernt werden (durch ersetzen oder
+       durch einen Bad) damit er aus den keep_alive verschwinden kann.
+       Man sollte also, falls keine Schleife vorliegt, exchange mit new_Bad
+       aufrufen.  */
+    if (get_nodes_block(phi_pred) == pred) {
+      /* remove the Phi as it might be kept alive. Further there
+         might be other users. */
+      exchange(phi_pred, phi);  /* geht, ist aber doch semantisch falsch! Warum?? */
+    }
+      } else {
+    in[n_preds] = get_Phi_pred(phi, i);
+    n_preds ++;
       }
     }
     /* Fix the node */
@@ -1888,58 +1837,59 @@ static void optimize_blocks(ir_node *b, void *env) {
     phi = get_irn_link(phi);
   }
 
-  /*- This happens only if merge between loop backedge and single loop entry. -*/
+/*-
+      This happens only if merge between loop backedge and single loop entry. -*/
   for (k = 0; k < get_Block_n_cfgpreds(b); k++) {
-    pred = get_nodes_Block(get_Block_cfgpred(b, k));
+    pred = get_nodes_block(get_Block_cfgpred(b, k));
     if (get_Block_block_visited(pred)+1 < get_irg_block_visited(current_ir_graph)) {
       phi = get_irn_link(pred);
       while (phi) {
-        if (get_irn_op(phi) == op_Phi) {
-          set_nodes_Block(phi, b);
-
-          n_preds = 0;
-          for (i = 0; i < k; i++) {
-            pred = get_nodes_Block(get_Block_cfgpred(b, i));
-            if (is_Bad(get_Block_cfgpred(b, i))) {
-              /* Do nothing */
-            } else if (get_Block_block_visited(pred) +1
-                       < get_irg_block_visited(current_ir_graph)) {
-              /* It's an empty block and not yet visited. */
-              for (j = 0; j < get_Block_n_cfgpreds(pred); j++) {
-                /* @@@ Hier brauche ich Schleifeninformation!!! Kontrollflusskante
-                   muss Rueckwaertskante sein! (An allen vier in[n_preds] = phi
-                   Anweisungen.) Trotzdem tuts bisher!! */
-                in[n_preds] = phi;
-                n_preds++;
-              }
-            } else {
-              in[n_preds] = phi;
-              n_preds++;
-            }
-          }
-          for (i = 0; i < get_Phi_n_preds(phi); i++) {
-            in[n_preds] = get_Phi_pred(phi, i);
-            n_preds++;
+    if (get_irn_op(phi) == op_Phi) {
+      set_nodes_block(phi, b);
+
+      n_preds = 0;
+      for (i = 0; i < k; i++) {
+        pred = get_nodes_block(get_Block_cfgpred(b, i));
+        if (is_Bad(get_Block_cfgpred(b, i))) {
+          /* Do nothing */
+        } else if (get_Block_block_visited(pred) +1
+           < get_irg_block_visited(current_ir_graph)) {
+          /* It's an empty block and not yet visited. */
+          for (j = 0; j < get_Block_n_cfgpreds(pred); j++) {
+        /* @@@ Hier brauche ich Schleifeninformation!!! Kontrollflusskante
+           muss Rueckwaertskante sein! (An allen vier in[n_preds] = phi
+           Anweisungen.) Trotzdem tuts bisher!! */
+        in[n_preds] = phi;
+        n_preds++;
           }
-          for (i = k+1; i < get_Block_n_cfgpreds(b); i++) {
-            pred = get_nodes_Block(get_Block_cfgpred(b, i));
-            if (is_Bad(get_Block_cfgpred(b, i))) {
-              /* Do nothing */
-            } else if (get_Block_block_visited(pred) +1
-                       < get_irg_block_visited(current_ir_graph)) {
-              /* It's an empty block and not yet visited. */
-              for (j = 0; j < get_Block_n_cfgpreds(pred); j++) {
-                in[n_preds] = phi;
-                n_preds++;
-              }
-            } else {
-              in[n_preds] = phi;
-              n_preds++;
-            }
+        } else {
+          in[n_preds] = phi;
+          n_preds++;
+        }
+      }
+      for (i = 0; i < get_Phi_n_preds(phi); i++) {
+        in[n_preds] = get_Phi_pred(phi, i);
+        n_preds++;
+      }
+      for (i = k+1; i < get_Block_n_cfgpreds(b); i++) {
+        pred = get_nodes_block(get_Block_cfgpred(b, i));
+        if (is_Bad(get_Block_cfgpred(b, i))) {
+          /* Do nothing */
+        } else if (get_Block_block_visited(pred) +1
+           < get_irg_block_visited(current_ir_graph)) {
+          /* It's an empty block and not yet visited. */
+          for (j = 0; j < get_Block_n_cfgpreds(pred); j++) {
+        in[n_preds] = phi;
+        n_preds++;
           }
-          set_irn_in(phi, n_preds, in);
+        } else {
+          in[n_preds] = phi;
+          n_preds++;
         }
-        phi = get_irn_link(phi);
+      }
+      set_irn_in(phi, n_preds, in);
+    }
+    phi = get_irn_link(phi);
       }
     }
   }
@@ -1947,7 +1897,7 @@ static void optimize_blocks(ir_node *b, void *env) {
   /*- Fix the block -*/
   n_preds = 0;
   for (i = 0; i < get_Block_n_cfgpreds(b); i++) {
-    pred = get_nodes_Block(get_Block_cfgpred(b, i));
+    pred = get_nodes_block(get_Block_cfgpred(b, i));
     if (is_Bad(get_Block_cfgpred(b, i))) {
       /* Do nothing */
     } else if (get_Block_block_visited(pred) +1
@@ -1956,8 +1906,8 @@ static void optimize_blocks(ir_node *b, void *env) {
       assert(get_Block_n_cfgpreds(b) > 1);
                         /* Else it should be optimized by equivalent_node. */
       for (j = 0; j < get_Block_n_cfgpreds(pred); j++) {
-        in[n_preds] = get_Block_cfgpred(pred, j);
-        n_preds++;
+    in[n_preds] = get_Block_cfgpred(pred, j);
+    n_preds++;
       }
       /* Remove block as it might be kept alive. */
       exchange(pred, b/*new_Bad()*/);
@@ -1970,70 +1920,12 @@ static void optimize_blocks(ir_node *b, void *env) {
   free(in);
 }
 
-/**
- * an impossible ir_node * != NULL
- */
-static const char _anchor;
-#define ANCHOR  ((ir_node *)&_anchor)
-
-/**
- * optimize constant cond with projs
- *
- * If we come here, we should have 3 situations:
- *
- * 1.) Only one Proj exists: This should be the default Proj, convert to jump
- * 2.) Two Proj's exists: One is the taken, the other the not-taken default proj
- * 3.) More than 2 Proj's: local_optimize() did not run or internal error do nothing
- */
-static void optimize_const_conds(ir_node *cond_list)
-{
-  ir_node *cond, *next;
-
-  for (cond = cond_list; cond != ANCHOR; cond = next) {
-    ir_node *block, *jmp;
-    ir_node *proj = NULL, *def_proj = NULL;
-    int num = 0;
-
-    for (next = get_irn_link(cond); next != ANCHOR; next = get_irn_link(next)) {
-      if (get_irn_op(next) == op_Cond)
-        break;
-
-      assert(get_irn_op(next) == op_Proj && "something neither Cond not Proj in cond-list");
-      assert(get_Proj_pred(next) == cond && "cond-list corrupt");
-
-      if (get_Proj_proj(next) == get_Cond_defaultProj(cond))
-        def_proj = next;
-      else
-        proj = next;
-      ++num;
-    }
-
-    if (num == 1) {
-      assert(def_proj);
-
-      block = get_nodes_block(def_proj);
-      jmp = new_rd_Jmp(get_irn_dbg_info(def_proj), current_ir_graph, block);
-      exchange(def_proj, jmp);
-    }
-    else if (num == 2) {
-      assert(def_proj && proj);
-
-      exchange(def_proj, new_Bad());
-
-      block = get_nodes_block(proj);
-      jmp = new_rd_Jmp(get_irn_dbg_info(proj), current_ir_graph, block);
-      exchange(proj, jmp);
-    }
-  }
-}
-
 void optimize_cf(ir_graph *irg) {
   int i;
   ir_node **in;
   ir_node *end = get_irg_end(irg);
   ir_graph *rem = current_ir_graph;
   current_ir_graph = irg;
-  ir_node *cond_list = ANCHOR;
 
   /* Handle graph state */
   assert(get_irg_phase_state(irg) != phase_building);
@@ -2044,11 +1936,7 @@ void optimize_cf(ir_graph *irg) {
 
   /* Use block visited flag to mark non-empty blocks. */
   inc_irg_block_visited(irg);
-  irg_walk(end, merge_blocks, collect_nodes, &cond_list);
-
-  /* now, optimize switches */
-  if (get_opt_unreachable_code())
-    optimize_const_conds(cond_list);
+  irg_walk(end, merge_blocks, collect_nodes, NULL);
 
   /* Optimize the standard code. */
   irg_block_walk(get_irg_end_block(irg), optimize_blocks, NULL, NULL);
@@ -2056,20 +1944,20 @@ void optimize_cf(ir_graph *irg) {
   /* Walk all keep alives, optimize them if block, add to new in-array
      for end if useful. */
   in = NEW_ARR_F (ir_node *, 1);
-  in[0] = get_nodes_Block(end);
+  in[0] = get_nodes_block(end);
   inc_irg_visited(current_ir_graph);
   for(i = 0; i < get_End_n_keepalives(end); i++) {
     ir_node *ka = get_End_keepalive(end, i);
     if (irn_not_visited(ka)) {
       if ((get_irn_op(ka) == op_Block) && Block_not_block_visited(ka)) {
-       set_irg_block_visited(current_ir_graph,  /* Don't walk all the way to Start. */
-                             get_irg_block_visited(current_ir_graph)-1);
-       irg_block_walk(ka, optimize_blocks, NULL, NULL);
-       mark_irn_visited(ka);
-       ARR_APP1 (ir_node *, in, ka);
+    set_irg_block_visited(current_ir_graph,  /* Don't walk all the way to Start. */
+              get_irg_block_visited(current_ir_graph)-1);
+    irg_block_walk(ka, optimize_blocks, NULL, NULL);
+    mark_irn_visited(ka);
+    ARR_APP1 (ir_node *, in, ka);
       } else if (get_irn_op(ka) == op_Phi) {
-        mark_irn_visited(ka);
-        ARR_APP1 (ir_node *, in, ka);
+    mark_irn_visited(ka);
+    ARR_APP1 (ir_node *, in, ka);
       }
     }
   }
@@ -2094,32 +1982,32 @@ static void walk_critical_cf_edges(ir_node *n, void *env) {
   int arity, i;
   ir_node *pre, *block, **in, *jmp;
 
-  arity = get_irn_arity(n);
-
   /* Block has multiple predecessors */
-  if (op_Block == get_irn_op(n) && arity > 1) {
+  if ((op_Block == get_irn_op(n)) &&
+      (get_irn_arity(n) > 1)) {
+    arity = get_irn_arity(n);
 
     if (n == get_irg_end_block(current_ir_graph))
       return;  /*  No use to add a block here.      */
 
-    for (i = 0; i < arity; ++i) {
+    for (i=0; i<arity; i++) {
       pre = get_irn_n(n, i);
       /* Predecessor has multiple successors. Insert new flow edge */
       if ((NULL != pre) &&
-        (op_Proj == get_irn_op(pre)) &&
-        op_Raise != get_irn_op(skip_Proj(pre))) {
-
-        /* set predecessor array for new block */
-        in = NEW_ARR_D (ir_node *, current_ir_graph->obst, 1);
-        /* set predecessor of new block */
-        in[0] = pre;
-        block = new_Block(1, in);
-        /* insert new jmp node to new block */
-        switch_block(block);
-        jmp = new_Jmp();
-        switch_block(n);
-        /* set successor of new block */
-        set_irn_n(n, i, jmp);
+    (op_Proj == get_irn_op(pre)) &&
+    op_Raise != get_irn_op(skip_Proj(pre))) {
+
+    /* set predecessor array for new block */
+    in = NEW_ARR_D (ir_node *, current_ir_graph->obst, 1);
+    /* set predecessor of new block */
+    in[0] = pre;
+    block = new_Block(1, in);
+    /* insert new jmp node to new block */
+    set_cur_block(block);
+    jmp = new_Jmp();
+    set_cur_block(n);
+    /* set successor of new block */
+    set_irn_n(n, i, jmp);
 
       } /* predecessor has multiple successors */
     } /* for all predecessors */
index 3d0e8da..e66d893 100644 (file)
@@ -45,7 +45,7 @@ void local_optimize_graph (ir_graph *irg);
  *  Dead_node_elimination is only performed if options `optimize' and
  *  `opt_dead_node_elimination' are set.  The graph may
  *  not be in state phase_building.  The outs datasturcture is freed,
- *  the outs state set to no_outs.  Backedge information is conserved.
+ *  the outs state set to outs_none.  Backedge information is conserved.
  *  Removes old attributes of nodes.  Sets link field to NULL.
  *  Callee information must be freed (irg_callee_info_none).
  *
@@ -87,7 +87,7 @@ void remove_bad_predecessors(ir_graph *irg);
  *  Sets visited masterflag in current_ir_graph to the max of the flag in
  *  current and called graph.
  *  Assumes that both, the called and the calling graph are in state
- *  "pinned".
+ *  "op_pin_state_pinned".
  *  It is recommended to call local_optimize_graph after inlining as this
  *  function leaves a set of obscure Tuple nodes, e.g. a Proj-Tuple-Jmp
  *  combination as control flow operation.
index c6216fd..a35e8ef 100644 (file)
@@ -46,7 +46,7 @@ INLINE void set_interprocedural_view(bool state) {
 
 static ident* frame_type_suffix = NULL;
 void init_irgraph(void) {
-  frame_type_suffix = id_from_str(FRAME_TP_SUFFIX, strlen(FRAME_TP_SUFFIX));
+  frame_type_suffix = new_id_from_chars(FRAME_TP_SUFFIX, strlen(FRAME_TP_SUFFIX));
 }
 
 #if USE_EXPLICIT_PHI_IN_STACK
@@ -113,9 +113,9 @@ new_ir_graph (entity *ent, int n_loc)
   res->outs = NULL;
 
   res->phase_state    = phase_building;
-  res->pinned         = pinned;
-  res->outs_state     = no_outs;
-  res->dom_state      = no_dom;
+  res->op_pin_state_pinned = op_pin_state_pinned;
+  res->outs_state     = outs_none;
+  res->dom_state      = dom_none;
   res->typeinfo_state = irg_typeinfo_none;
   res->loopinfo_state = loopinfo_none;
 
@@ -141,28 +141,27 @@ new_ir_graph (entity *ent, int n_loc)
   /* res->unknown = new_ir_node (NULL, res, res->start_block, op_Unknown, mode_T, 0, NULL); */
 
   /* Proj results of start node */
-  projX            = new_Proj (res->start, mode_X, pns_initial_exec);
-  res->frame       = new_Proj (res->start, mode_P_mach, pns_frame_base);
-  res->globals     = new_Proj (res->start, mode_P_mach, pns_globals);
-  res->initial_mem = new_Proj (res->start, mode_M, pns_global_store);
-  res->args        = new_Proj (res->start, mode_T, pns_args);
+  projX            = new_Proj (res->start, mode_X, pn_Start_X_initial_exec);
+  res->frame       = new_Proj (res->start, mode_P_mach, pn_Start_P_frame_base);   res->globals     = new_Proj (res->start, mode_P_mach, pn_Start_P_globals);
+  res->initial_mem = new_Proj (res->start, mode_M, pn_Start_M);
+  res->args        = new_Proj (res->start, mode_T, pn_Start_T_args);
 #ifdef DEBUG_libfirm
   res->graph_nr    = get_irp_new_node_nr();
 #endif
 
   set_store(res->initial_mem);
 
-  add_in_edge(res->start_block, projX);
+  add_immBlock_pred(res->start_block, projX);
   /*
    * The code generation needs it. leave it in now.
    * Use of this edge is matter of discussion, unresolved. Also possible:
-   * add_in_edge(res->start_block, res->start_block), but invalid typed.
+   * add_immBlock_pred(res->start_block, res->start_block), but invalid typed.
    */
-  mature_block (res->current_block);
+  mature_immBlock (res->current_block);
 
   /*-- Make a block to start with --*/
   first_block = new_immBlock();
-  add_in_edge (first_block, projX);
+  add_immBlock_pred (first_block, projX);
 
   return res;
 }
@@ -191,31 +190,27 @@ ir_graph *new_const_code_irg(void) {
   res->obst      = (struct obstack *) xmalloc (sizeof (struct obstack));
   obstack_init (res->obst);
   res->phase_state = phase_building;
-  res->pinned      = pinned;
+  res->op_pin_state_pinned = op_pin_state_pinned;
   res->value_table = new_identities (); /* value table for global value
                        numbering for optimizing use in
                        iropt.c */
   res->ent = NULL;
   res->frame_type  = NULL;
   res->start_block = new_immBlock ();
-  res->end_block   = new_immBlock ();
-  res->end         = new_End ();
-  res->end_reg     = res->end;
-  res->end_except  = res->end;
-  mature_block(get_cur_block());
+  res->end_block  = new_immBlock ();
+  res->end        = new_End ();
+  res->end_reg    = res->end;
+  res->end_except = res->end;
+  mature_immBlock(get_cur_block());
   res->bad = new_ir_node (NULL, res, res->start_block, op_Bad, mode_T, 0, NULL);
   res->start   = new_Start ();
 
   /* Proj results of start node */
-  projX            = new_Proj (res->start, mode_X, pns_initial_exec);
-  res->initial_mem = new_Proj (res->start, mode_M, pns_global_store);
-
-  set_store(res->initial_mem);
-  add_in_edge(res->start_block, projX);
-
-  mature_block (res->current_block);
-  add_in_edge (new_immBlock (), projX);
-  mature_block(get_cur_block());
+  projX        = new_Proj (res->start, mode_X, pn_Start_X_initial_exec);
+  add_immBlock_pred(res->start_block, projX);
+  mature_immBlock (res->current_block);
+  add_immBlock_pred (new_immBlock (), projX);
+  mature_immBlock(get_cur_block());
   /* Set the visited flag high enough that the block will never be visited. */
   set_irn_visited(get_cur_block(), -1);
   set_Block_block_visited(get_cur_block(), -1);
@@ -239,7 +234,7 @@ void  del_identities (pset *value_table);
    graph, nor the entity standing for this graph. */
 void free_ir_graph (ir_graph *irg) {
   stat_free_graph(irg);
-  if (irg->outs_state != no_outs) free_outs(irg);
+  if (irg->outs_state != outs_none) free_outs(irg);
   if (irg->frame_type)  free_type(irg->frame_type);
   if (irg->value_table) del_identities(irg->value_table);
   if (irg->ent) {
@@ -427,12 +422,12 @@ void
 }
 
 entity *
-(get_irg_ent)(ir_graph *irg) {
+(get_irg_entity)(ir_graph *irg) {
   return __get_irg_ent(irg);
 }
 
 void
-(set_irg_ent)(ir_graph *irg, entity *ent) {
+(set_irg_entity)(ir_graph *irg, entity *ent) {
   __set_irg_ent(irg, ent);
 }
 
@@ -517,7 +512,7 @@ void
   __set_irg_phase_low(irg);
 }
 
-op_pinned
+op_pin_state
 (get_irg_pinned)(ir_graph *irg) {
   return __get_irg_pinned(irg);
 }
@@ -568,7 +563,7 @@ set_irg_loopinfo_inconsistent(ir_graph *irg) {
 }
 
 void
-(set_irg_pinned)(ir_graph *irg, op_pinned p) {
+(set_irg_pinned)(ir_graph *irg, op_pin_state p) {
   __set_irg_pinned(irg, p);
 }
 
index 2250edc..e079c20 100644 (file)
@@ -24,6 +24,7 @@
 # ifndef _IRGRAPH_H_
 # define _IRGRAPH_H_
 # include "tv.h"
+# include "entity.h"
 
 /* to resolve recursion between irnode.h and irgraph.h */
 #ifndef _IR_NODE_TYPEDEF_
@@ -70,8 +71,8 @@ typedef struct ir_graph ir_graph;
  *    datastructure is used to build the Phi nodes and removed after
  *    completion of the graph.  There is no path from end to start in the
  *    graph after calling ir_graph.
- *   pinned    set to "pinned" if no global cse was performed on the graph.
- *             set to "floats" if global cse was performed (and during construction:
+ *    op_pin_state_pinned    set to "op_pin_state_pinned" if no global cse was performed on the graph.
+ *             set to "op_pin_state_floats" if global cse was performed (and during construction:
  *             did actually change something).  Code placement is necessary.
  */
 
@@ -99,7 +100,7 @@ void set_interprocedural_view(bool state);
  *  n_loc is the number of local variables in this procedure including
  *  the procedure parameters.
  *  The constructor adds the new irgraph to the list in ir_prog.
- *  The state of the ir graph is:  phase_building, pinned, no_outs. */
+ *  The state of the ir graph is:  phase_building, op_pin_state_pinned, outs_none. */
 ir_graph *new_ir_graph (entity *ent, int n_loc);
 
 /** Frees the passed irgraph.
@@ -124,10 +125,10 @@ void free_ir_graph (ir_graph *irg);
  */
 int      is_ir_graph(void *thing);
 
-#define get_irg_entity get_irg_ent
-#define set_irg_entity set_irg_ent
-entity  *get_irg_ent (ir_graph *irg);
-void     set_irg_ent (ir_graph *irg, entity *ent);
+//#define get_irg_entity get_irg_ent
+//#define set_irg_entity set_irg_ent
+entity  *get_irg_entity (ir_graph *irg);
+void     set_irg_entity (ir_graph *irg, entity *ent);
 
 type    *get_irg_frame_type (ir_graph *irg);
 void     set_irg_frame_type (ir_graph *irg, type *ftp);
@@ -229,24 +230,24 @@ typedef enum {
 irg_phase_state get_irg_phase_state (ir_graph *irg);
 void set_irg_phase_low(ir_graph *irg);
 
-/** state: pinned
-   The graph is "pinned" if all nodes are associated with a basic block.
-   It is in state "floats" if nodes are in arbitrary blocks.  In state
-   "floats" the block predecessor is set in all nodes, but this can be an
+/** state: op_pin_state_pinned
+   The graph is "op_pin_state_pinned" if all nodes are associated with a basic block.
+   It is in state "op_pin_state_floats" if nodes are in arbitrary blocks.  In state
+   "op_pin_state_floats" the block predecessor is set in all nodes, but this can be an
    invalid block, i.e., the block is not a dominator of all the uses of
    the node.
-   The enum op_pinned is defined in irop.h. */
-op_pinned get_irg_pinned (ir_graph *irg);
+   The enum op_pin_state is defined in irop.h. */
+op_pin_state get_irg_pinned (ir_graph *irg);
 
 /** state: outs_state
    Outs are the back edges or def-use edges.
-   Values:  no_outs, outs_consistent, outs_inconsistent
-   no_outs: outs are not computed, no memory is allocated.
+   Values:  outs_none, outs_consistent, outs_inconsistent
+   outs_none: outs are not computed, no memory is allocated.
    outs_consistent:  outs are computed and correct,
    outs_inconsistent: outs have been computed, memory is still allocated,
    but the graph has been changed since. */
 typedef enum {
-  no_outs,
+  outs_none,
   outs_consistent,
   outs_inconsistent
 } irg_outs_state;
@@ -255,15 +256,15 @@ void set_irg_outs_inconsistent(ir_graph *irg);
 
 /** state: dom_state
    Signals the state of the dominator infomation.
-   Values:  no_dom, dom_consistent, dom_inconsistent
-   no_dom: doms are not computed, no memory is allocated.  The access routines
+   Values:  dom_none, dom_consistent, dom_inconsistent
+   dom_none: doms are not computed, no memory is allocated.  The access routines
    may not be used.
    dom_consistent:  dominator information is computed and correct,
    dom_inconsistent: dominator information is computed, memory is still allocated,
    but the graph has been changed since. Using the access routines is possible,
    obtained information may be incorrect. */
 typedef enum {
-  no_dom,
+  dom_none,
   dom_consistent,
   dom_inconsistent
 } irg_dom_state;
index fb79b0e..1f78f26 100644 (file)
@@ -60,7 +60,7 @@ struct ir_graph {
 
   /* -- Fields indicating different states of irgraph -- */
   irg_phase_state phase_state;       /**< compiler phase */
-  op_pinned pinned;                  /**< Flag for status of nodes */
+  op_pin_state op_pin_state_pinned;  /**< Flag for status of nodes */
   irg_outs_state outs_state;         /**< Out edges. */
   irg_dom_state dom_state;           /**< Dominator information */
   irg_typeinfo_state typeinfo_state;       /**< Validity of type information */
@@ -111,13 +111,13 @@ void init_irgraph(void);
 ir_graph *new_const_code_irg(void);
 
 /**
- * Set the pinned state of a graph.
+ * Set the op_pin_state_pinned state of a graph.
  *
  * @irg     the IR graph
  * @p       new pin state
  */
 INLINE void
-set_irg_pinned (ir_graph *irg, op_pinned p);
+set_irg_pinned (ir_graph *irg, op_pin_state p);
 
 /** Returns the obstack associated with the graph. */
 struct obstack *get_irg_obstack(ir_graph *irg);
@@ -325,9 +325,9 @@ __set_irg_phase_low(ir_graph *irg) {
   irg->phase_state = phase_low;
 }
 
-static INLINE op_pinned
+static INLINE op_pin_state
 __get_irg_pinned(ir_graph *irg) {
-  return irg->pinned;
+  return irg->op_pin_state_pinned;
 }
 
 static INLINE irg_outs_state
@@ -361,8 +361,8 @@ __set_irg_loopinfo_state(ir_graph *irg, irg_loopinfo_state s) {
 }
 
 static INLINE void
-__set_irg_pinned(ir_graph *irg, op_pinned p) {
-  irg->pinned = p;
+__set_irg_pinned(ir_graph *irg, op_pin_state p) {
+  irg->op_pin_state_pinned = p;
 }
 
 static INLINE irg_callee_info_state
@@ -444,8 +444,8 @@ __inc_irg_block_visited(ir_graph *irg)
 #define set_irg_bad(irg, node)             __set_irg_bad(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_ent(irg)                   __get_irg_ent(irg)
-#define set_irg_ent(irg, ent)              __set_irg_ent(irg, ent)
+#define get_irg_entity(irg)                   __get_irg_ent(irg)
+#define set_irg_entity(irg, ent)              __set_irg_ent(irg, ent)
 #define get_irg_frame_type(irg)            __get_irg_frame_type(irg)
 #define set_irg_frame_type(irg, ftp)       __set_irg_frame_type(irg, ftp)
 #define get_irg_obstack(irg)               __get_irg_obstack(irg)
index cf111f3..ff2dbc1 100644 (file)
@@ -374,7 +374,7 @@ void cg_walk(irg_walk_func *pre, irg_walk_func *post, void *env) {
 static ir_node *get_cf_op(ir_node *n) {
   ir_node *pred;
 
-  n = skip_nop(n);
+  n = skip_Id(n);
   n = skip_Tuple(n);
   pred = skip_Proj(n);
   if (!(is_cfop(pred) || is_fragile_op(pred) ||
@@ -672,7 +672,7 @@ leave_procedure(ir_node *block, ir_node *cf_pred, int pos) {
   if (tos == cf_pred) {
     /* We entered this procedure by the call pred pos refers to. */
     pop_callsite(current_ir_graph);
-    current_ir_graph = get_CallBegin_irg(cf_pred);
+    current_ir_graph = get_irn_irg(cf_pred);
     return true;
   } else {
     /* We won't walk. */
@@ -705,7 +705,7 @@ static INLINE void
 re_enter_procedure(ir_node *block, ir_node *cf_pred, int pos) {
   ir_node *callbegin = pop_callsite(current_ir_graph);
   assert(interprocedural_view);
-  current_ir_graph = get_CallBegin_irg(callbegin);
+  current_ir_graph = get_irn_irg(callbegin);
 }
 
 static INLINE void
index 2240d14..4bfb961 100644 (file)
@@ -438,7 +438,7 @@ unsigned int
 }
 
 unsigned int
-(get_mode_vector_elems)(const ir_mode *mode) {
+(get_mode_n_vector_elems)(const ir_mode *mode) {
   return __get_mode_vector_elems(mode);
 }
 
@@ -704,13 +704,13 @@ init_mode (void)
   newmode.sort    = irms_control_flow;
 
   /* Basic Block */
-  newmode.name    = id_from_str("BB", 2);
+  newmode.name    = new_id_from_chars("BB", 2);
   newmode.code    = irm_BB;
 
   mode_BB = register_mode(&newmode);
 
 /* eXecution */
-  newmode.name    = id_from_str("X", 1);
+  newmode.name    = new_id_from_chars("X", 1);
   newmode.code    = irm_X;
 
   mode_X = register_mode(&newmode);
@@ -719,7 +719,7 @@ init_mode (void)
   newmode.sort    = irms_memory;
 
   /* Memory */
-  newmode.name    = id_from_str("M", 1);
+  newmode.name    = new_id_from_chars("M", 1);
   newmode.code    = irm_M;
 
   mode_M = register_mode(&newmode);
@@ -728,19 +728,19 @@ init_mode (void)
   newmode.sort    = irms_auxiliary,
 
   /* Tuple */
-  newmode.name    = id_from_str("T", 1);
+  newmode.name    = new_id_from_chars("T", 1);
   newmode.code    = irm_T;
 
   mode_T = register_mode(&newmode);
 
   /* ANY */
-  newmode.name    = id_from_str("ANY", 3);
+  newmode.name    = new_id_from_chars("ANY", 3);
   newmode.code    = irm_ANY;
 
   mode_ANY = register_mode(&newmode);
 
   /* BAD */
-  newmode.name    = id_from_str("BAD", 3);
+  newmode.name    = new_id_from_chars("BAD", 3);
   newmode.code    = irm_BAD;
 
   mode_BAD = register_mode(&newmode);
@@ -749,7 +749,7 @@ init_mode (void)
   newmode.sort    = irms_internal_boolean;
 
   /* boolean */
-  newmode.name    = id_from_str("b", 1);
+  newmode.name    = new_id_from_chars("b", 1);
   newmode.code    = irm_b;
 
   mode_b = register_mode(&newmode);
@@ -762,7 +762,7 @@ init_mode (void)
   newmode.arithmetic = irma_ieee754;
 
   /* float */
-  newmode.name    = id_from_str("F", 1);
+  newmode.name    = new_id_from_chars("F", 1);
   newmode.code    = irm_F;
   newmode.sign    = 1;
   newmode.align   = 32;
@@ -771,7 +771,7 @@ init_mode (void)
   mode_F = register_mode(&newmode);
 
   /* double */
-  newmode.name    = id_from_str("D", 1);
+  newmode.name    = new_id_from_chars("D", 1);
   newmode.code    = irm_D;
   newmode.sign    = 1;
   newmode.align   = 64;
@@ -780,7 +780,7 @@ init_mode (void)
   mode_D = register_mode(&newmode);
 
   /* extended */
-  newmode.name    = id_from_str("E", 1);
+  newmode.name    = new_id_from_chars("E", 1);
   newmode.code    = irm_E;
   newmode.sign    = 1;
   newmode.align   = 128;
@@ -793,7 +793,7 @@ init_mode (void)
   newmode.arithmetic   = irma_twos_complement;
 
   /* signed byte */
-  newmode.name         = id_from_str("Bs", 2);
+  newmode.name         = new_id_from_chars("Bs", 2);
   newmode.code         = irm_Bs;
   newmode.sign         = 1;
   newmode.align        = 8;
@@ -803,7 +803,7 @@ init_mode (void)
   mode_Bs = register_mode(&newmode);
 
   /* unsigned byte */
-  newmode.name         = id_from_str("Bu", 2);
+  newmode.name         = new_id_from_chars("Bu", 2);
   newmode.code         = irm_Bu;
   newmode.arithmetic   = irma_twos_complement;
   newmode.sign         = 0;
@@ -814,7 +814,7 @@ init_mode (void)
   mode_Bu = register_mode(&newmode);
 
   /* signed short integer */
-  newmode.name         = id_from_str("Hs", 2);
+  newmode.name         = new_id_from_chars("Hs", 2);
   newmode.code         = irm_Hs;
   newmode.sign         = 1;
   newmode.align        = 16;
@@ -824,7 +824,7 @@ init_mode (void)
   mode_Hs = register_mode(&newmode);
 
   /* unsigned short integer */
-  newmode.name         = id_from_str("Hu", 2);
+  newmode.name         = new_id_from_chars("Hu", 2);
   newmode.code         = irm_Hu;
   newmode.sign         = 0;
   newmode.align        = 16;
@@ -834,7 +834,7 @@ init_mode (void)
   mode_Hu = register_mode(&newmode);
 
   /* signed integer */
-  newmode.name         = id_from_str("Is", 2);
+  newmode.name         = new_id_from_chars("Is", 2);
   newmode.code         = irm_Is;
   newmode.sign         = 1;
   newmode.align        = 32;
@@ -844,7 +844,7 @@ init_mode (void)
   mode_Is = register_mode(&newmode);
 
   /* unsigned integer */
-  newmode.name         = id_from_str("Iu", 2);
+  newmode.name         = new_id_from_chars("Iu", 2);
   newmode.code         = irm_Iu;
   newmode.sign         = 0;
   newmode.align        = 32;
@@ -854,7 +854,7 @@ init_mode (void)
   mode_Iu = register_mode(&newmode);
 
   /* signed long integer */
-  newmode.name         = id_from_str("Ls", 2);
+  newmode.name         = new_id_from_chars("Ls", 2);
   newmode.code         = irm_Ls;
   newmode.sign         = 1;
   newmode.align        = 32;
@@ -864,7 +864,7 @@ init_mode (void)
   mode_Ls = register_mode(&newmode);
 
   /* unsigned long integer */
-  newmode.name         = id_from_str("Lu", 2);
+  newmode.name         = new_id_from_chars("Lu", 2);
   newmode.code         = irm_Lu;
   newmode.sign         = 0;
   newmode.align        = 32;
@@ -878,7 +878,7 @@ init_mode (void)
   newmode.arithmetic   = irma_none;
 
   /* Character */
-  newmode.name         = id_from_str("C", 1);
+  newmode.name         = new_id_from_chars("C", 1);
   newmode.code         = irm_C;
   newmode.sign         = 0;
   newmode.align        = 8;
@@ -888,7 +888,7 @@ init_mode (void)
   mode_C = register_mode(&newmode);
 
   /* Unicode character */
-  newmode.name         = id_from_str("U", 1);
+  newmode.name         = new_id_from_chars("U", 1);
   newmode.code         = irm_U;
   newmode.sign         = 0;
   newmode.align        = 16;
@@ -902,7 +902,7 @@ init_mode (void)
   newmode.arithmetic = irma_twos_complement;
 
   /* pointer */
-  newmode.name         = id_from_str("P", 1);
+  newmode.name         = new_id_from_chars("P", 1);
   newmode.code         = irm_P;
   newmode.sign         = 0;
   newmode.align        = 32;
index 5bc7b1a..e812293 100644 (file)
@@ -245,7 +245,7 @@ unsigned int get_mode_modulo_shift(const ir_mode *mode);
  *  a vector mode. For non-vector modes it returns 1 for data and 0
  *  for all other modes
  */
-unsigned int get_mode_vector_elems(const ir_mode *mode);
+unsigned int get_mode_n_vector_elems(const ir_mode *mode);
 
 /** Returns the stored intermediate information. */
 void *get_mode_link(const ir_mode *mode);
@@ -274,7 +274,7 @@ tarval *get_mode_max(ir_mode *mode);
  *
  * Zero is the additive neutral element and as such
  * is defined only for modes allowing addition, i.e.
- * floats and ints, and references (NULL-Pointer)
+ * op_pin_state_floats and ints, and references (NULL-Pointer)
  * else returns tarval_bad.
  */
 tarval *get_mode_null(ir_mode *mode);
@@ -284,7 +284,7 @@ tarval *get_mode_null(ir_mode *mode);
  *
  * One, being the multiplicative neutral element,
  * is defined only for modes allowing multiplication,
- * i.e. ints and floats.
+ * i.e. ints and op_pin_state_floats.
  */
 tarval *get_mode_one(ir_mode *mode);
 
@@ -425,10 +425,5 @@ int mode_is_int_vector (const ir_mode *mode);
    according to firm definiton */
 int smaller_mode(const ir_mode *sm, const ir_mode *lm);
 
-/** mode module initialization, call once before use of any other function **/
-void init_mode(void);
-
-/** mode module finalization. frees all memory.  */
-void finish_mode(void);
 
 #endif /* _IRMODE_H_ */
index b259a84..e1cd2f2 100644 (file)
@@ -50,6 +50,7 @@ struct ir_mode {
   const void        *tv_priv;   /**< tarval module will save private data here */
 };
 
+
 /* ------------------------------- *
  * inline functions                *
  * ------------------------------- */
@@ -220,31 +221,37 @@ __mode_is_int_vector(const ir_mode *mode) {
   return (__get_mode_sort(mode) == irms_int_number) && (__get_mode_vector_elems(mode) > 1);
 }
 
-#define get_modeP_mach()             __get_modeP_mach()
-#define set_modeP_mach(p)            __set_modeP_mach(p)
-#define get_mode_modecode(mode)      __get_mode_modecode(mode)
-#define get_mode_ident(mode)         __get_mode_ident(mode)
-#define get_mode_sort(mode)          __get_mode_sort(mode)
-#define get_mode_size_bits(mode)     __get_mode_size_bits(mode)
-#define get_mode_size_bytes(mode)    __get_mode_size_bytes(mode)
-#define get_mode_align(mode)         __get_mode_align(mode)
-#define get_mode_sign(mode)          __get_mode_sign(mode)
-#define get_mode_arithmetic(mode)    __get_mode_arithmetic(mode)
-#define get_mode_modulo_shift(mode)  __get_mode_modulo_shift(mode)
-#define get_mode_vector_elems(mode)  __get_mode_vector_elems(mode)
-#define get_mode_link(mode)          __get_mode_link(mode)
-#define set_mode_link(mode, l)       __set_mode_link(mode, l)
-#define mode_is_signed(mode)         __mode_is_signed(mode)
-#define mode_is_float(mode)          __mode_is_float(mode)
-#define mode_is_int(mode)            __mode_is_int(mode)
-#define mode_is_character(mode)      __mode_is_character(mode)
-#define mode_is_reference(mode)      __mode_is_reference(mode)
-#define mode_is_num(mode)            __mode_is_num(mode)
-#define mode_is_numP(mode)           __mode_is_numP(mode)
-#define mode_is_data(mode)           __mode_is_data(mode)
-#define mode_is_datab(mode)          __mode_is_datab(mode)
-#define mode_is_dataM(mode)          __mode_is_dataM(mode)
-#define mode_is_float_vector(mode)   __mode_is_float_vector(mode)
-#define mode_is_int_vector(mode)     __mode_is_int_vector(mode)
+/** mode module initialization, call once before use of any other function **/
+void init_mode(void);
+
+/** mode module finalization. frees all memory.  */
+void finish_mode(void);
+
+#define get_modeP_mach()               __get_modeP_mach()
+#define set_modeP_mach(p)              __set_modeP_mach(p)
+#define get_mode_modecode(mode)        __get_mode_modecode(mode)
+#define get_mode_ident(mode)           __get_mode_ident(mode)
+#define get_mode_sort(mode)            __get_mode_sort(mode)
+#define get_mode_size_bits(mode)       __get_mode_size_bits(mode)
+#define get_mode_size_bytes(mode)      __get_mode_size_bytes(mode)
+#define get_mode_align(mode)           __get_mode_align(mode)
+#define get_mode_sign(mode)            __get_mode_sign(mode)
+#define get_mode_arithmetic(mode)      __get_mode_arithmetic(mode)
+#define get_mode_modulo_shift(mode)    __get_mode_modulo_shift(mode)
+#define get_mode_n_vector_elems(mode)  __get_mode_vector_elems(mode)
+#define get_mode_link(mode)            __get_mode_link(mode)
+#define set_mode_link(mode, l)         __set_mode_link(mode, l)
+#define mode_is_signed(mode)           __mode_is_signed(mode)
+#define mode_is_float(mode)            __mode_is_float(mode)
+#define mode_is_int(mode)              __mode_is_int(mode)
+#define mode_is_character(mode)        __mode_is_character(mode)
+#define mode_is_reference(mode)        __mode_is_reference(mode)
+#define mode_is_num(mode)              __mode_is_num(mode)
+#define mode_is_numP(mode)             __mode_is_numP(mode)
+#define mode_is_data(mode)             __mode_is_data(mode)
+#define mode_is_datab(mode)            __mode_is_datab(mode)
+#define mode_is_dataM(mode)            __mode_is_dataM(mode)
+#define mode_is_float_vector(mode)     __mode_is_float_vector(mode)
+#define mode_is_int_vector(mode)       __mode_is_int_vector(mode)
 
 #endif /* _IRMODE_T_H_ */
index 5812682..fcd49ef 100644 (file)
@@ -457,13 +457,13 @@ get_irn_block_attr (ir_node *node)
 
 /* this works for all except Block */
 ir_node *
-get_nodes_Block (ir_node *node) {
+get_nodes_block (ir_node *node) {
   assert (!(node->op == op_Block));
   return get_irn_n(node, -1);
 }
 
 void
-set_nodes_Block (ir_node *node, ir_node *block) {
+set_nodes_block (ir_node *node, ir_node *block) {
   assert (!(node->op == op_Block));
   set_irn_n(node, -1, block);
 }
@@ -601,12 +601,12 @@ get_Block_handler (ir_node *block) {
 / * handler handling for Nodes * /
 void
 set_Node_handler (ir_node *node, ir_node *handler) {
-  set_Block_handler (get_nodes_Block (node), handler);
+  set_Block_handler (get_nodes_block (node), handler);
 }
 
 ir_node *
 get_Node_handler (ir_node *node) {
-  return (get_Block_handler (get_nodes_Block (node)));
+  return (get_Block_handler (get_nodes_block (node)));
 }
 
 / * exc_t handling for Blocks * /
@@ -622,11 +622,11 @@ exc_t get_Block_exc (ir_node *block) {
 
 / * exc_t handling for Nodes * /
 void set_Node_exc (ir_node *node, exc_t exc) {
-  set_Block_exc (get_nodes_Block (node), exc);
+  set_Block_exc (get_nodes_block (node), exc);
 }
 
 exc_t get_Node_exc (ir_node *node) {
-  return (get_Block_exc (get_nodes_Block (node)));
+  return (get_Block_exc (get_nodes_block (node)));
 }
 */
 
@@ -675,12 +675,6 @@ void remove_Block_cg_cfgpred_arr(ir_node * node) {
   node->attr.block.in_cg = NULL;
 }
 
-/* Start references the irg it is in. */
-ir_graph *
-get_Start_irg(ir_node *node) {
-  return get_irn_irg(node);
-}
-
 void
 set_Start_irg(ir_node *node, ir_graph *irg) {
   assert(node->op == op_Start);
@@ -721,13 +715,6 @@ free_End (ir_node *end) {
                in array afterwards ... */
 }
 
-ir_graph *get_EndReg_irg (ir_node *end) {
-  return get_irn_irg(end);
-}
-
-ir_graph *get_EndExcept_irg  (ir_node *end) {
-  return get_irn_irg(end);
-}
 
 /*
 > Implementing the case construct (which is where the constant Proj node is
@@ -889,10 +876,6 @@ set_Const_type (ir_node *node, type *tp) {
   if (tp != unknown_type) {
     assert (is_atomic_type(tp));
     assert (get_type_mode(tp) == get_irn_mode(node));
-    assert (!tarval_is_entity(get_Const_tarval(node)) ||
-        (is_pointer_type(tp) &&
-         (get_pointer_points_to_type(tp) ==
-          get_entity_type(get_tarval_entity(get_Const_tarval(node))))));
   }
 
   node->attr.con.tp = tp;
@@ -1186,9 +1169,6 @@ void set_CallBegin_ptr (ir_node *node, ir_node *ptr) {
   assert(node->op == op_CallBegin);
   set_irn_n(node, 0, ptr);
 }
-ir_graph * get_CallBegin_irg (ir_node *node) {
-  return get_irn_irg(node);
-}
 ir_node * get_CallBegin_call (ir_node *node) {
   assert(node->op == op_CallBegin);
   return node->attr.callbegin.call;
@@ -1885,11 +1865,11 @@ skip_Tuple (ir_node *node) {
 
   if (!get_opt_normalize()) return node;
 
-  node = skip_nop(node);
+  node = skip_Id(node);
   if (get_irn_op(node) == op_Proj) {
-    pred = skip_nop(get_Proj_pred(node));
+    pred = skip_Id(get_Proj_pred(node));
     if (get_irn_op(pred) == op_Proj) /* nested Tuple ? */
-      pred = skip_nop(skip_Tuple(pred));
+      pred = skip_Id(skip_Tuple(pred));
     if (get_irn_op(pred) == op_Tuple)
       return get_Tuple_pred(pred, get_Proj_proj(node));
   }
@@ -1899,7 +1879,7 @@ skip_Tuple (ir_node *node) {
 /** returns operand of node if node is a Cast */
 ir_node *skip_Cast  (ir_node *node) {
   if (node && get_irn_op(node) == op_Cast) {
-    return skip_nop(get_irn_n(node, 0));
+    return skip_Id(get_irn_n(node, 0));
   } else {
     return node;
   }
@@ -1910,7 +1890,7 @@ ir_node *skip_Cast  (ir_node *node) {
    than any other approach, as Id chains are resolved and all point to the real node, or
    all id's are self loops. */
 ir_node *
-skip_nop (ir_node *node) {
+skip_Id (ir_node *node) {
   /* don't assert node !!! */
 
   if (!get_opt_normalize()) return node;
@@ -1924,7 +1904,7 @@ skip_nop (ir_node *node) {
     assert (get_irn_arity (node) > 0);
 
     node->in[0+1] = node;
-    res = skip_nop(rem_pred);
+    res = skip_Id(rem_pred);
     if (res->op == op_Id) /* self-loop */ return node;
 
     node->in[0+1] = res;
@@ -1938,7 +1918,7 @@ skip_nop (ir_node *node) {
    than any other approach, as Id chains are resolved and all point to the real node, or
    all id's are self loops. */
 ir_node *
-skip_nop (ir_node *node) {
+skip_Id (ir_node *node) {
   ir_node *pred;
   /* don't assert node !!! */
 
@@ -1961,7 +1941,7 @@ skip_nop (ir_node *node) {
     assert (get_irn_arity (node) > 0);
 
     node->in[0+1] = node;   /* turn us into a self referencing Id:  shorten Id cycles. */
-    res = skip_nop(rem_pred);
+    res = skip_Id(rem_pred);
     if (res->op == op_Id) /* self-loop */ return node;
 
     node->in[0+1] = res;    /* Turn Id chain into Ids all referencing the chain end. */
@@ -1972,11 +1952,6 @@ skip_nop (ir_node *node) {
 }
 #endif
 
-ir_node *
-skip_Id (ir_node *node) {
-  return skip_nop(node);
-}
-
 int
 is_Bad (ir_node *node) {
   assert(node);
@@ -2023,10 +1998,6 @@ int is_ip_cfop(ir_node *node) {
   return is_ip_cfopcode(get_irn_op(node));
 }
 
-ir_graph *get_ip_cfop_irg(ir_node *n) {
-  return get_irn_irg(n);
-}
-
 /* Returns true if the operation can change the control flow because
    of an exception. */
 int
index d3adce0..8621923 100644 (file)
@@ -179,7 +179,7 @@ void          set_irn_link     (ir_node *node, void *link);
 void         *get_irn_link     (const ir_node *node);
 
 /** Returns the ir_graph this node belongs to. Only valid if irg
- *  is in state pinned (irg is only stored in the block. */
+ *  is in state op_pin_state_pinned (irg is only stored in the block. */
 ir_graph     *get_irn_irg      (ir_node *node);
 
 /** Outputs a unique number for this node if libFIRM is compiled for
@@ -222,9 +222,9 @@ new_ir_node (dbg_info *db,
  * access routines that work for all nodes we use infix "nodes" and do not
  * name this function get_irn_block. */
 #define get_nodes_block get_nodes_Block
-ir_node  *get_nodes_Block (ir_node *node);
+ir_node  *get_nodes_block (ir_node *node);
 #define set_nodes_block set_nodes_Block
-void      set_nodes_Block (ir_node *node, ir_node *block);
+void      set_nodes_block (ir_node *node, ir_node *block);
 
 /**
  * @function get_irn_block
@@ -245,20 +245,6 @@ typedef enum {
                    type of this method. */
 } pn_Start; /* Projection numbers for Start. */
 
-/**
- * Projection numbers for result of Start node: use for Proj nodes!
- * @remark This is the old name convention, don't use anymore.
- */
-typedef enum {
-  pns_initial_exec,     /**< Projection on an executable, the initial control flow. */
-  pns_global_store,     /**< Projection on the global store */
-  pns_frame_base,       /**< Projection on the frame base */
-  pns_globals,          /**< Projection on the pointer to the data segment
-                 containing _all_ global entities. */
-  pns_args,             /**< Projection on all arguments */
-  pns_value_arg_base    /**< Pointer to region of compound value arguments as defined by
-                 type of this method. */
-} pns_number; /* pns: Projection Number Start */
 
 /** Test whether arbitrary node is frame pointer.
  *
@@ -306,10 +292,6 @@ ir_node  *get_Block_cg_cfgpred(ir_node * node, int pos);
 /* frees the memory. */
 void      remove_Block_cg_cfgpred_arr(ir_node * node);
 
-/* Start references the irg it is in.
- @@@ old -- use get_irn_irg instead! */
-ir_graph *get_Start_irg(ir_node *node);
-
 int  get_End_n_keepalives(ir_node *end);
 ir_node *get_End_keepalive(ir_node *end, int pos);
 void add_End_keepalive (ir_node *end, ir_node *ka);
@@ -319,9 +301,6 @@ void set_End_keepalive(ir_node *end, int pos, ir_node *ka);
    free_End frees these data structures. */
 void free_End (ir_node *end);
 
-/* @@@ old -- use get_irn_irg instead!  */
-ir_graph *get_EndReg_irg (ir_node *end);
-ir_graph *get_EndExcept_irg (ir_node *end);
 
 /* We distinguish three kinds of Cond nodes.  These can be distinguished
    by the mode of the selector operand and an internal flag of type cond_kind.
@@ -455,21 +434,6 @@ void     set_Sel_index (ir_node *node, int pos, ir_node *index);
 entity  *get_Sel_entity (ir_node *node); /* entity to select */
 void     set_Sel_entity (ir_node *node, entity *ent);
 
-/**
- * Projection numbers for result of Call node: use for Proj nodes!
- *
- * @remark old name convention!
- */
-typedef enum {
-  pncl_memory = 0,        /**< The memory result. */
-  pncl_exc_target = 1,    /**< The control flow result branching to the exception handler */
-  pncl_result_tuple = 2,  /**< The tuple containing all (0, 1, 2, ...) results */
-  pncl_exc_memory = 3,    /**< The memory result in case the called method terminated with
-                  an exception */
-  pncl_value_res_base = 4 /**< A pointer to the memory region containing copied results
-                  passed by value (for compound result types). */
-} pncl_number;   /* pncl: Projection Number CaLl */
-
 /**
  * Projection numbers for result of Call node: use for Proj nodes!
  */
@@ -515,8 +479,6 @@ void    remove_Call_callee_arr(ir_node * node);
 
 ir_node  *get_CallBegin_ptr  (ir_node *node);
 void      set_CallBegin_ptr  (ir_node *node, ir_node *ptr);
-/* @@@ old -- use get_irn_irg instead!  */
-ir_graph *get_CallBegin_irg  (ir_node *node);
 ir_node  *get_CallBegin_call (ir_node *node);
 void      set_CallBegin_call (ir_node *node, ir_node *call);
 
@@ -860,7 +822,6 @@ void     set_Confirm_cmp   (ir_node *node, pn_Cmp cmp);
 /** returns operand of node if node is a Proj. */
 ir_node *skip_Proj (ir_node *node);
 /** returns operand of node if node is a Id */
-ir_node *skip_nop  (ir_node *node);
 ir_node *skip_Id  (ir_node *node);   /* Same as skip_nop. */
 /* returns corresponding operand of Tuple if node is a Proj from
    a Tuple. */
@@ -882,9 +843,6 @@ int      is_Proj (const ir_node *node);
    Start, End, Jmp, Cond, Return, Raise, Bad, CallBegin, EndReg, EndExcept */
 int is_cfop(ir_node *node);
 
-/* @@@ old -- use get_irn_irg instead!  */
-ir_graph *get_ip_cfop_irg(ir_node *n);
-
 /** Returns true if the operation manipulates interprocedural control flow:
     CallBegin, EndReg, EndExcept */
 int is_ip_cfop(ir_node *node);
@@ -935,9 +893,9 @@ void    dump_irn(ir_node *n);
 /** Output information about an entity and its owner */
 #define DDMEO(X) printf("%s(l.%i) %s (own: %s): %ld (%p)\n", __MYFUNC__, __LINE__, get_entity_name(X), get_type_name(get_entity_owner(X)), get_entity_nr(X), (void *)(X))
 /** Output information about a graph */
-#define DDMG(X)  printf("%s(l.%i) %s: %ld (%p)\n",           __MYFUNC__, __LINE__, get_entity_name(get_irg_ent(X)), get_irg_graph_nr(X), (void *)(X))
+#define DDMG(X)  printf("%s(l.%i) %s: %ld (%p)\n",           __MYFUNC__, __LINE__, get_entity_name(get_irg_entity(X)), get_irg_graph_nr(X), (void *)(X))
 /** Output information about an ident */
-#define DDMI(X)  printf("%s(l.%i) %s: %p\n",                 __MYFUNC__, __LINE__, id_to_str(X), (void *)(X))
+#define DDMI(X)  printf("%s(l.%i) %s: %p\n",                 __MYFUNC__, __LINE__, get_id_str(X), (void *)(X))
 /** Output information about a mode */
 #define DDMM(X)  printf("%s(l.%i) %s: %p\n",                 __MYFUNC__, __LINE__, get_mode_name(X), (void *)(X))
 /** Output information about a loop */
index 5604765..1a99728 100644 (file)
@@ -326,7 +326,7 @@ __get_irn_arity (const ir_node *node) {
  */
 static INLINE ir_node *
 __get_irn_intra_n (ir_node *node, int n) {
-  return (node->in[n + 1] = skip_nop(node->in[n + 1]));
+  return (node->in[n + 1] = skip_Id(node->in[n + 1]));
 }
 
 /**
@@ -337,9 +337,9 @@ __get_irn_inter_n (ir_node *node, int n) {
   /* handle Filter and Block specially */
   if (__get_irn_opcode(node) == iro_Filter) {
     assert(node->attr.filter.in_cg);
-    return (node->attr.filter.in_cg[n + 1] = skip_nop(node->attr.filter.in_cg[n + 1]));
+    return (node->attr.filter.in_cg[n + 1] = skip_Id(node->attr.filter.in_cg[n + 1]));
   } else if (__get_irn_opcode(node) == iro_Block && node->attr.block.in_cg) {
-    return (node->attr.block.in_cg[n + 1] = skip_nop(node->attr.block.in_cg[n + 1]));
+    return (node->attr.block.in_cg[n + 1] = skip_Id(node->attr.block.in_cg[n + 1]));
   }
 
   return __get_irn_intra_n (node, n);
index 66d11e4..a5db386 100644 (file)
@@ -86,14 +86,14 @@ ir_op *op_FuncCall;    ir_op *get_op_FuncCall  (void) { return op_FuncCall; }
 
 
 ir_op *
-new_ir_op(opcode code, const char *name, op_pinned p, unsigned flags, op_arity opar, int op_index, size_t attr_size)
+new_ir_op(opcode code, const char *name, op_pin_state p, unsigned flags, op_arity opar, int op_index, size_t attr_size)
 {
   ir_op *res;
 
   res = (ir_op *) xmalloc (sizeof (ir_op));
   res->code      = code;
-  res->name      = id_from_str(name, strlen(name));
-  res->pinned    = p;
+  res->name      = new_id_from_chars(name, strlen(name));
+  res->op_pin_state_pinned = p;
   res->attr_size = attr_size;
   res->flags     = flags;
   res->opar      = opar;
@@ -118,65 +118,65 @@ init_op(void)
 #define I   irop_flag_ip_cfopcode
 #define F   irop_flag_fragile
 
-  op_Block     = new_ir_op(iro_Block,     "Block",     pinned, L,   oparity_variable, -1, sizeof(block_attr));
-
-  op_Start     = new_ir_op(iro_Start,     "Start",     pinned, X,   oparity_zero,     -1, sizeof(start_attr));
-  op_End       = new_ir_op(iro_End,       "End",       pinned, X,   oparity_dynamic,  -1, 0);
-  op_Jmp       = new_ir_op(iro_Jmp,       "Jmp",       pinned, X,   oparity_zero,     -1, 0);
-  op_Cond      = new_ir_op(iro_Cond,      "Cond",      pinned, L|X, oparity_any,      -1, sizeof(cond_attr));
-  op_Return    = new_ir_op(iro_Return,    "Return",    pinned, L|X, oparity_zero,     -1, 0);
-  op_Raise     = new_ir_op(iro_Raise,     "Raise",     pinned, L|X, oparity_any,      -1, 0);
-
-  op_Const     = new_ir_op(iro_Const,     "Const",     floats, 0,   oparity_zero,     -1, sizeof(const_attr));
-  op_SymConst  = new_ir_op(iro_SymConst,  "SymConst",  floats, 0,   oparity_zero,     -1, sizeof(symconst_attr));
-
-  op_Sel       = new_ir_op(iro_Sel,       "Sel",       floats, L,   oparity_any,      -1, sizeof(sel_attr));
-  op_InstOf    = new_ir_op(iro_InstOf,    "InstOf",    floats, L,   oparity_any,      -1, sizeof(sel_attr));
-
-  op_Call      = new_ir_op(iro_Call,      "Call",      pinned, L|F, oparity_variable, -1, sizeof(call_attr));
-  op_Add       = new_ir_op(iro_Add,       "Add",       floats, C,   oparity_binary,    0, 0);
-  op_Minus     = new_ir_op(iro_Minus,     "Minus",     floats, 0,   oparity_unary,     0, 0);
-  op_Sub       = new_ir_op(iro_Sub,       "Sub",       floats, L,   oparity_binary,    0, 0);
-  op_Mul       = new_ir_op(iro_Mul,       "Mul",       floats, C,   oparity_binary,    0, 0);
-  op_Quot      = new_ir_op(iro_Quot,      "Quot",      pinned, L|F, oparity_binary,    1, sizeof(struct irnode **));
-  op_DivMod    = new_ir_op(iro_DivMod,    "DivMod",    pinned, L|F, oparity_binary,    1, sizeof(struct irnode **));
-  op_Div       = new_ir_op(iro_Div,       "Div",       pinned, L|F, oparity_binary,    1, sizeof(struct irnode **));
-  op_Mod       = new_ir_op(iro_Mod,       "Mod",       pinned, L|F, oparity_binary,    1, sizeof(struct irnode **));
-  op_Abs       = new_ir_op(iro_Abs,       "Abs",       floats, 0,   oparity_unary,     0, 0);
-  op_And       = new_ir_op(iro_And,       "And",       floats, C,   oparity_binary,    0, 0);
-  op_Or        = new_ir_op(iro_Or,        "Or",        floats, C,   oparity_binary,    0, 0);
-  op_Eor       = new_ir_op(iro_Eor,       "Eor",       floats, C,   oparity_binary,    0, 0);
-  op_Not       = new_ir_op(iro_Not,       "Not",       floats, 0,   oparity_unary,     0, 0);
-  op_Cmp       = new_ir_op(iro_Cmp,       "Cmp",       floats, L,   oparity_binary,    0, 0);
-  op_Shl       = new_ir_op(iro_Shl,       "Shl",       floats, L,   oparity_binary,    0, 0);
-  op_Shr       = new_ir_op(iro_Shr,       "Shr",       floats, L,   oparity_binary,    0, 0);
-  op_Shrs      = new_ir_op(iro_Shrs,      "Shrs",      floats, L,   oparity_binary,    0, 0);
-  op_Rot       = new_ir_op(iro_Rot,       "Rot",       floats, L,   oparity_binary,    0, 0);
-  op_Conv      = new_ir_op(iro_Conv,      "Conv",      floats, 0,   oparity_unary,     0, 0);
-  op_Cast      = new_ir_op(iro_Cast,      "Cast",      floats, 0,   oparity_unary,     0, sizeof(cast_attr));
-
-  op_Phi       = new_ir_op(iro_Phi,       "Phi",       pinned, L,   oparity_variable, -1, sizeof(int));
-
-  op_Load      = new_ir_op(iro_Load,      "Load",      pinned, L|F, oparity_any,      -1, sizeof(struct irnode **));
-  op_Store     = new_ir_op(iro_Store,     "Store",     pinned, L|F, oparity_any,      -1, sizeof(struct irnode **));
-  op_Alloc     = new_ir_op(iro_Alloc,     "Alloc",     pinned, L|F, oparity_any,      -1, sizeof(alloc_attr));
-  op_Free      = new_ir_op(iro_Free,      "Free",      pinned, L,   oparity_any,      -1, sizeof(type *));
-  op_Sync      = new_ir_op(iro_Sync,      "Sync",      pinned, 0,   oparity_any,      -1, 0);
-
-  op_Proj      = new_ir_op(iro_Proj,      "Proj",      floats, 0,   oparity_any,      -1, sizeof(long));
-  op_Tuple     = new_ir_op(iro_Tuple,     "Tuple",     floats, L,   oparity_variable, -1, 0);
-  op_Id        = new_ir_op(iro_Id,        "Id",        floats, 0,   oparity_any,      -1, 0);
-  op_Bad       = new_ir_op(iro_Bad,       "Bad",       floats, X|F, oparity_zero,     -1, 0);
-  op_Confirm   = new_ir_op(iro_Confirm,   "Confirm",   floats, L,   oparity_any,      -1, sizeof(confirm_attr));
-
-  op_Unknown   = new_ir_op(iro_Unknown,   "Unknown",   floats, X|F, oparity_zero,     -1, 0);
-  op_Filter    = new_ir_op(iro_Filter,    "Filter",    pinned, L,   oparity_variable, -1, sizeof(filter_attr));
-  op_Break     = new_ir_op(iro_Break,     "Break",     pinned, X,   oparity_zero,     -1, 0);
-  op_CallBegin = new_ir_op(iro_CallBegin, "CallBegin", pinned, X|I, oparity_any,      -1, sizeof(callbegin_attr));
-  op_EndReg    = new_ir_op(iro_EndReg,    "EndReg",    pinned, X|I, oparity_any,      -1, sizeof(end_attr));
-  op_EndExcept = new_ir_op(iro_EndExcept, "EndExcept", pinned, X|I, oparity_any,      -1, sizeof(end_attr));
-
-  op_FuncCall  = new_ir_op(iro_FuncCall,  "FuncCall",  floats, L,   oparity_any,      -1, sizeof(call_attr));
+  op_Block     = new_ir_op(iro_Block,     "Block",     op_pin_state_pinned, L,   oparity_variable, -1, sizeof(block_attr));
+
+  op_Start     = new_ir_op(iro_Start,     "Start",     op_pin_state_pinned, X,   oparity_zero,     -1, sizeof(start_attr));
+  op_End       = new_ir_op(iro_End,       "End",       op_pin_state_pinned, X,   oparity_dynamic,  -1, 0);
+  op_Jmp       = new_ir_op(iro_Jmp,       "Jmp",       op_pin_state_pinned, X,   oparity_zero,     -1, 0);
+  op_Cond      = new_ir_op(iro_Cond,      "Cond",      op_pin_state_pinned, L|X, oparity_any,      -1, sizeof(cond_attr));
+  op_Return    = new_ir_op(iro_Return,    "Return",    op_pin_state_pinned, L|X, oparity_zero,     -1, 0);
+  op_Raise     = new_ir_op(iro_Raise,     "Raise",     op_pin_state_pinned, L|X, oparity_any,      -1, 0);
+
+  op_Const     = new_ir_op(iro_Const,     "Const",     op_pin_state_floats, 0,   oparity_zero,     -1, sizeof(const_attr));
+  op_SymConst  = new_ir_op(iro_SymConst,  "SymConst",  op_pin_state_floats, 0,   oparity_zero,     -1, sizeof(symconst_attr));
+
+  op_Sel       = new_ir_op(iro_Sel,       "Sel",       op_pin_state_floats, L,   oparity_any,      -1, sizeof(sel_attr));
+  op_InstOf    = new_ir_op(iro_InstOf,    "InstOf",    op_pin_state_floats, L,   oparity_any,      -1, sizeof(sel_attr));
+
+  op_Call      = new_ir_op(iro_Call,      "Call",      op_pin_state_pinned, L|F, oparity_variable, -1, sizeof(call_attr));
+  op_Add       = new_ir_op(iro_Add,       "Add",       op_pin_state_floats, C,   oparity_binary,    0, 0);
+  op_Minus     = new_ir_op(iro_Minus,     "Minus",     op_pin_state_floats, 0,   oparity_unary,     0, 0);
+  op_Sub       = new_ir_op(iro_Sub,       "Sub",       op_pin_state_floats, L,   oparity_binary,    0, 0);
+  op_Mul       = new_ir_op(iro_Mul,       "Mul",       op_pin_state_floats, C,   oparity_binary,    0, 0);
+  op_Quot      = new_ir_op(iro_Quot,      "Quot",      op_pin_state_pinned, L|F, oparity_binary,    1, sizeof(struct irnode **));
+  op_DivMod    = new_ir_op(iro_DivMod,    "DivMod",    op_pin_state_pinned, L|F, oparity_binary,    1, sizeof(struct irnode **));
+  op_Div       = new_ir_op(iro_Div,       "Div",       op_pin_state_pinned, L|F, oparity_binary,    1, sizeof(struct irnode **));
+  op_Mod       = new_ir_op(iro_Mod,       "Mod",       op_pin_state_pinned, L|F, oparity_binary,    1, sizeof(struct irnode **));
+  op_Abs       = new_ir_op(iro_Abs,       "Abs",       op_pin_state_floats, 0,   oparity_unary,     0, 0);
+  op_And       = new_ir_op(iro_And,       "And",       op_pin_state_floats, C,   oparity_binary,    0, 0);
+  op_Or        = new_ir_op(iro_Or,        "Or",        op_pin_state_floats, C,   oparity_binary,    0, 0);
+  op_Eor       = new_ir_op(iro_Eor,       "Eor",       op_pin_state_floats, C,   oparity_binary,    0, 0);
+  op_Not       = new_ir_op(iro_Not,       "Not",       op_pin_state_floats, 0,   oparity_unary,     0, 0);
+  op_Cmp       = new_ir_op(iro_Cmp,       "Cmp",       op_pin_state_floats, L,   oparity_binary,    0, 0);
+  op_Shl       = new_ir_op(iro_Shl,       "Shl",       op_pin_state_floats, L,   oparity_binary,    0, 0);
+  op_Shr       = new_ir_op(iro_Shr,       "Shr",       op_pin_state_floats, L,   oparity_binary,    0, 0);
+  op_Shrs      = new_ir_op(iro_Shrs,      "Shrs",      op_pin_state_floats, L,   oparity_binary,    0, 0);
+  op_Rot       = new_ir_op(iro_Rot,       "Rot",       op_pin_state_floats, L,   oparity_binary,    0, 0);
+  op_Conv      = new_ir_op(iro_Conv,      "Conv",      op_pin_state_floats, 0,   oparity_unary,     0, 0);
+  op_Cast      = new_ir_op(iro_Cast,      "Cast",      op_pin_state_floats, 0,   oparity_unary,     0, sizeof(cast_attr));
+
+  op_Phi       = new_ir_op(iro_Phi,       "Phi",       op_pin_state_pinned, L,   oparity_variable, -1, sizeof(int));
+
+  op_Load      = new_ir_op(iro_Load,      "Load",      op_pin_state_pinned, L|F, oparity_any,      -1, sizeof(struct irnode **));
+  op_Store     = new_ir_op(iro_Store,     "Store",     op_pin_state_pinned, L|F, oparity_any,      -1, sizeof(struct irnode **));
+  op_Alloc     = new_ir_op(iro_Alloc,     "Alloc",     op_pin_state_pinned, L|F, oparity_any,      -1, sizeof(alloc_attr));
+  op_Free      = new_ir_op(iro_Free,      "Free",      op_pin_state_pinned, L,   oparity_any,      -1, sizeof(type *));
+  op_Sync      = new_ir_op(iro_Sync,      "Sync",      op_pin_state_pinned, 0,   oparity_any,      -1, 0);
+
+  op_Proj      = new_ir_op(iro_Proj,      "Proj",      op_pin_state_floats, 0,   oparity_any,      -1, sizeof(long));
+  op_Tuple     = new_ir_op(iro_Tuple,     "Tuple",     op_pin_state_floats, L,   oparity_variable, -1, 0);
+  op_Id        = new_ir_op(iro_Id,        "Id",        op_pin_state_floats, 0,   oparity_any,      -1, 0);
+  op_Bad       = new_ir_op(iro_Bad,       "Bad",       op_pin_state_floats, X|F, oparity_zero,     -1, 0);
+  op_Confirm   = new_ir_op(iro_Confirm,   "Confirm",   op_pin_state_floats, L,   oparity_any,      -1, sizeof(confirm_attr));
+
+  op_Unknown   = new_ir_op(iro_Unknown,   "Unknown",   op_pin_state_floats, X|F, oparity_zero,     -1, 0);
+  op_Filter    = new_ir_op(iro_Filter,    "Filter",    op_pin_state_pinned, L,   oparity_variable, -1, sizeof(filter_attr));
+  op_Break     = new_ir_op(iro_Break,     "Break",     op_pin_state_pinned, X,   oparity_zero,     -1, 0);
+  op_CallBegin = new_ir_op(iro_CallBegin, "CallBegin", op_pin_state_pinned, X|I, oparity_any,      -1, sizeof(callbegin_attr));
+  op_EndReg    = new_ir_op(iro_EndReg,    "EndReg",    op_pin_state_pinned, X|I, oparity_any,      -1, sizeof(end_attr));
+  op_EndExcept = new_ir_op(iro_EndExcept, "EndExcept", op_pin_state_pinned, X|I, oparity_any,      -1, sizeof(end_attr));
+
+  op_FuncCall  = new_ir_op(iro_FuncCall,  "FuncCall",  op_pin_state_floats, L,   oparity_any,      -1, sizeof(call_attr));
 
 #undef F
 #undef I
@@ -262,13 +262,13 @@ ident *get_op_ident(ir_op *op){
   return op->name;
 }
 
-op_pinned get_op_pinned (const ir_op *op){
-  return op->pinned;
+op_pin_state get_op_pinned (const ir_op *op){
+  return op->op_pin_state_pinned;
 }
 
-/* Sets pinned in the opcode.  Setting it to floating has no effect
+/* Sets op_pin_state_pinned in the opcode.  Setting it to floating has no effect
    for Phi, Block and control flow nodes. */
-void      set_op_pinned(ir_op *op, op_pinned pinned) {
+void      set_op_pinned(ir_op *op, op_pin_state op_pin_state_pinned) {
   if (op == op_Block || op == op_Phi || is_cfopcode(op)) return;
-  op->pinned = pinned;
+  op->op_pin_state_pinned = op_pin_state_pinned;
 }
index 6112969..ca73cbd 100644 (file)
@@ -114,17 +114,17 @@ const char *get_op_name(const ir_op *op);
 /** Returns the enum for the opcode */
 opcode get_op_code(const ir_op *op);
 
-/** pinned states */
+/** op_pin_state_pinned states */
 typedef enum {
-  floats = 0,    /**< Nodes of this opcode can be placed in any basic block. */
-  pinned           /**< Nodes must remain in this basic block. */
-} op_pinned;
+  op_pin_state_floats = 0,    /**< Nodes of this opcode can be placed in any basic block. */
+  op_pin_state_pinned           /**< Nodes must remain in this basic block. */
+} op_pin_state;
 
 /** gets pinned state of an opcode */
-op_pinned get_op_pinned(const ir_op *op);
+op_pin_state get_op_pinned(const ir_op *op);
 
 /** Sets pinned in the opcode.  Setting it to floating has no effect
    for Block, Phi and control flow nodes. */
-void set_op_pinned(ir_op *op, op_pinned pinned);
+void set_op_pinned(ir_op *op, op_pin_state pinned);
 
 # endif /* _IROP_H_ */
index 532e21d..2dedc1d 100644 (file)
@@ -83,7 +83,7 @@ struct ir_op {
   opcode code;            /**< the unique opcode of the op */
   ident *name;            /**< the name of the op */
   size_t attr_size;       /**< Space needed in memory for private attributes */
-  op_pinned pinned;       /**< How to deal with the node in cse, pre. */
+  op_pin_state op_pin_state_pinned; /**< How to deal with the node in cse, pre. */
   op_arity opar;          /**< arity of operator. */
   int op_index;           /**< the index of the first data operand, 0 for most cases, 1 for Div etc. */
   unsigned flags;         /**< flags describing the behavior of the ir_op, a bitmaks of irop_flags */
@@ -100,7 +100,7 @@ struct ir_op {
  *
  * @param code      the opcode, one of type \c opcode
  * @param name      the printable name of this opcode
- * @param p         wheater operations of this opcode are pinned or floating
+ * @param p         wheater operations of this opcode are op_pin_state_pinned or floating
  * @param flags     a bitmask of irop_flags describing the behavior of the ir operation
  * @param opar      the parity of this ir operation
  * @param op_index  if the parity is oparity_unary, oparity_binary or oparity_trinary the index
@@ -109,7 +109,7 @@ struct ir_op {
  *
  * @return The genenerated ir operation.
  */
-ir_op * new_ir_op(opcode code, const char *name, op_pinned p,
+ir_op * new_ir_op(opcode code, const char *name, op_pin_state p,
                   unsigned flags, op_arity opar, int op_index, size_t attr_size);
 
 /**
index 53dc6cf..96b27dd 100644 (file)
@@ -213,8 +213,8 @@ static tarval *computed_value_And(ir_node *n)
   } else {
     tarval *v;
 
-    if (   (tarval_classify ((v = computed_value (a))) == TV_CLASSIFY_NULL)
-       || (tarval_classify ((v = computed_value (b))) == TV_CLASSIFY_NULL)) {
+    if (   (classify_tarval ((v = computed_value (a))) == TV_CLASSIFY_NULL)
+       || (classify_tarval ((v = computed_value (b))) == TV_CLASSIFY_NULL)) {
       return v;
     }
   }
@@ -233,8 +233,8 @@ static tarval *computed_value_Or(ir_node *n)
     return tarval_or (ta, tb);
   } else {
     tarval *v;
-    if (   (tarval_classify ((v = computed_value (a))) == TV_CLASSIFY_ALL_ONE)
-       || (tarval_classify ((v = computed_value (b))) == TV_CLASSIFY_ALL_ONE)) {
+    if (   (classify_tarval ((v = computed_value (a))) == TV_CLASSIFY_ALL_ONE)
+       || (classify_tarval ((v = computed_value (b))) == TV_CLASSIFY_ALL_ONE)) {
       return v;
     }
   }
@@ -373,8 +373,8 @@ static tarval *computed_value_Proj(ir_node *n)
          return new_tarval_from_long (get_Proj_proj(n) & flags, mode_b);
        }
       } else {  /* check for 3.: */
-       ir_node *aaa = skip_nop(skip_Proj(aa));
-       ir_node *aba = skip_nop(skip_Proj(ab));
+       ir_node *aaa = skip_Id(skip_Proj(aa));
+       ir_node *aba = skip_Id(skip_Proj(ab));
 
        if (   (   (/* aa is ProjP and aaa is Alloc */
                       (get_irn_op(aa) == op_Proj)
@@ -527,7 +527,7 @@ static ir_node *equivalent_node_Block(ir_node *n)
 {
   ir_node *oldn = n;
 
-  /* The Block constructor does not call optimize, but mature_block
+  /* The Block constructor does not call optimize, but mature_immBlock
      calls the optimization. */
   assert(get_Block_matured(n));
 
@@ -539,7 +539,7 @@ static ir_node *equivalent_node_Block(ir_node *n)
      Remaining Phi nodes are just Ids. */
    if ((get_Block_n_cfgpreds(n) == 1) &&
        (get_irn_op(get_Block_cfgpred(n, 0)) == op_Jmp)) {
-     ir_node *predblock = get_nodes_Block(get_Block_cfgpred(n, 0));
+     ir_node *predblock = get_nodes_block(get_Block_cfgpred(n, 0));
      if (predblock == oldn) {
        /* Jmp jumps into the block it is in -- deal self cycle. */
        n = new_Bad();                                      DBG_OPT_DEAD;
@@ -549,7 +549,7 @@ static ir_node *equivalent_node_Block(ir_node *n)
    }
    else if ((get_Block_n_cfgpreds(n) == 1) &&
            (get_irn_op(skip_Proj(get_Block_cfgpred(n, 0))) == op_Cond)) {
-     ir_node *predblock = get_nodes_Block(get_Block_cfgpred(n, 0));
+     ir_node *predblock = get_nodes_block(get_Block_cfgpred(n, 0));
      if (predblock == oldn) {
        /* Jmp jumps into the block it is in -- deal self cycle. */
        n = new_Bad();                                      DBG_OPT_DEAD;
@@ -569,7 +569,7 @@ static ir_node *equivalent_node_Block(ir_node *n)
        (get_irn_mode(get_Cond_selector(get_Proj_pred(a))) == mode_b)) {
       /* Also a single entry Block following a single exit Block.  Phis have
         twice the same operand and will be optimized away. */
-      n = get_nodes_Block(a);                                         DBG_OPT_IFSIM;
+      n = get_nodes_block(a);                                         DBG_OPT_IFSIM;
     }
   } else if (get_opt_unreachable_code() &&
             (n != current_ir_graph->start_block) &&
@@ -596,7 +596,7 @@ static ir_node *equivalent_node_Jmp(ir_node *n)
 {
   /* GL: Why not same for op_Raise?? */
   /* unreachable code elimination */
-  if (is_Bad(get_nodes_Block(n)))
+  if (is_Bad(get_nodes_block(n)))
     n = new_Bad();
 
   return n;
@@ -652,7 +652,7 @@ static ir_node *equivalent_node_neutral_zero(ir_node *n)
 
   /* If this predecessors constant value is zero, the operation is
      unnecessary. Remove it: */
-  if (tarval_classify (tv) == TV_CLASSIFY_NULL) {
+  if (classify_tarval (tv) == TV_CLASSIFY_NULL) {
     n = on;                                                             DBG_OPT_ALGSIM1;
   }
 
@@ -673,7 +673,7 @@ static ir_node *equivalent_node_left_zero(ir_node *n)
   ir_node *a = get_binop_left(n);
   ir_node *b = get_binop_right(n);
 
-  if (tarval_classify(computed_value(b)) == TV_CLASSIFY_NULL) {
+  if (classify_tarval(computed_value(b)) == TV_CLASSIFY_NULL) {
     n = a;                                                              DBG_OPT_ALGSIM1;
   }
 
@@ -718,9 +718,9 @@ static ir_node *equivalent_node_Mul(ir_node *n)
   ir_node *b = get_Mul_right(n);
 
   /* Mul is commutative and has again an other neutral element. */
-  if (tarval_classify (computed_value (a)) == TV_CLASSIFY_ONE) {
+  if (classify_tarval (computed_value (a)) == TV_CLASSIFY_ONE) {
     n = b;                                                              DBG_OPT_ALGSIM1;
-  } else if (tarval_classify (computed_value (b)) == TV_CLASSIFY_ONE) {
+  } else if (classify_tarval (computed_value (b)) == TV_CLASSIFY_ONE) {
     n = a;                                                              DBG_OPT_ALGSIM1;
   }
   return n;
@@ -735,7 +735,7 @@ static ir_node *equivalent_node_Div(ir_node *n)
   ir_node *b = get_Div_right(n);
 
   /* Div is not commutative. */
-  if (tarval_classify(computed_value(b)) == TV_CLASSIFY_ONE) { /* div(x, 1) == x */
+  if (classify_tarval(computed_value(b)) == TV_CLASSIFY_ONE) { /* div(x, 1) == x */
     /* Turn Div into a tuple (mem, bad, a) */
     ir_node *mem = get_Div_mem(n);
     turn_into_tuple(n, 3);
@@ -758,9 +758,9 @@ static ir_node *equivalent_node_And(ir_node *n)
 
   if (a == b) {
     n = a;    /* And has it's own neutral element */
-  } else if (tarval_classify(computed_value(a)) == TV_CLASSIFY_ALL_ONE) {
+  } else if (classify_tarval(computed_value(a)) == TV_CLASSIFY_ALL_ONE) {
     n = b;
-  } else if (tarval_classify(computed_value(b)) == TV_CLASSIFY_ALL_ONE) {
+  } else if (classify_tarval(computed_value(b)) == TV_CLASSIFY_ALL_ONE) {
     n = a;
   }
   if (n != oldn)                                                        DBG_OPT_ALGSIM1;
@@ -970,7 +970,7 @@ static ir_node *equivalent_node_Proj(ir_node *n)
       n = new_Bad();
     }
   } else if (get_irn_mode(n) == mode_X &&
-            is_Bad(get_nodes_Block(n))) {
+            is_Bad(get_nodes_block(n))) {
     /* Remove dead control flow -- early gigo. */
     n = new_Bad();
   }
@@ -1159,7 +1159,7 @@ static ir_node *transform_node_DivMod(ir_node *n)
     set_Tuple_pred(n, pn_DivMod_X_except, new_Bad());  /* no exception */
     set_Tuple_pred(n, pn_DivMod_res_div,  a);
     set_Tuple_pred(n, pn_DivMod_res_mod,  b);
-    assert(get_nodes_Block(n));
+    assert(get_nodes_block(n));
   }
 
   return n;
@@ -1178,7 +1178,7 @@ static ir_node *transform_node_Cond(ir_node *n)
       (get_opt_unreachable_code())) {
     /* It's a boolean Cond, branching on a boolean constant.
               Replace it by a tuple (Bad, Jmp) or (Jmp, Bad) */
-    jmp = new_r_Jmp(current_ir_graph, get_nodes_Block(n));
+    jmp = new_r_Jmp(current_ir_graph, get_nodes_block(n));
     turn_into_tuple(n, 2);
     if (ta == tarval_b_true) {
       set_Tuple_pred(n, pn_Cond_false, new_Bad());
@@ -1188,7 +1188,7 @@ static ir_node *transform_node_Cond(ir_node *n)
       set_Tuple_pred(n, pn_Cond_true, new_Bad());
     }
     /* We might generate an endless loop, so keep it alive. */
-    add_End_keepalive(get_irg_end(current_ir_graph), get_nodes_Block(n));
+    add_End_keepalive(get_irg_end(current_ir_graph), get_nodes_block(n));
   } else if ((ta != tarval_bad) &&
             (get_irn_mode(a) == mode_Iu) &&
             (get_Cond_kind(n) == dense) &&
@@ -1197,21 +1197,21 @@ static ir_node *transform_node_Cond(ir_node *n)
        Also this tuple might get really big...
        I generate the Jmp here, and remember it in link.  Link is used
        when optimizing Proj. */
-    set_irn_link(n, new_r_Jmp(current_ir_graph, get_nodes_Block(n)));
+    set_irn_link(n, new_r_Jmp(current_ir_graph, get_nodes_block(n)));
     /* We might generate an endless loop, so keep it alive. */
-    add_End_keepalive(get_irg_end(current_ir_graph), get_nodes_Block(n));
+    add_End_keepalive(get_irg_end(current_ir_graph), get_nodes_block(n));
   } else if ((get_irn_op(a) == op_Eor)
             && (get_irn_mode(a) == mode_b)
-            && (tarval_classify(computed_value(get_Eor_right(a))) == TV_CLASSIFY_ONE)) {
+            && (classify_tarval(computed_value(get_Eor_right(a))) == TV_CLASSIFY_ONE)) {
     /* The Eor is a negate.  Generate a new Cond without the negate,
        simulate the negate by exchanging the results. */
-    set_irn_link(n, new_r_Cond(current_ir_graph, get_nodes_Block(n),
+    set_irn_link(n, new_r_Cond(current_ir_graph, get_nodes_block(n),
                               get_Eor_left(a)));
   } else if ((get_irn_op(a) == op_Not)
             && (get_irn_mode(a) == mode_b)) {
     /* A Not before the Cond.  Generate a new Cond without the Not,
        simulate the Not by exchanging the results. */
-    set_irn_link(n, new_r_Cond(current_ir_graph, get_nodes_Block(n),
+    set_irn_link(n, new_r_Cond(current_ir_graph, get_nodes_block(n),
                               get_Not_op(a)));
   }
   return n;
@@ -1225,16 +1225,16 @@ static ir_node *transform_node_Eor(ir_node *n)
   if ((get_irn_mode(n) == mode_b)
       && (get_irn_op(a) == op_Proj)
       && (get_irn_mode(a) == mode_b)
-      && (tarval_classify (computed_value (b)) == TV_CLASSIFY_ONE)
+      && (classify_tarval (computed_value (b)) == TV_CLASSIFY_ONE)
       && (get_irn_op(get_Proj_pred(a)) == op_Cmp))
     /* The Eor negates a Cmp. The Cmp has the negated result anyways! */
-    n = new_r_Proj(current_ir_graph, get_nodes_Block(n), get_Proj_pred(a),
+    n = new_r_Proj(current_ir_graph, get_nodes_block(n), get_Proj_pred(a),
                   mode_b, get_negated_pnc(get_Proj_proj(a)));
   else if ((get_irn_mode(n) == mode_b)
-          && (tarval_classify (computed_value (b)) == TV_CLASSIFY_ONE))
+          && (classify_tarval (computed_value (b)) == TV_CLASSIFY_ONE))
     /* The Eor is a Not. Replace it by a Not. */
     /*   ????!!!Extend to bitfield 1111111. */
-    n = new_r_Not(current_ir_graph, get_nodes_Block(n), a, mode_b);
+    n = new_r_Not(current_ir_graph, get_nodes_block(n), a, mode_b);
 
   return n;
 }
@@ -1251,7 +1251,7 @@ static ir_node *transform_node_Not(ir_node *n)
       && (get_irn_mode(a) == mode_b)
       && (get_irn_op(get_Proj_pred(a)) == op_Cmp))
     /* We negate a Cmp. The Cmp has the negated result anyways! */
-    n = new_r_Proj(current_ir_graph, get_nodes_Block(n), get_Proj_pred(a),
+    n = new_r_Proj(current_ir_graph, get_nodes_block(n), get_Proj_pred(a),
                   mode_b, get_negated_pnc(get_Proj_proj(a)));
 
   return n;
@@ -1272,7 +1272,7 @@ static ir_node *transform_node_Proj(ir_node *proj)
     b = get_Div_right(n);
     tb = computed_value(b);
 
-    if (tb != tarval_bad && tarval_classify(tb) != TV_CLASSIFY_NULL) { /* div(x, c) && c != 0 */
+    if (tb != tarval_bad && classify_tarval(tb) != TV_CLASSIFY_NULL) { /* div(x, c) && c != 0 */
       ir_node *div, *proj;
       ir_node *a = get_Div_left(n);
       ir_node *mem = get_Div_mem(n);
@@ -1281,9 +1281,9 @@ static ir_node *transform_node_Proj(ir_node *proj)
       set_optimize(0);
       {
         div = new_rd_Div(get_irn_dbg_info(n), current_ir_graph,
-         get_nodes_Block(n), get_irg_initial_mem(current_ir_graph), a, b);
+         get_nodes_block(n), get_irg_initial_mem(current_ir_graph), a, b);
 
-        proj = new_r_Proj(current_ir_graph, get_nodes_Block(n), div, get_irn_mode(a), pn_Div_res);
+        proj = new_r_Proj(current_ir_graph, get_nodes_block(n), div, get_irn_mode(a), pn_Div_res);
       }
       set_optimize(rem);
 
@@ -1297,7 +1297,7 @@ static ir_node *transform_node_Proj(ir_node *proj)
     b = get_Mod_right(n);
     tb = computed_value(b);
 
-    if (tb != tarval_bad && tarval_classify(tb) != TV_CLASSIFY_NULL) { /* mod(x, c) && c != 0 */
+    if (tb != tarval_bad && classify_tarval(tb) != TV_CLASSIFY_NULL) { /* mod(x, c) && c != 0 */
       ir_node *mod, *proj;
       ir_node *a = get_Mod_left(n);
       ir_node *mem = get_Mod_mem(n);
@@ -1306,9 +1306,9 @@ static ir_node *transform_node_Proj(ir_node *proj)
       set_optimize(0);
       {
         mod = new_rd_Mod(get_irn_dbg_info(n), current_ir_graph,
-         get_nodes_Block(n), get_irg_initial_mem(current_ir_graph), a, b);
+         get_nodes_block(n), get_irg_initial_mem(current_ir_graph), a, b);
 
-        proj = new_r_Proj(current_ir_graph, get_nodes_Block(n), mod, get_irn_mode(a), pn_Mod_res);
+        proj = new_r_Proj(current_ir_graph, get_nodes_block(n), mod, get_irn_mode(a), pn_Mod_res);
       }
       set_optimize(rem);
 
@@ -1322,7 +1322,7 @@ static ir_node *transform_node_Proj(ir_node *proj)
     b = get_DivMod_right(n);
     tb = computed_value(b);
 
-    if (tb != tarval_bad && tarval_classify(tb) != TV_CLASSIFY_NULL) { /* DivMod(x, c) && c != 0 */
+    if (tb != tarval_bad && classify_tarval(tb) != TV_CLASSIFY_NULL) { /* DivMod(x, c) && c != 0 */
       ir_node *div_mod, *proj_div, *proj_mod;
       ir_node *a = get_Mod_left(n);
       ir_node *mem = get_Mod_mem(n);
@@ -1331,10 +1331,10 @@ static ir_node *transform_node_Proj(ir_node *proj)
       set_optimize(0);
       {
         div_mod = new_rd_DivMod(get_irn_dbg_info(n), current_ir_graph,
-         get_nodes_Block(n), get_irg_initial_mem(current_ir_graph), a, b);
+         get_nodes_block(n), get_irg_initial_mem(current_ir_graph), a, b);
 
-        proj_div = new_r_Proj(current_ir_graph, get_nodes_Block(n), div_mod, get_irn_mode(a), pn_DivMod_res_div);
-        proj_mod = new_r_Proj(current_ir_graph, get_nodes_Block(n), div_mod, get_irn_mode(a), pn_DivMod_res_mod);
+        proj_div = new_r_Proj(current_ir_graph, get_nodes_block(n), div_mod, get_irn_mode(a), pn_DivMod_res_div);
+        proj_mod = new_r_Proj(current_ir_graph, get_nodes_block(n), div_mod, get_irn_mode(a), pn_DivMod_res_mod);
       }
       set_optimize(rem);
 
@@ -1471,7 +1471,7 @@ static ir_node *transform_node_Or(ir_node *or)
   tv4 = get_Const_tarval(c4);
 
   tv = tarval_or(tv4, tv2);
-  if (tarval_classify(tv) != TV_CLASSIFY_ALL_ONE) {
+  if (classify_tarval(tv) != TV_CLASSIFY_ALL_ONE) {
     /* have at least one 0 at the same bit position */
     return or;
   }
@@ -1666,8 +1666,8 @@ vt_cmp (const void *elt, const void *key)
   if (irn_arity_a != get_irn_arity(b))
     return 1;
 
-  /* for block-local cse and pinned nodes: */
-  if (!get_opt_global_cse() || (get_op_pinned(get_irn_op(a)) == pinned)) {
+  /* for block-local cse and op_pin_state_pinned nodes: */
+  if (!get_opt_global_cse() || (get_op_pinned(get_irn_op(a)) == op_pin_state_pinned)) {
     if (get_irn_n(a, -1) != get_irn_n(b, -1))
       return 1;
   }
@@ -1769,7 +1769,7 @@ identify (pset *value_table, ir_node *n)
 }
 
 /**
- * During construction we set the pinned flag in the graph right when the
+ * During construction we set the op_pin_state_pinned flag in the graph right when the
  * optimization is performed.  The flag turning on procedure global cse could
  * be changed between two allocations.  This way we are safe.
  */
@@ -1778,7 +1778,7 @@ identify_cons (pset *value_table, ir_node *n) {
   ir_node *old = n;
   n = identify(value_table, n);
   if (get_irn_n(old, -1) != get_irn_n(n, -1))
-    set_irg_pinned(current_ir_graph, floats);
+    set_irg_pinned(current_ir_graph, op_pin_state_floats);
   return n;
 }
 
@@ -1912,7 +1912,7 @@ optimize_node (ir_node *n)
   /** common subexpression elimination **/
   /* Checks whether n is already available. */
   /* The block input is used to distinguish different subexpressions. Right
-     now all nodes are pinned to blocks, i.e., the cse only finds common
+     now all nodes are op_pin_state_pinned to blocks, i.e., the cse only finds common
      subexpressions within a block. */
   if (get_opt_cse())
     n = identify_cons (current_ir_graph->value_table, n);
@@ -1996,7 +1996,7 @@ optimize_in_place_2 (ir_node *n)
   /** common subexpression elimination **/
   /* Checks whether n is already available. */
   /* The block input is used to distinguish different subexpressions.  Right
-     now all nodes are pinned to blocks, i.e., the cse only finds common
+     now all nodes are op_pin_state_pinned to blocks, i.e., the cse only finds common
      subexpressions within a block. */
   if (get_opt_cse()) {
     n = identify (current_ir_graph->value_table, n);
@@ -2035,7 +2035,7 @@ optimize_in_place (ir_node *n)
   assert(get_irg_phase_state(current_ir_graph) != phase_building);
 
   if (get_opt_global_cse())
-    set_irg_pinned(current_ir_graph, floats);
+    set_irg_pinned(current_ir_graph, op_pin_state_floats);
   if (get_irg_outs_state(current_ir_graph) == outs_consistent)
     set_irg_outs_inconsistent(current_ir_graph);
   /* Maybe we could also test whether optimizing the node can
index 35f28f1..5c46830 100644 (file)
@@ -68,7 +68,7 @@ ir_prog *new_ir_prog (void) {
   res->max_node_nr = 0;
 #endif
 
-  res->glob_type = new_type_class(id_from_str (GLOBAL_TYPE_NAME,
+  res->glob_type = new_type_class(new_id_from_chars (GLOBAL_TYPE_NAME,
                                               strlen(GLOBAL_TYPE_NAME)));
   /* Remove type from type list.  Must be treated differently than
      other types. */
@@ -76,7 +76,7 @@ ir_prog *new_ir_prog (void) {
 
   res->const_code_irg = new_const_code_irg();
 
-  res->outs_state = no_outs;
+  res->outs_state = outs_none;
   res->ip_outedges = NULL;
 
   return res;
index cf02831..40225cd 100644 (file)
@@ -75,9 +75,6 @@ extern ir_prog *irp;
  */
 ir_prog *get_irp(void);
 
-/** initializes ir_prog. Calls the constructor for an ir_prog. */
-void init_irprog(void);
-
 /** Creates a new ir_prog, returns it and sets irp with it.
  *  Automatically called by init_firm() through init_irprog. */
 ir_prog *new_ir_prog (void);
index 07d3de8..4e7108b 100644 (file)
@@ -108,6 +108,9 @@ __get_const_code_irg(void)
 void           set_irp_ip_outedges(ir_node ** ip_outedges);
 ir_node**      get_irp_ip_outedges(void);
 
+/** initializes ir_prog. Calls the constructor for an ir_prog. */
+void init_irprog(void);
+
 #define get_irp_n_irgs()       __get_irp_n_irgs()
 #define get_irp_irg(pos)       __get_irp_irg(pos)
 #define get_irp_n_types()      __get_irp_n_types()
index ac88693..e8fe382 100644 (file)
@@ -157,7 +157,7 @@ static void show_proj_failure_ent(ir_node *n, entity *ent)
  */
 static void show_node_on_graph(ir_graph *irg, ir_node *n)
 {
-  entity *ent = get_irg_ent(irg);
+  entity *ent = get_irg_entity(irg);
 
   if (ent)
     fprintf(stderr, "\nFIRM: irn_vrfy_irg() of entity %s, node %ld %s%s\n",
@@ -194,7 +194,7 @@ static void show_call_param(ir_node *n, type *mt)
  */
 static void show_return_modes(ir_graph *irg, ir_node *n, type *mt, int i)
 {
-  entity *ent = get_irg_ent(irg);
+  entity *ent = get_irg_entity(irg);
 
   fprintf(stderr, "\nFIRM: irn_vrfy_irg() Return node %ld in entity \"%s\" mode %s different from type mode %s\n",
     get_irn_node_nr(n), get_entity_name(ent),
@@ -208,7 +208,7 @@ static void show_return_modes(ir_graph *irg, ir_node *n, type *mt, int i)
  */
 static void show_return_nres(ir_graph *irg, ir_node *n, type *mt)
 {
-  entity *ent = get_irg_ent(irg);
+  entity *ent = get_irg_entity(irg);
 
   fprintf(stderr, "\nFIRM: irn_vrfy_irg() Return node %ld in entity \"%s\" has %d results different from type %d\n",
     get_irn_node_nr(n), get_entity_name(ent),
@@ -234,7 +234,7 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
   ir_mode *mode;
   int proj;
 
-  pred = skip_nop(get_Proj_pred(p));
+  pred = skip_Id(get_Proj_pred(p));
   ASSERT_AND_RET(get_irn_mode(pred) == mode_T, "mode of a 'projed' node is not Tuple", 0);
   mode = get_irn_mode(p);
   proj = get_Proj_proj(p);
@@ -243,13 +243,13 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
     case iro_Start:
       ASSERT_AND_RET_DBG(
           (
-           (proj == pns_initial_exec   && mode == mode_X) ||
-           (proj == pns_global_store   && mode == mode_M) ||
-           (proj == pns_frame_base     && mode_is_reference(mode)) ||
-           (proj == pns_globals        && mode_is_reference(mode)) ||
-           (proj == pns_args           && mode == mode_T) ||
-           (proj == pns_value_arg_base && mode_is_reference(mode)) ||
-           (proj == pns_value_arg_base && mode == mode_T)    /* FIXME: only one of those */
+           (proj == pn_Start_X_initial_exec && mode == mode_X) ||
+           (proj == pn_Start_M         && mode == mode_M) ||
+           (proj == pn_Start_P_frame_base && mode_is_reference(mode)) ||
+           (proj == pn_Start_P_globals && mode_is_reference(mode)) ||
+           (proj == pn_Start_T_args    && mode == mode_T) ||
+           (proj == pn_Start_P_value_arg_base && mode_is_reference(mode)) ||
+           (proj == pn_Start_P_value_arg_base && mode == mode_T)    /* FIXME: only one of those */
           ),
           "wrong Proj from Start", 0,
       show_proj_failure(p);
@@ -419,14 +419,14 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
         type *mt; /* A method type */
         long nr = get_Proj_proj(pred);
 
-        pred = skip_nop(get_Proj_pred(pred));
+        pred = skip_Id(get_Proj_pred(pred));
         ASSERT_AND_RET((get_irn_mode(pred) == mode_T), "Proj from something not a tuple", 0);
         switch (get_irn_opcode(pred))
         {
           case iro_Start:
-            mt = get_entity_type(get_irg_ent(irg));
+            mt = get_entity_type(get_irg_entity(irg));
 
-        if (nr == pns_args) {
+        if (nr == pn_Start_T_args) {
               ASSERT_AND_RET(
                   (proj >= 0 && mode_is_data(mode)),
                   "wrong Proj from Proj from Start", 0);
@@ -441,7 +441,7 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
                   (mode == get_type_mode(get_method_param_type(mt, proj))),
                   "Mode of Proj from Start doesn't match mode of param type.", 0);
             }
-        else if (nr == pns_value_arg_base) {
+        else if (nr == pn_Start_P_value_arg_base) {
           ASSERT_AND_RET(
                   (proj >= 0 && mode_is_reference(mode)),
                   "wrong Proj from Proj from Start", 0
@@ -633,7 +633,7 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       };
       ASSERT_AND_RET( mymode == mode_X, "Result X", 0 );   /* result X */
       /* Compare returned results with result types of method type */
-      mt = get_entity_type(get_irg_ent(irg));
+      mt = get_entity_type(get_irg_entity(irg));
       ASSERT_AND_RET_DBG( get_Return_n_ress(n) == get_method_n_ress(mt),
         "Number of results for Return doesn't match number of results in type.", 0,
       show_return_nres(irg, n, mt););
@@ -669,11 +669,6 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
 
   case iro_Const: {
       tarval *tv = get_Const_tarval(n);
-      if (tarval_is_entity(tv))
-         ASSERT_AND_RET(
-                        (get_irn_irg(n) == get_const_code_irg()) ||
-                        (get_entity_peculiarity(get_tarval_entity(tv)) != peculiarity_description),
-                        "descriptions have no address", 0);
          ASSERT_AND_RET(
                         /* Const: BB --> data */
                         (mode_is_data (mymode) ||
@@ -1137,7 +1132,7 @@ int irg_vrfy(ir_graph *irg)
   rem = current_ir_graph;
   current_ir_graph = irg;
 
-  assert(get_irg_pinned(irg) == pinned);
+  assert(get_irg_pinned(irg) == op_pin_state_pinned);
 
   irg_walk(irg->end, vrfy_wrap, NULL, &res);
 
index 68d4a13..46d6170 100644 (file)
@@ -66,7 +66,7 @@ int irn_vrfy_irg_dump(struct ir_node *checknode, ir_graph *irg, const char **bad
 
 /**
  * Calls irn_vrfy for each node in irg.
- * Graph must be in state "pinned".
+ * Graph must be in state "op_pin_state_pinned".
  *
  * \return
  *     NON-zero on success.
index 0c1060b..bf9e48f 100644 (file)
@@ -162,7 +162,7 @@ static void do_opt_tail_rec(ir_graph *irg, ir_node *rets, int n_tail_calls)
   for (i = 1, p = rets; p; p = get_irn_link(p)) {
     ir_node *jmp;
 
-    switch_block(get_nodes_Block(p));
+    set_cur_block(get_nodes_block(p));
     jmp = new_Jmp();
 
     exchange(p, new_Bad());
@@ -275,14 +275,10 @@ void opt_tail_rec_irg(ir_graph *irg)
     /* check if it's a recursive call */
     call_ptr = get_Call_ptr(call);
 
-    if (get_irn_op(call_ptr) != op_Const)
+    if (get_irn_op(call_ptr) != op_SymConst)
       continue;
 
-    tv = get_Const_tarval(call_ptr);
-    if (! tarval_is_entity(tv))
-      continue;
-
-    ent = get_tarval_entity(tv);
+    ent = get_SymConst_entity(call_ptr);
     if (!ent || get_entity_irg(ent) != irg)
       continue;
 
index 26f083d..b4ab098 100644 (file)
@@ -319,7 +319,7 @@ static void update_dominators (ir_node *block, void *env)
   /* check preds: */
   for (i = 0; i < n_ins; i ++)
     {
-      ir_node *in  = get_nodes_Block (get_irn_n (block, i));
+      ir_node *in  = get_nodes_block (get_irn_n (block, i));
       bs_t in_mask = get_mask  (dt, in);
 
       new_mask &= in_mask;
@@ -378,7 +378,7 @@ static ir_node *_get_idom (dt_t *dt, ir_node *block)
          {
                ir_node *ndom = 0;
 
-               pred = get_nodes_Block (get_irn_n (block, i));
+               pred = get_nodes_block (get_irn_n (block, i));
                ndom = _get_idom (dt, pred);
 
                if (ndom != idom)
index fc9e518..ec58115 100644 (file)
@@ -398,7 +398,7 @@ static void count_block_info(ir_node *node, graph_entry_t *graph)
     /* count all incoming edges */
     for (i = 0; i < arity; ++i) {
       ir_node *pred = get_irn_n(node, i);
-      ir_node *other_block = get_nodes_Block(pred);
+      ir_node *other_block = get_nodes_block(pred);
       block_entry_t *b_entry_other = block_get_entry(get_irn_node_nr(other_block), graph->block_hash);
 
       cnt_inc(&b_entry->cnt_in_edges); /* an edge coming from another block */
@@ -410,7 +410,7 @@ static void count_block_info(ir_node *node, graph_entry_t *graph)
     // return;
   }
 
-  block   = get_nodes_Block(node);
+  block   = get_nodes_block(node);
   b_entry = block_get_entry(get_irn_node_nr(block), graph->block_hash);
 
   /* we have a new nodes */
@@ -425,7 +425,7 @@ static void count_block_info(ir_node *node, graph_entry_t *graph)
     if (get_irn_op(pred) == op_Block)
       continue;
 
-    other_block = get_nodes_Block(pred);
+    other_block = get_nodes_block(pred);
 
     if (other_block == block)
       cnt_inc(&b_entry->cnt_edges);    /* a in block edge */
@@ -778,7 +778,7 @@ ir_op *stat_get_op_from_opcode(opcode code)
 }
 
 /* initialize the statistics module. */
-void stat_init(unsigned enable_options)
+void init_stat(void)
 {
 #define X(a)  a, sizeof(a)-1
 
@@ -794,10 +794,10 @@ void stat_init(unsigned enable_options)
 
   /* build the pseudo-ops */
   _op_Phi0.code = --pseudo_id;
-  _op_Phi0.name = id_from_str(X("Phi0"));
+  _op_Phi0.name = new_id_from_chars(X("Phi0"));
 
   _op_PhiM.code = --pseudo_id;
-  _op_PhiM.name = id_from_str(X("PhiM"));
+  _op_PhiM.name = new_id_from_chars(X("PhiM"));
 
   /* create the hash-tables */
   status->irg_hash   = new_pset(graph_cmp, 8);
@@ -1131,7 +1131,7 @@ void stat_finish(void)
 #define FIRM_STATISTICS
 #include "firmstat.h"
 
-void stat_init(unsigned options) {}
+void init_stat(void) {}
 
 void stat_finish(void) {}
 
index 106e322..0769cc1 100644 (file)
@@ -55,7 +55,13 @@ typedef enum {
  *
  * @param enable_options  Bitmask containing the statistic options
  */
-void stat_init(unsigned enable_options);
+
+void init_stat(void);
+
+/**
+ * Finish the statistics.
+ */
+void stat_finish(void);
 
 /**
  * A new IR op is registered.
@@ -146,7 +152,8 @@ ir_op *stat_get_op_from_opcode(opcode code);
 
 #else
 
-#define stat_init(flag)
+#define init_stat()
+#define stat_finish()
 #define stat_new_ir_op(op)
 #define stat_free_ir_op(op)
 #define stat_new_node(node)
index 95ae52e..c923afc 100644 (file)
@@ -197,7 +197,6 @@ copy_entity_name (entity *old, ident *new_name) {
 void
 free_entity (entity *ent) {
   assert(ent && ent->kind == k_entity);
-  free_tarval_entity(ent);
   free_entity_attrs(ent);
   ent->kind = k_BAD;
   free(ent);
index 5adb666..a83a4e1 100644 (file)
@@ -47,7 +47,7 @@ mangle_entity (entity *ent)
   obstack_grow(&mangle_obst,get_id_str(ent->name),get_id_strlen(ent->name));
   len = obstack_object_size (&mangle_obst);
   cp = obstack_finish (&mangle_obst);
-  res = id_from_str(cp, len);
+  res = new_id_from_chars(cp, len);
   obstack_free (&mangle_obst, cp);
   return res;
 }
@@ -63,7 +63,7 @@ ident *mangle (ident *first, ident* scnd) {
   obstack_grow(&mangle_obst, get_id_str(scnd), get_id_strlen(scnd));
   len = obstack_object_size (&mangle_obst);
   cp = obstack_finish (&mangle_obst);
-  res = id_from_str (cp, len);
+  res = new_id_from_chars (cp, len);
   obstack_free (&mangle_obst, cp);
   return res;
 }
@@ -79,7 +79,7 @@ ident *mangle_u (ident *first, ident* scnd) {
   obstack_grow(&mangle_obst,get_id_str(scnd),get_id_strlen(scnd));
   len = obstack_object_size (&mangle_obst);
   cp = obstack_finish (&mangle_obst);
-  res = id_from_str (cp, len);
+  res = new_id_from_chars (cp, len);
   obstack_free (&mangle_obst, cp);
   return res;
 }
index fc9f99a..b95a07a 100644 (file)
@@ -51,17 +51,17 @@ free_tpop(tp_op* tpop) {
 void
 init_tpop(void)
 {
-  type_class       = new_tpop (tpo_class      , id_from_str("class"       , 5), sizeof (cls_attr));
-  type_struct      = new_tpop (tpo_struct     , id_from_str("struct"      , 6), sizeof (stc_attr));
-  type_method      = new_tpop (tpo_method     , id_from_str("method"      , 6), sizeof (mtd_attr));
-  type_union       = new_tpop (tpo_union      , id_from_str("union"       , 5), sizeof (uni_attr));
-  type_array       = new_tpop (tpo_array      , id_from_str("array"       , 5), sizeof (arr_attr));
-  type_enumeration = new_tpop (tpo_enumeration, id_from_str("enumeration" ,11), sizeof (enm_attr));
-  type_pointer     = new_tpop (tpo_pointer    , id_from_str("pointer"     , 7), sizeof (ptr_attr));
-  type_primitive   = new_tpop (tpo_primitive  , id_from_str("primitive"   , 9), /* sizeof (pri_attr) */ 0);
-  type_id          = new_tpop (tpo_id         , id_from_str("type_id"     , 7), /* sizeof (id_attr)  */ 0);
-  tpop_none        = new_tpop (tpo_none       , id_from_str("tpop_none"   , 9), /* sizeof (non_attr) */ 0);
-  tpop_unknown     = new_tpop (tpo_unknown    , id_from_str("tpop_unknown",12), /* sizeof (ukn_attr) */ 0);
+  type_class       = new_tpop (tpo_class      , new_id_from_chars("class"       , 5), sizeof (cls_attr));
+  type_struct      = new_tpop (tpo_struct     , new_id_from_chars("struct"      , 6), sizeof (stc_attr));
+  type_method      = new_tpop (tpo_method     , new_id_from_chars("method"      , 6), sizeof (mtd_attr));
+  type_union       = new_tpop (tpo_union      , new_id_from_chars("union"       , 5), sizeof (uni_attr));
+  type_array       = new_tpop (tpo_array      , new_id_from_chars("array"       , 5), sizeof (arr_attr));
+  type_enumeration = new_tpop (tpo_enumeration, new_id_from_chars("enumeration" ,11), sizeof (enm_attr));
+  type_pointer     = new_tpop (tpo_pointer    , new_id_from_chars("pointer"     , 7), sizeof (ptr_attr));
+  type_primitive   = new_tpop (tpo_primitive  , new_id_from_chars("primitive"   , 9), /* sizeof (pri_attr) */ 0);
+  type_id          = new_tpop (tpo_id         , new_id_from_chars("type_id"     , 7), /* sizeof (id_attr)  */ 0);
+  tpop_none        = new_tpop (tpo_none       , new_id_from_chars("tpop_none"   , 9), /* sizeof (non_attr) */ 0);
+  tpop_unknown     = new_tpop (tpo_unknown    , new_id_from_chars("tpop_unknown",12), /* sizeof (ukn_attr) */ 0);
 }
 
 /* Finalize the topo module.
index 3e7c3bc..04ce12f 100644 (file)
@@ -1287,7 +1287,7 @@ type *new_type_array         (ident *name, int n_dimensions,
   current_ir_graph = rem;
 
   res->attr.aa.element_type = element_type;
-  new_entity(res, mangle_u(name, id_from_str("elem_ent", 8)), element_type);
+  new_entity(res, mangle_u(name, new_id_from_chars("elem_ent", 8)), element_type);
 
   return res;
 }
@@ -1374,7 +1374,7 @@ long     get_array_lower_bound_int  (type *array, int dimension) {
   assert(array && (array->type_op == type_array));
   node = array->attr.aa.lower_bound[dimension];
   assert(get_irn_op(node) == op_Const);
-  return tarval_to_long(get_Const_tarval(node));
+  return get_tarval_long(get_Const_tarval(node));
 }
 int       has_array_upper_bound  (type *array, int dimension) {
   assert(array && (array->type_op == type_array));
@@ -1389,7 +1389,7 @@ long     get_array_upper_bound_int  (type *array, int dimension) {
   assert(array && (array->type_op == type_array));
   node = array->attr.aa.upper_bound[dimension];
   assert(get_irn_op(node) == op_Const);
-  return tarval_to_long(get_Const_tarval(node));
+  return get_tarval_long(get_Const_tarval(node));
 }
 
 void set_array_order (type *array, int dimension, int order) {
index bbf5d22..043b3b0 100644 (file)
@@ -232,7 +232,7 @@ void type_walk_irg (ir_graph *irg,
   ++type_visited;
   irg_walk(get_irg_end(irg), start_type_walk, NULL, &type_env);
 
-  type_walk_2((type_or_ent *)get_irg_ent(irg), pre, post, env);
+  type_walk_2((type_or_ent *)get_irg_entity(irg), pre, post, env);
 
   type_walk_2((type_or_ent *)get_irg_frame_type(irg), pre, post, env);
 
index ce122e7..80af061 100644 (file)
@@ -358,7 +358,7 @@ int tarval_is_long(tarval *tv)
 }
 
 /* this might overflow the machine's long, so use only with small values */
-long tarval_to_long(tarval* tv)
+long get_tarval_long(tarval* tv)
 {
   ANNOUNCE();
   assert(tarval_is_long(tv) && "tarval too big to fit in long");
@@ -394,7 +394,7 @@ int tarval_is_double(tarval *tv)
   return (get_mode_sort(tv->mode) == irms_float_number);
 }
 
-long double tarval_to_double(tarval *tv)
+long double get_tarval_double(tarval *tv)
 {
   ANNOUNCE();
   assert(tarval_is_double(tv));
@@ -402,58 +402,6 @@ long double tarval_to_double(tarval *tv)
   return fc_val_to_float(tv->value);
 }
 
-/* The tarval represents the address of the entity.  As the address must
-   be constant the entity must have as owner the global type.
- * We no more support this function: Use the new SymConst instead.
- */
-tarval *new_tarval_from_entity (entity *ent, ir_mode *mode)
-{
-  ANNOUNCE();
-  assert(ent);
-  assert(mode && (get_mode_sort(mode) == irms_reference));
-
-  return get_tarval((void *)ent, 0, mode);
-}
-
-
-int tarval_is_entity(tarval *tv)
-{
-  ANNOUNCE();
-  assert(tv);
-  /* tv->value == NULL means dereferencing a null pointer */
-  return ((get_mode_sort(tv->mode) == irms_reference) && (tv->value != NULL) && (tv->length == 0)
-      && (tv != tarval_P_void));
-}
-
-#undef tarval_to_entity
-entity *tarval_to_entity(tarval *tv) { return get_tarval_entity(tv); }
-entity *get_tarval_entity(tarval *tv)
-{
-  ANNOUNCE();
-  assert(tv);
-
-  if (tarval_is_entity(tv))
-    return (entity *)tv->value;
-  else {
-    assert(0 && "tarval did not represent an entity");
-    return NULL;
-  }
-}
-
-void free_tarval_entity(entity *ent) {
-  /* There can be a tarval referencing this entity.  Even if the
-     tarval is not used by the code any more, it can still reference
-     the entity as tarvals live indepently of the entity referenced.
-     Further the tarval is hashed into a set. If a hash function
-     evaluation happens to collide with this tarval, we will vrfy that
-     it contains a proper entity and we will crash if the entity is
-     freed.
-
-     Unluckily, tarvals can neither be changed nor deleted, and to find
-     one, all existing reference modes have to be tried -> a facility
-     to retrieve all modes of a kind is needed. */
-  ANNOUNCE();
-}
 
 /*
  * Access routines for tarval fields ========================================
@@ -506,7 +454,7 @@ tarval *get_tarval_max(ir_mode *mode)
   ANNOUNCE();
   assert(mode);
 
-  if (get_mode_vector_elems(mode) > 1) {
+  if (get_mode_n_vector_elems(mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -551,7 +499,7 @@ tarval *get_tarval_min(ir_mode *mode)
   ANNOUNCE();
   assert(mode);
 
-  if (get_mode_vector_elems(mode) > 1) {
+  if (get_mode_n_vector_elems(mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -596,7 +544,7 @@ tarval *get_tarval_null(ir_mode *mode)
   ANNOUNCE();
   assert(mode);
 
-  if (get_mode_vector_elems(mode) > 1) {
+  if (get_mode_n_vector_elems(mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -628,7 +576,7 @@ tarval *get_tarval_one(ir_mode *mode)
   ANNOUNCE();
   assert(mode);
 
-  if (get_mode_vector_elems(mode) > 1) {
+  if (get_mode_n_vector_elems(mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -659,7 +607,7 @@ tarval *get_tarval_nan(ir_mode *mode)
   ANNOUNCE();
   assert(mode);
 
-  if (get_mode_vector_elems(mode) > 1) {
+  if (get_mode_n_vector_elems(mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -690,7 +638,7 @@ tarval *get_tarval_inf(ir_mode *mode)
   ANNOUNCE();
   assert(mode);
 
-  if (get_mode_vector_elems(mode) > 1) {
+  if (get_mode_n_vector_elems(mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -728,7 +676,7 @@ int tarval_is_negative(tarval *a)
   ANNOUNCE();
   assert(a);
 
-  if (get_mode_vector_elems(a->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1) {
     /* vector arithmetic not implemented yet */
     assert(0 && "tarval_is_negative is not allowed for vector modes");
     return 0;
@@ -784,7 +732,7 @@ pnc_number tarval_cmp(tarval *a, tarval *b)
   if (a == b) return Eq;
   if (a->mode != b->mode) return False;
 
-  if (get_mode_vector_elems(a->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1) {
     /* vector arithmetic not implemented yet */
     assert(0 && "cmp not implemented for vector modes");
   }
@@ -829,7 +777,7 @@ tarval *tarval_convert_to(tarval *src, ir_mode *m)
 
   if (src->mode == m) return src;
 
-  if (get_mode_vector_elems(src->mode) > 1) {
+  if (get_mode_n_vector_elems(src->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -985,7 +933,7 @@ tarval *tarval_neg(tarval *a)
   assert(mode_is_num(a->mode)); /* negation only for numerical values */
   assert(mode_is_signed(a->mode)); /* negation is difficult without negative numbers, isn't it */
 
-  if (get_mode_vector_elems(a->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -1018,7 +966,7 @@ tarval *tarval_add(tarval *a, tarval *b)
   assert(b);
   assert((a->mode == b->mode) || (get_mode_sort(a->mode) == irms_character && mode_is_int(b->mode)));
 
-  if (get_mode_vector_elems(a->mode) > 1 || get_mode_vector_elems(b->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1 || get_mode_n_vector_elems(b->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -1053,7 +1001,7 @@ tarval *tarval_sub(tarval *a, tarval *b)
   assert(b);
   assert((a->mode == b->mode) || (get_mode_sort(a->mode) == irms_character && mode_is_int(b->mode)));
 
-  if (get_mode_vector_elems(a->mode) > 1 || get_mode_vector_elems(b->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1 || get_mode_n_vector_elems(b->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -1087,7 +1035,7 @@ tarval *tarval_mul(tarval *a, tarval *b)
   assert(b);
   assert((a->mode == b->mode) && mode_is_num(a->mode));
 
-  if (get_mode_vector_elems(a->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -1119,7 +1067,7 @@ tarval *tarval_quo(tarval *a, tarval *b)
   assert(b);
   assert((a->mode == b->mode) && mode_is_float(a->mode));
 
-  if (get_mode_vector_elems(a->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -1139,7 +1087,7 @@ tarval *tarval_div(tarval *a, tarval *b)
   assert(b);
   assert((a->mode == b->mode) && mode_is_int(a->mode));
 
-  if (get_mode_vector_elems(a->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -1162,7 +1110,7 @@ tarval *tarval_mod(tarval *a, tarval *b)
   assert(b);
   assert((a->mode == b->mode) && mode_is_int(a->mode));
 
-  if (get_mode_vector_elems(a->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -1185,7 +1133,7 @@ tarval *tarval_abs(tarval *a)
   assert(a);
   assert(mode_is_num(a->mode));
 
-  if (get_mode_vector_elems(a->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -1307,7 +1255,7 @@ tarval *tarval_shl(tarval *a, tarval *b)
   assert(b);
   assert(mode_is_int(a->mode) && mode_is_int(b->mode));
 
-  if (get_mode_vector_elems(a->mode) > 1 || get_mode_vector_elems(a->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1 || get_mode_n_vector_elems(a->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -1337,7 +1285,7 @@ tarval *tarval_shr(tarval *a, tarval *b)
   assert(b);
   assert(mode_is_int(a->mode) && mode_is_int(b->mode));
 
-  if (get_mode_vector_elems(a->mode) > 1 || get_mode_vector_elems(a->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1 || get_mode_n_vector_elems(a->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -1367,7 +1315,7 @@ tarval *tarval_shrs(tarval *a, tarval *b)
   assert(b);
   assert(mode_is_int(a->mode) && mode_is_int(b->mode));
 
-  if (get_mode_vector_elems(a->mode) > 1 || get_mode_vector_elems(a->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1 || get_mode_n_vector_elems(a->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -1397,7 +1345,7 @@ tarval *tarval_rot(tarval *a, tarval *b)
   assert(b);
   assert(mode_is_int(a->mode) && mode_is_int(b->mode));
 
-  if (get_mode_vector_elems(a->mode) > 1 || get_mode_vector_elems(a->mode) > 1) {
+  if (get_mode_n_vector_elems(a->mode) > 1 || get_mode_n_vector_elems(a->mode) > 1) {
     /* vector arithmetic not implemented yet */
     return tarval_bad;
   }
@@ -1476,18 +1424,7 @@ int tarval_snprintf(char *buf, size_t len, tarval *tv)
 
     case irms_reference:
       if (tv == tarval_P_void) return snprintf(buf, len, "NULL");
-      if (tv->value != NULL)
-       if (tarval_is_entity(tv)) {
-         if (get_entity_peculiarity((entity *)tv->value) != peculiarity_description)
-           return snprintf(buf, len, "%s%s%s", prefix, get_entity_ld_name((entity *)tv->value), suffix);
-         else {
-           if (mode_info->mode_output == TVO_NATIVE)
-             return snprintf(buf, len, "NULL");
-           else
-             return snprintf(buf, len, "0");
-         }
-       }
-       else {
+      if (tv->value != NULL){
          if (len > tv->length) {
            memcpy(buf, tv->value, tv->length);
            buf[tv->length] = '\0';
@@ -1498,7 +1435,7 @@ int tarval_snprintf(char *buf, size_t len, tarval *tv)
            buf[len-1] = '\0';
          }
          return tv->length;
-       }
+         }
       else
        return snprintf(buf, len, "void");
 
@@ -1540,7 +1477,7 @@ int tarval_printf(tarval *tv) {
 }
 
 
-char *tarval_bitpattern(tarval *tv)
+char *get_tarval_bitpattern(tarval *tv)
 {
   return NULL;
 }
@@ -1548,7 +1485,7 @@ char *tarval_bitpattern(tarval *tv)
 /*
  * access to the bitpattern
  */
-unsigned char tarval_sub_bits(tarval *tv, unsigned byte_ofs)
+unsigned char get_tarval_sub_bits(tarval *tv, unsigned byte_ofs)
 {
   switch (get_mode_sort(tv->mode)) {
     case irms_int_number:
@@ -1570,7 +1507,7 @@ unsigned char tarval_sub_bits(tarval *tv, unsigned byte_ofs)
  *
  * Returns zero on success.
  */
-int tarval_set_mode_output_option(ir_mode *mode, const tarval_mode_info *modeinfo)
+int  set_tarval_mode_output_option(ir_mode *mode, const tarval_mode_info *modeinfo)
 {
   assert(mode);
 
@@ -1583,7 +1520,7 @@ int tarval_set_mode_output_option(ir_mode *mode, const tarval_mode_info *modeinf
  *
  * This functions returns the modinfo of a given mode.
  */
-const tarval_mode_info *tarval_get_mode_output_option(ir_mode *mode)
+const tarval_mode_info *get_tarval_mode_output_option(ir_mode *mode)
 {
   assert(mode);
 
@@ -1599,7 +1536,7 @@ const tarval_mode_info *tarval_get_mode_output_option(ir_mode *mode)
  *   - TV_CLASSIFY_ALL_ONE for bitwise-and neutral
  *   - TV_CLASSIFY_OTHER   else
  */
-tarval_classification_t tarval_classify(tarval *tv)
+tarval_classification_t classify_tarval(tarval *tv)
 {
   ANNOUNCE();
   if (!tv || tv == tarval_bad) return TV_CLASSIFY_OTHER;
@@ -1667,17 +1604,17 @@ void init_tarval_2(void)
    * assign output modes that are compatible with the
    * old implementation: Hex output
    */
-  tarval_set_mode_output_option(mode_U,  &hex_output);
-  tarval_set_mode_output_option(mode_C,  &hex_output);
-  tarval_set_mode_output_option(mode_Bs, &hex_output);
-  tarval_set_mode_output_option(mode_Bu, &hex_output);
-  tarval_set_mode_output_option(mode_Hs, &hex_output);
-  tarval_set_mode_output_option(mode_Hu, &hex_output);
-  tarval_set_mode_output_option(mode_Is, &hex_output);
-  tarval_set_mode_output_option(mode_Iu, &hex_output);
-  tarval_set_mode_output_option(mode_Ls, &hex_output);
-  tarval_set_mode_output_option(mode_Lu, &hex_output);
-  tarval_set_mode_output_option(mode_P,  &reference_output);
+  set_tarval_mode_output_option(mode_U,  &hex_output);
+  set_tarval_mode_output_option(mode_C,  &hex_output);
+  set_tarval_mode_output_option(mode_Bs, &hex_output);
+  set_tarval_mode_output_option(mode_Bu, &hex_output);
+  set_tarval_mode_output_option(mode_Hs, &hex_output);
+  set_tarval_mode_output_option(mode_Hu, &hex_output);
+  set_tarval_mode_output_option(mode_Is, &hex_output);
+  set_tarval_mode_output_option(mode_Iu, &hex_output);
+  set_tarval_mode_output_option(mode_Ls, &hex_output);
+  set_tarval_mode_output_option(mode_Lu, &hex_output);
+  set_tarval_mode_output_option(mode_P,  &reference_output);
 }
 
 /* free all memory occupied by tarval. */
index f4535db..0097a35 100644 (file)
@@ -21,7 +21,7 @@
 #define _TV_H_
 
 # include "irmode.h"
-# include "entity.h"
+  //# include "entity.h"
 # include "irnode.h"    /* for pnc_number enum */
 
 
@@ -161,8 +161,7 @@ tarval *new_tarval_from_long(long l, ir_mode *mode);
  * you are doing! (better check with tarval_is_long()...)
  * Works only for int modes, even not for character modes!
  */
-long tarval_to_long(tarval *tv);
-#define get_tarval_long tarval_to_long
+long get_tarval_long(tarval *tv);
 
 /**
  * This validates if tarval_to_long() will return a satisfying
@@ -207,7 +206,7 @@ tarval *new_tarval_from_double(long double d, ir_mode *mode);
  * This will overflow silently, so use only if you know what
  * you are doing! (better check with tarval_is_long...)
  */
-long double tarval_to_double(tarval *tv);
+long double get_tarval_double(tarval *tv);
 
 /**
  * This validates if tarval_to_double() will return a satisfying
@@ -221,19 +220,19 @@ int tarval_is_double(tarval *tv);
  *
  * The address must be constant, the entity must have as owner the global type.
  * We no more support this function: Use the new SymConst instead.
- */
 tarval *new_tarval_from_entity (entity *ent, ir_mode *mode);
+ */
 
 /**
  * Returns the associated entity of a tarval.  Asserts if tarval does not
  * contain an entity.
- */
 entity *get_tarval_entity(tarval *tv);
+ */
 
 /**
  * Returns non-zero if a the given tarval represents an entity.
- */
 int tarval_is_entity(tarval *tv);
+ */
 
 /** ********** Access routines for tarval fields ********** **/
 
@@ -497,7 +496,7 @@ typedef struct tarval_mode_info {
  *
  * @return zero on success.
  */
-int tarval_set_mode_output_option(ir_mode *mode, const tarval_mode_info *modeinfo);
+int  set_tarval_mode_output_option(ir_mode *mode, const tarval_mode_info *modeinfo);
 
 /**
  * Returns the output options of one mode.
@@ -508,7 +507,7 @@ int tarval_set_mode_output_option(ir_mode *mode, const tarval_mode_info *modeinf
  *
  * @return the output option
  */
-const tarval_mode_info *tarval_get_mode_output_option(ir_mode *mode);
+const tarval_mode_info *get_tarval_mode_output_option(ir_mode *mode);
 
 /**
  * Returns Bit representation of a tarval value, as string of '0' and '1'
@@ -533,7 +532,7 @@ const tarval_mode_info *tarval_get_mode_output_option(ir_mode *mode);
  *    irmode.h for the definition of the ir_mode struct
  *    the size member of aforementioned struct
  */
-char *tarval_bitpattern(tarval *tv);
+char *get_tarval_bitpattern(tarval *tv);
 
 /**
  * Returns the bitpattern of the bytes_ofs byte.
@@ -560,7 +559,7 @@ char *tarval_bitpattern(tarval *tv);
  * @note
  *   The result of this funcion is undefined if the mode is neither integer nor float.
  */
-unsigned char tarval_sub_bits(tarval *tv, unsigned byte_ofs);
+unsigned char get_tarval_sub_bits(tarval *tv, unsigned byte_ofs);
 
 /**
  * Return values of tarval classify
@@ -581,7 +580,7 @@ typedef enum _tarval_classification_t {
  *   - TV_CLASSIFY_ALL_ONE for bitwise-and neutral
  *   - TV_CLASSIFY_OTHER   else
  */
-tarval_classification_t tarval_classify(tarval *tv);
+tarval_classification_t classify_tarval(tarval *tv);
 
 
 
index ef6aa5c..8a80132 100644 (file)
@@ -81,22 +81,22 @@ main(void)
      This is the modeling appropriate for other languages.
      Mode_i says that all integers shall be implemented as a
      32 bit integer value.  */
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Is);
 
   printf("\nCreating an IR graph: ARRAY-HEAP_EXAMPLE...\n");
 
   /* first build procedure main */
   owner = get_glob_type();
-  proc_main = new_type_method(id_from_str("ARRAY-HEAP_EXAMPLE_main", 23), 0, 1);
+  proc_main = new_type_method(new_id_from_chars("ARRAY-HEAP_EXAMPLE_main", 23), 0, 1);
   set_method_res_type(proc_main, 0, (type *)prim_t_int);
-  proc_main_e = new_entity ((type*)owner, id_from_str ("ARRAY-HEAP_EXAMPLE_main", 23), (type *)proc_main);
+  proc_main_e = new_entity ((type*)owner, new_id_from_chars("ARRAY-HEAP_EXAMPLE_main", 23), (type *)proc_main);
 
   /* make type information for the array and set the bounds */
 # define N_DIMS 1
 # define L_BOUND 0
 # define U_BOUND 9
   current_ir_graph = get_const_code_irg();
-  array_type = new_type_array(id_from_str("a", 1), N_DIMS, prim_t_int);
+  array_type = new_type_array(new_id_from_chars("a", 1), N_DIMS, prim_t_int);
   set_array_bounds(array_type, 0,
                   new_Const(mode_Iu, new_tarval_from_long (L_BOUND, mode_Iu)),
                   new_Const(mode_Iu, new_tarval_from_long (U_BOUND, mode_Iu)));
@@ -144,11 +144,11 @@ main(void)
 
      x = new_Return (get_store (), 1, in);
   }
-  mature_block (get_irg_current_block(main_irg));
+  mature_immBlock (get_irg_current_block(main_irg));
 
   /* complete the end_block */
-  add_in_edge (get_irg_end_block(main_irg), x);
-  mature_block (get_irg_end_block(main_irg));
+  add_immBlock_pred (get_irg_end_block(main_irg), x);
+  mature_immBlock (get_irg_end_block(main_irg));
 
   finalize_cons (main_irg);
 
@@ -159,9 +159,10 @@ main(void)
   irg_vrfy(main_irg);
 
   printf("Dumping the graph and a type graph.\n");
-  dump_ir_block_graph (main_irg);
-  dump_type_graph(main_irg);
-  dump_all_types();
+  char *dump_file_suffix = "";
+  dump_ir_block_graph (main_irg, dump_file_suffix);
+  dump_type_graph(main_irg, dump_file_suffix);
+  dump_all_types(dump_file_suffix);
   printf("use xvcg to view these graphs:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index 9c57e91..65a2eef 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
  * Project:     libFIRM
  * File name:   testprograms/array-stack_example.c
@@ -73,20 +74,20 @@ main(void)
      This is the modeling appropriate for other languages.
      Mode_i says that all language-integers shall be implemented
      as a 32 bit processor-integer value.  */
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Is);
 
   /* build typeinformation of procedure main */
-  owner = new_type_class (id_from_str ("ARRAY-STACK_EXAMPLE", 19));
-  proc_main = new_type_method(id_from_str("main_tp", 7), 0, 1);
+  owner = new_type_class (new_id_from_chars ("ARRAY-STACK_EXAMPLE", 19));
+  proc_main = new_type_method(new_id_from_chars("main_tp", 7), 0, 1);
   set_method_res_type(proc_main, 0, prim_t_int);
-  proc_main_e = new_entity (owner, id_from_str ("main", 4), proc_main);
+  proc_main_e = new_entity (owner, new_id_from_chars ("main", 4), proc_main);
   get_entity_ld_name(proc_main_e); /* force name mangling */
 
   /* make type information for the array and set the bounds */
 # define N_DIMS 1
 # define L_BOUND 0
 # define U_BOUND 9
-  array_type = new_type_array(id_from_str("a_tp", 4), N_DIMS, prim_t_int);
+  array_type = new_type_array(new_id_from_chars("a_tp", 4), N_DIMS, prim_t_int);
   current_ir_graph = get_const_code_irg();
   set_array_bounds(array_type, 0,
                   new_Const(mode_Iu, new_tarval_from_long (L_BOUND, mode_Iu)),
@@ -96,7 +97,7 @@ main(void)
 
   /* The array is an entity of the method, placed on the mehtod's own memory,
      the stack frame. */
-  array_ent = new_entity(get_cur_frame_type(), id_from_str("a", 1), array_type);
+  array_ent = new_entity(get_cur_frame_type(), new_id_from_chars("a", 1), array_type);
   /* As the array is accessed by Sel nodes, we need information about
      the entity the node selects.  Entities of an array are it's elements
      which are, in this case, integers. */
@@ -130,11 +131,11 @@ main(void)
 
      x = new_Return (get_store (), 1, in);
   }
-  mature_block (get_irg_current_block(main_irg));
+  mature_immBlock (get_irg_current_block(main_irg));
 
   /* complete the end_block */
-  add_in_edge (get_irg_end_block(main_irg), x);
-  mature_block (get_irg_end_block(main_irg));
+  add_immBlock_pred (get_irg_end_block(main_irg), x);
+  mature_immBlock (get_irg_end_block(main_irg));
 
   finalize_cons (main_irg);
 
@@ -143,12 +144,12 @@ main(void)
 
   /* verify the graph */
   irg_vrfy(main_irg);
-
+  char *dump_file_suffix = "";
   printf("Dumping the graph and a type graph.\n");
-  dump_ir_block_graph (main_irg);
-  dump_type_graph(main_irg);
-  dump_ir_block_graph_w_types(main_irg);
-  dump_all_types();
+  dump_ir_block_graph (main_irg, dump_file_suffix);
+  dump_type_graph(main_irg, dump_file_suffix);
+  dump_ir_block_graph_w_types(main_irg, dump_file_suffix);
+  dump_all_types(dump_file_suffix);
   printf("Use xvcg to view these graphs:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index f72c96b..26d143d 100644 (file)
@@ -48,10 +48,10 @@ int main(int argc, char **argv)
   init_firm (NULL);
 
   /* An unsinged 8 bit type */
-  U8 = new_type_primitive (id_from_str("char", 4), mode_Bu);
+  U8 = new_type_primitive (new_id_from_chars("char", 4), mode_Bu);
   /* An array containing unsigned 8 bit elements. */
-  U8array = new_type_array (id_from_str ("char_arr", 8), 1, U8);
-  string_ptr = new_type_pointer (id_from_str ("ptr_to_string", 13), U8array);
+  U8array = new_type_array (new_id_from_chars("char_arr", 8), 1, U8);
+  string_ptr = new_type_pointer (new_id_from_chars ("ptr_to_string", 13), U8array);
 
   /* Make a global entity that represents the constant String. */
   const_str = new_entity(get_glob_type(), new_id_from_str("constStr"), U8array);
@@ -72,7 +72,7 @@ int main(int argc, char **argv)
 #define NRARGS 0
 #define NRES 0
   owner = get_glob_type();
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                               NRARGS, NRES);
 
   /* Make type information for called method which also belongs to the
@@ -81,14 +81,14 @@ int main(int argc, char **argv)
 #define F_NRARGS 1
 #define F_NRES 0
   owner = get_glob_type();
-  proc_called = new_type_method(id_from_str(F_METHODNAME, strlen(F_METHODNAME)),
+  proc_called = new_type_method(new_id_from_chars(F_METHODNAME, strlen(F_METHODNAME)),
                               F_NRARGS, F_NRES);
   set_method_param_type(proc_called, 0, string_ptr);
 
 
   /* Make the entity for main needed for a correct  ir_graph.  */
 #define ENTITYNAME "CALL_STR_EXAMPLE_main"
-  ent = new_entity (owner, id_from_str (ENTITYNAME, strlen(ENTITYNAME)),
+  ent = new_entity (owner, new_id_from_chars (ENTITYNAME, strlen(ENTITYNAME)),
                     proc_main);
 
   /* Generates the basic graph for the method represented by entity ent, that
@@ -99,11 +99,12 @@ int main(int argc, char **argv)
   irg = new_ir_graph (ent, NUM_OF_LOCAL_VARS);
 
   /* get the pointer to the string constant */
-  str_addr = new_Const(mode_P, new_tarval_from_entity(const_str, mode_P));
+  symconst_symbol sym;
+  sym.entity_p = const_str;
+  str_addr = new_SymConst(sym, symconst_addr_ent);
 
   /* get the pointer to the procedure from the class type */
   /* this is how a pointer to be fixed by the linker is represented. */
-  symconst_symbol sym;
   sym.ident_p = new_id_from_str (F_METHODNAME);
   proc_ptr = new_SymConst (sym, symconst_addr_name);
 
@@ -120,13 +121,13 @@ int main(int argc, char **argv)
   x = new_Return (get_store(), 0, NULL);
   /* Now we generated all instructions for this block and all its predecessor blocks
    * so we can mature it. */
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* This adds the in edge of the end block which originates at the return statement.
    * The return node passes controlflow to the end block.  */
-  add_in_edge (get_irg_end_block(irg), x);
+  add_immBlock_pred (get_irg_end_block(irg), x);
   /* Now we can mature the end block as all it's predecessors are known. */
-  mature_block (get_irg_end_block(irg));
+  mature_immBlock (get_irg_end_block(irg));
 
   finalize_cons (irg);
 
@@ -137,8 +138,9 @@ int main(int argc, char **argv)
   irg_vrfy(irg);
 
   printf("Done building the graph.  Dumping it.\n");
-  dump_ir_block_graph (irg);
-  dump_all_types();
+  char *dump_file_suffix = "";
+  dump_ir_block_graph (irg, dump_file_suffix);
+  dump_all_types(dump_file_suffix);
   printf("Use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index 21e3a83..b03027b 100644 (file)
@@ -43,7 +43,7 @@ int main(int argc, char **argv)
   init_firm (NULL);
 
   /*** Make basic type information for primitive type int. ***/
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Is);
 
   /* FIRM was designed for oo languages where all methods belong to a class.
    * For imperative languages like C we view a file as a large class containing
@@ -54,11 +54,11 @@ int main(int argc, char **argv)
 #define CLASSNAME "COND_EXAMPLE"
 #define ENTITYNAME "main"
 
-  owner = new_type_class (id_from_str (CLASSNAME, strlen(CLASSNAME)));
-  method = new_type_method (id_from_str("main", 4), 1, 1);
+  owner = new_type_class (new_id_from_chars (CLASSNAME, strlen(CLASSNAME)));
+  method = new_type_method (new_id_from_chars("main", 4), 1, 1);
   set_method_param_type(method, 0, prim_t_int);
   set_method_res_type(method, 0, prim_t_int);
-  ent = new_entity (owner, id_from_str (ENTITYNAME, strlen(ENTITYNAME)), method);
+  ent = new_entity (owner, new_id_from_chars (ENTITYNAME, strlen(ENTITYNAME)), method);
   get_entity_ld_name(ent);
 
 
@@ -98,19 +98,19 @@ int main(int argc, char **argv)
   f = new_Proj (x, mode_X, 0); /* if condition is false */
   t = new_Proj (x, mode_X, 1); /* if condition is true */
 
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* generate and fill the then block */
   b = new_immBlock ();
-  add_in_edge (b, t);
+  add_immBlock_pred (b, t);
   set_value (0, new_Const (mode_Is, new_tarval_from_long (1, mode_Is)));
-  mature_block (b);
+  mature_immBlock (b);
   x_then = new_Jmp ();
 
   /* generate the fall through block and add all cfg edges */
   b = new_immBlock ();
-  add_in_edge (b, x_then);
-  add_in_edge (b, f);
+  add_immBlock_pred (b, x_then);
+  add_immBlock_pred (b, f);
 
 
   /* Generate the return node into current region. */
@@ -121,13 +121,13 @@ int main(int argc, char **argv)
   }
   /* Now generate all instructions for this block and all its predecessor blocks
    * so we can mature it. */
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* This adds the in edge of the end block which originates at the
      return statement. The return node passes controlflow to the end block.*/
-  add_in_edge (get_irg_end_block(irg), x);
+  add_immBlock_pred (get_irg_end_block(irg), x);
   /* Now we can mature the end block as all it's predecessors are known. */
-  mature_block (get_irg_end_block(irg));
+  mature_immBlock (get_irg_end_block(irg));
 
   finalize_cons (irg);
 
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
   irg_vrfy(irg);
 
   printf("Done building the graph.  Dumping it.\n");
-  dump_ir_block_graph (irg);
+  dump_ir_block_graph (irg, 0);
   printf("Use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index 6e003fc..4c59d89 100644 (file)
@@ -56,17 +56,17 @@ int main(int argc, char **argv)
   init_firm (NULL);
 
   /** make idents for all used identifiers in the program. */
-  Ci  = id_from_str("C",  strlen("C"));
-  ai  = id_from_str("a",  strlen("a"));
-  fi  = id_from_str("f",  strlen("f"));
-  fti  = id_from_str("f_type",  strlen("f_type"));
-  gi  = id_from_str("g",  strlen("g"));
-  gti  = id_from_str("g_type",  strlen("g_type"));
-  inti = id_from_str("int", strlen("int"));
-  dipti = id_from_str("C_dispatch_table_type", strlen("C_dispatch_table_type"));
-  diptei = id_from_str("C_dispatch_table", strlen("C_dispatch_table"));
-  diptpi = id_from_str("C_dispatch_table_p_type", strlen("C_dispatch_table_p_type"));
-  diptpei = id_from_str("C_dispatch_table_p", strlen("C_dispatch_table_p"));
+  Ci  = new_id_from_chars("C",  strlen("C"));
+  ai  = new_id_from_chars("a",  strlen("a"));
+  fi  = new_id_from_chars("f",  strlen("f"));
+  fti  = new_id_from_chars("f_type",  strlen("f_type"));
+  gi  = new_id_from_chars("g",  strlen("g"));
+  gti  = new_id_from_chars("g_type",  strlen("g_type"));
+  inti = new_id_from_chars("int", strlen("int"));
+  dipti = new_id_from_chars("C_dispatch_table_type", strlen("C_dispatch_table_type"));
+  diptei = new_id_from_chars("C_dispatch_table", strlen("C_dispatch_table"));
+  diptpi = new_id_from_chars("C_dispatch_table_p_type", strlen("C_dispatch_table_p_type"));
+  diptpei = new_id_from_chars("C_dispatch_table_p", strlen("C_dispatch_table_p"));
 
 
   /** make the type information needed */
@@ -94,7 +94,9 @@ int main(int argc, char **argv)
   current_ir_graph = get_const_code_irg();
   /* The pointer to the dispatch table is constant. */
   /* The constant is the address of the given entity */
-  n = new_Const(mode_P, new_tarval_from_entity(dipte, mode_P));
+  symconst_symbol sym;
+  sym.entity_p = dipte;
+  n = new_SymConst(sym, symconst_addr_ent);
   set_entity_variability(diptpe, variability_constant);
   set_atomic_ent_value(diptpe, n);
 
@@ -109,8 +111,8 @@ int main(int argc, char **argv)
   type *arrt;
   entity *arre, *arrelte;
 
-  arrei =  id_from_str("arr", strlen("arr"));
-  arrti =  id_from_str("arr_t",  strlen("arr_t"));
+  arrei =  new_id_from_chars("arr", strlen("arr"));
+  arrti =  new_id_from_chars("arr_t",  strlen("arr_t"));
 
   /** The array type **/
   /* Don't reuse int type so that graph layout is better readable */
@@ -133,7 +135,7 @@ int main(int argc, char **argv)
   add_compound_ent_value(arre, n, arrelte);
 }
   printf("Done building the graph.  Dumping it.\n");
-  dump_all_types();
+  dump_all_types(0);
 
   printf("use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
index dc0bce0..aadd12a 100644 (file)
@@ -45,18 +45,18 @@ main(void)
   init_firm (NULL);
 
   /*** Make basic type information for primitive type int. ***/
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Is);
 
   /* Try both optimizations: */
   set_opt_constant_folding(1);
   set_opt_cse(1);
   set_opt_dead_node_elimination (1);
 
-  owner = new_type_class (id_from_str ("CONST_EVAL_EXAMPLE", 18));
-  method = new_type_method (id_from_str("main", 4), 0, 2);
+  owner = new_type_class (new_id_from_chars ("CONST_EVAL_EXAMPLE", 18));
+  method = new_type_method (new_id_from_chars("main", 4), 0, 2);
   set_method_res_type(method, 0, prim_t_int);
   set_method_res_type(method, 1, prim_t_int);
-  ent = new_entity (owner, id_from_str ("main", 4), method);
+  ent = new_entity (owner, new_id_from_chars ("main", 4), method);
   get_entity_ld_name(ent);
 
   irg = new_ir_graph (ent, 4);
@@ -65,7 +65,7 @@ main(void)
   b = new_Const (mode_Is, new_tarval_from_long (5, mode_Is));
 
   x = new_Jmp ();
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /*  To test const eval on DivMod
   c = new_DivMod(get_store(), a, b);
@@ -89,8 +89,8 @@ main(void)
      x = new_Return (get_store (), 2, in);
   }
 
-  add_in_edge (get_irg_end_block(irg), x);
-  mature_block (get_irg_end_block(irg));
+  add_immBlock_pred (get_irg_end_block(irg), x);
+  mature_immBlock (get_irg_end_block(irg));
 
   finalize_cons (irg);
 
@@ -101,7 +101,7 @@ main(void)
   irg_vrfy(irg);
 
   printf("Done building the graph.  Dumping it.\n");
-  dump_ir_block_graph (irg);
+  dump_ir_block_graph (irg, 0);
 
   printf("use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
index 83f43bb..071dbd1 100644 (file)
@@ -62,7 +62,7 @@ int main(int argc, char **argv)
   init_firm (NULL);
 
   /*** Make basic type information for primitive type int. ***/
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Is);
 
   /* FIRM was designed for oo languages where all methods belong to a class.
    * For imperative languages like C we view a file as a large class containing
@@ -76,12 +76,12 @@ int main(int argc, char **argv)
 #define NRES 1
   printf("\nCreating an IR graph: %s...\n", CLASSNAME);
 
-  owner = new_type_class (id_from_str (CLASSNAME, strlen(CLASSNAME)));
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  owner = new_type_class (new_id_from_chars (CLASSNAME, strlen(CLASSNAME)));
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                               NRARGS, NRES);
   set_method_res_type(proc_main, 0, prim_t_int);
   ent = new_entity (owner,
-                    id_from_str (METHODNAME, strlen(METHODNAME)),
+                    new_id_from_chars (METHODNAME, strlen(METHODNAME)),
                     proc_main);
   get_entity_ld_name(ent); /* To enforce name mangling for vcg graph name */
 #define NUM_OF_LOCAL_VARS 1
@@ -96,43 +96,43 @@ int main(int argc, char **argv)
   cond = new_Cond(new_Proj(new_Cmp(c1, c2), mode_b, Eq));
   f = new_Proj(cond, mode_X, 0);
   t = new_Proj(cond, mode_X, 1);
-  mature_block(get_irg_current_block(irg));
+  mature_immBlock(get_irg_current_block(irg));
 
   /* end block to add jmps */
   endBlock = new_immBlock();
 
   /* Block 1 */
   Block1 = new_immBlock();
-  add_in_edge(Block1, t);
-  mature_block(Block1);
+  add_immBlock_pred(Block1, t);
+  mature_immBlock(Block1);
   jmp = new_Jmp();
-  add_in_edge(endBlock, jmp);
+  add_immBlock_pred(endBlock, jmp);
 
   /* Block 2 */
   Block2 = new_immBlock();
-  add_in_edge(Block2, f);
-  mature_block(Block2);
+  add_immBlock_pred(Block2, f);
+  mature_immBlock(Block2);
   jmp = new_Jmp();
-  add_in_edge(endBlock, jmp);
+  add_immBlock_pred(endBlock, jmp);
 
   /* dead Block */
   deadBlock = new_immBlock();
-  mature_block(deadBlock);
+  mature_immBlock(deadBlock);
   jmp = new_Jmp();
-  add_in_edge(endBlock, jmp);
+  add_immBlock_pred(endBlock, jmp);
 
   /* finish end block */
-  switch_block(endBlock);
+  set_cur_block(endBlock);
   {
     ir_node *in[1];
     in[0] = get_value(0, mode_Is);
     get_store();
     x = new_Return (get_store(), 1, in);
   }
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
-  add_in_edge (get_irg_end_block(irg), x);
-  mature_block (get_irg_end_block(irg));
+  add_immBlock_pred (get_irg_end_block(irg), x);
+  mature_immBlock (get_irg_end_block(irg));
 
   finalize_cons (irg);
 
@@ -144,8 +144,9 @@ int main(int argc, char **argv)
   irg_vrfy(irg);
 
   printf("Dumping the graph and a control flow graph.\n");
-  dump_ir_block_graph (irg);
-  dump_cfg (irg);
+  char *dump_file_suffix = "";
+  dump_ir_block_graph (irg, dump_file_suffix);
+  dump_cfg (irg, dump_file_suffix);
   printf("Use xvcg to view these graphs:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index 3cf8def..156abd5 100644 (file)
@@ -56,12 +56,12 @@ int main(int argc, char **argv)
 #define NRARGS 0
 #define NRES 0
   /* The type of the method */
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                               NRARGS, NRES);
   /* An entity representing the method.  Owner of the entity is the global class
      type mentioned above. */
   ent = new_entity ((type *)owner,
-                    id_from_str (METHODNAME, strlen(METHODNAME)),
+                    new_id_from_chars (METHODNAME, strlen(METHODNAME)),
                     (type *)proc_main);
 
   /** Build code for the procedure. **/
@@ -82,20 +82,20 @@ int main(int argc, char **argv)
     x = new_Return (get_store(), 0, NULL);
   /* Now we generated all instructions for this block and all its predecessor
    * blocks so we can mature it.  (There are not too much.) */
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* This adds the in edge of the end block which originates at the return statement.
    * The return node passes controlflow to the end block.  */
-  add_in_edge (get_irg_end_block(irg), x);
+  add_immBlock_pred (get_irg_end_block(irg), x);
   /* Now we can mature the end block as all it's predecessors are known. */
-  mature_block (get_irg_end_block(irg));
+  mature_immBlock (get_irg_end_block(irg));
 
   /* Verify the graph.  Finds some very bad errors in the graph. */
   irg_vrfy(irg);
   finalize_cons (irg);
 
   printf("Done building the graph.  Dumping it.\n");
-  dump_ir_block_graph (irg);
+  dump_ir_block_graph (irg, 0);
 
   printf("use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
index 765c2d3..fa17092 100644 (file)
@@ -59,20 +59,20 @@ main(void)
   set_opt_global_cse(0);
   set_opt_dead_node_elimination (1);
 
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Is);
 
 #define METHODNAME "main_tp"
 #define NRARGS 1
 #define NRES 1
 
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                               NRARGS, NRES);
   set_method_param_type(proc_main, 0, prim_t_int);
   set_method_res_type(proc_main, 0, prim_t_int);
 
 
-  owner = new_type_class (id_from_str ("ENDLESS_LOOP_EXAMPLE", 20));
-  ent = new_entity (owner, id_from_str ("main", strlen("main")), proc_main);
+  owner = new_type_class (new_id_from_chars ("ENDLESS_LOOP_EXAMPLE", 20));
+  ent = new_entity (owner, new_id_from_chars ("main", strlen("main")), proc_main);
   get_entity_ld_name(ent); /* force name mangling */
 
   /* Generates start and end blocks and nodes and a first, initial block */
@@ -83,11 +83,11 @@ main(void)
   set_value (1, new_Const (mode_Is, new_tarval_from_long (1, mode_Is)));
 
   x = new_Jmp();
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* generate a block for the loop header and the conditional branch */
   r = new_immBlock ();
-  add_in_edge (r, x);
+  add_immBlock_pred (r, x);
   x = new_Cond (new_Proj(new_Cmp(new_Const (mode_Is, new_tarval_from_long (0, mode_Is)),
                  new_Const (mode_Is, new_tarval_from_long (0, mode_Is))),
              mode_b, Eq));
@@ -96,9 +96,9 @@ main(void)
 
   /* generate the block for the loop body */
   b = new_immBlock ();
-  add_in_edge (b, t);
+  add_immBlock_pred (b, t);
   x = new_Jmp ();
-  add_in_edge (r, x);
+  add_immBlock_pred (r, x);
 
   /* The code in the loop body,
      as we are dealing with local variables only the dataflow edges
@@ -112,17 +112,17 @@ main(void)
                                   new_simpleSel(
                                     get_store(),
                                     get_irg_globals(irg),
-                                    new_entity(get_glob_type(),id_from_str("VAR_A",6),prim_t_int)),
+                                    new_entity(get_glob_type(),new_id_from_chars("VAR_A",6),prim_t_int)),
                                   get_value(1, mode_Is)),
                        mode_M, 0));
 
-  mature_block (b);
-  mature_block (r);
+  mature_immBlock (b);
+  mature_immBlock (r);
 
   /* generate the return block */
   r = new_immBlock ();
-  add_in_edge (r, f);
-  mature_block (r);
+  add_immBlock_pred (r, f);
+  mature_immBlock (r);
 
   {
      ir_node *in[1];
@@ -132,8 +132,8 @@ main(void)
   }
 
   /* finalize the end block generated in new_ir_graph() */
-  add_in_edge (get_irg_end_block(irg), x);
-  mature_block (get_irg_end_block(irg));
+  add_immBlock_pred (get_irg_end_block(irg), x);
+  mature_immBlock (get_irg_end_block(irg));
 
   finalize_cons (irg);
 
@@ -149,8 +149,9 @@ main(void)
   printf("Done building the graph.  Dumping it.\n");
   /* turn_of_edge_labels(); */
   dump_keepalive_edges(true);
-  dump_all_types();
-  dump_ir_block_graph (irg);
+  char *dump_file_suffix = "";
+  dump_all_types(dump_file_suffix);
+  dump_ir_block_graph (irg, dump_file_suffix);
   printf("Use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index 395161b..5375e57 100644 (file)
@@ -57,15 +57,15 @@ int main(int argc, char **argv)
 #define NRARGS 0
 #define NRES 1
   /* The type of the method */
-  prim_t_dbl = new_type_primitive(id_from_str ("dbl", 3), mode_D);
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  prim_t_dbl = new_type_primitive(new_id_from_chars ("dbl", 3), mode_D);
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                               NRARGS, NRES);
   set_method_res_type(proc_main, 0, prim_t_dbl);
 
   /* An entity representing the method.  Owner of the entity is the global class
      type mentioned above. */
   ent = new_entity ((type *)owner,
-                    id_from_str (METHODNAME, strlen(METHODNAME)),
+                    new_id_from_chars (METHODNAME, strlen(METHODNAME)),
                     (type *)proc_main);
 
   /** Build code for the procedure. **/
@@ -90,20 +90,20 @@ int main(int argc, char **argv)
   }
   /* Now we generated all instructions for this block and all its predecessor
    * blocks so we can mature it.  (There are not too much.) */
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* This adds the in edge of the end block which originates at the return statement.
    * The return node passes controlflow to the end block.  */
-  add_in_edge (get_irg_end_block(irg), x);
+  add_immBlock_pred (get_irg_end_block(irg), x);
   /* Now we can mature the end block as all it's predecessors are known. */
-  mature_block (get_irg_end_block(irg));
+  mature_immBlock (get_irg_end_block(irg));
 
   /* Verify the graph.  Finds some very bad errors in the graph. */
   irg_vrfy(irg);
   finalize_cons (irg);
 
   printf("Done building the graph.  Dumping it.\n");
-  dump_ir_block_graph (irg);
+  dump_ir_block_graph (irg, 0);
 
   printf("use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
index 3e701d9..1c1c11e 100644 (file)
@@ -62,16 +62,16 @@ main(void)
 
   owner = get_glob_type();
   /* Type information for the procedure */
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                              NRARGS, NRES);
   /* The entity for the procedure */
   ent = new_entity (owner,
-                    id_from_str (METHODNAME, strlen(METHODNAME)),
+                    new_id_from_chars (METHODNAME, strlen(METHODNAME)),
                     proc_main);
   /* The type int.  This type is necessary to model the result and parameters
      the procedure. */
 #define PRIM_NAME "int"
-  typ = new_type_primitive(id_from_str(PRIM_NAME, strlen(PRIM_NAME)), mode_Is);
+  typ = new_type_primitive(new_id_from_chars(PRIM_NAME, strlen(PRIM_NAME)), mode_Is);
   /* The parameter and result types of the procedure. */
   set_method_param_type(proc_main, 0, typ);
   set_method_res_type(proc_main, 0, typ);
@@ -94,7 +94,7 @@ main(void)
   set_value (b_pos, new_Const (mode_Is, new_tarval_from_long (2, mode_Is)));
   /* We know all predecessors of the block and all set_values and set_stores are
      preformed.   We can mature the block.  */
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* Generate a conditional branch */
   cmp = new_Cmp(get_value(a_pos, mode_Is), get_value(b_pos, mode_Is)); /*
@@ -106,32 +106,32 @@ main(void)
 
   /* generate and fill the then block */
   r = new_immBlock ();
-  add_in_edge (r, t);
+  add_immBlock_pred (r, t);
   a = new_Sub(get_value(a_pos, mode_Is),
               new_Const (mode_Is, new_tarval_from_long (3, mode_Is)),
              mode_Is);
   set_value (a_pos, a);
 
-  mature_block (r);
+  mature_immBlock (r);
   t = new_Jmp ();
 
   /* generate the else block */
   r = new_immBlock ();
-  add_in_edge (r, f);
+  add_immBlock_pred (r, f);
   a = new_Sub(get_value(a_pos, mode_Is),
               new_Const (mode_Is, new_tarval_from_long (3, mode_Is)),
              mode_Is);
   a = new_Add(a, new_Const (mode_Is, new_tarval_from_long (5, mode_Is)), mode_Is);
   set_value (a_pos, a);
 
-  mature_block (r);
+  mature_immBlock (r);
   f = new_Jmp ();
 
   /* generate the fall through block and add all cfg edges */
   r = new_immBlock ();
-  add_in_edge (r, f);
-  add_in_edge (r, t);
-  mature_block (r);
+  add_immBlock_pred (r, f);
+  add_immBlock_pred (r, t);
+  mature_immBlock (r);
   /* The Return statement */
   {
      ir_node *in[1], *store ;
@@ -142,8 +142,8 @@ main(void)
   }
 
   /* finalize the end block generated in new_ir_graph() */
-  add_in_edge (get_irg_end_block(irg), x);
-  mature_block (get_irg_end_block(irg));
+  add_immBlock_pred (get_irg_end_block(irg), x);
+  mature_immBlock (get_irg_end_block(irg));
 
   /* verify the graph */
   irg_vrfy(irg);
@@ -155,7 +155,7 @@ main(void)
 
   /* output the vcg file */
   printf("Done building the graph.  Dumping it.\n");
-  dump_ir_block_graph (irg);
+  dump_ir_block_graph (irg, 0);
   printf("use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index 707f498..2bf7051 100644 (file)
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
      This is the modeling appropriate for other languages.
      Mode_i says that all integers shall be implemented as a
      32 bit integer value.  */
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Is);
 
   /* FIRM was designed for oo languages where all methods belong to a class.
    * For imperative languages like C we view a file or compilation unit as
@@ -66,10 +66,10 @@ int main(int argc, char **argv)
 
   /* Main is an entity of this global class. */
   owner = get_glob_type();
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                               NRARGS, NRES);
   main_ent = new_entity (owner,
-                        id_from_str (METHODNAME, strlen(METHODNAME)),
+                        new_id_from_chars (METHODNAME, strlen(METHODNAME)),
                         proc_main);
 
   /* Generates the basic graph for the method represented by entity main_ent, that
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
 
   /* Generate the entities for the global variables. */
   i_ent = new_entity (get_glob_type(),
-                     id_from_str ("i", strlen("i")),
+                     new_id_from_chars ("i", strlen("i")),
                      prim_t_int);
 
   irg = new_ir_graph (main_ent, NUM_OF_LOCAL_VARS);
@@ -100,13 +100,13 @@ int main(int argc, char **argv)
 
   /* Now generate all instructions for this block and all its predecessor blocks
    * so we can mature it. */
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* This adds the in edge of the end block which originates at the return statement.
    * The return node passes controlflow to the end block.  */
-  add_in_edge (get_irg_end_block(irg), x);
+  add_immBlock_pred (get_irg_end_block(irg), x);
   /* Now we can mature the end block as all it's predecessors are known. */
-  mature_block (get_irg_end_block(irg));
+  mature_immBlock (get_irg_end_block(irg));
 
   finalize_cons (irg);
 
@@ -117,8 +117,9 @@ int main(int argc, char **argv)
   irg_vrfy(irg);
 
   printf("Done building the graph.  Dumping it.\n");
-  dump_ir_block_graph (irg);
-  dump_ir_graph_w_types (irg);
+  char *dump_file_suffix = "";
+  dump_ir_block_graph (irg, dump_file_suffix);
+  dump_ir_graph_w_types (irg, dump_file_suffix);
   printf("Use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index 48f12e7..2660c83 100644 (file)
@@ -59,7 +59,7 @@ int main(int argc, char **argv)
   */
 
   printf("Done building the graph.  Dumping it.\n");
-  dump_all_types();
+  dump_all_types(0);
 
   printf("use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
index 686d9a3..b3ade18 100644 (file)
@@ -52,7 +52,7 @@ int main(int argc, char **argv)
   init_firm (NULL);
 
   /*** Make basic type information for primitive type int. ***/
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Is);
 
   /* FIRM was designed for oo languages where all methods belong to a class.
    * For imperative languages like C we view a file as a large class containing
@@ -63,11 +63,11 @@ int main(int argc, char **argv)
 #define ENTITYNAME "IF_ELSE_EXAMPLE_main"
 
   owner = get_glob_type();
-  method = new_type_method (id_from_str(ENTITYNAME, strlen(ENTITYNAME)), 0, 2);
+  method = new_type_method (new_id_from_chars(ENTITYNAME, strlen(ENTITYNAME)), 0, 2);
   set_method_res_type(method, 0, prim_t_int);
   set_method_res_type(method, 1, prim_t_int);
 
-  ent = new_entity (owner, id_from_str (ENTITYNAME,
+  ent = new_entity (owner, new_id_from_chars (ENTITYNAME,
                    strlen(ENTITYNAME)), method);
 
   /* Generates the basic graph for the method represented by entity ent, that
@@ -95,26 +95,26 @@ int main(int argc, char **argv)
   f = new_Proj (x, mode_X, 0); /* if condition is false */
   t = new_Proj (x, mode_X, 1); /* if condition is true */
 
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* generate and fill the then block */
   b = new_immBlock ();
-  add_in_edge (b, t);
+  add_immBlock_pred (b, t);
   set_value (0, get_value(1, mode_Is));
-  mature_block (b);
+  mature_immBlock (b);
   x_then = new_Jmp ();
 
   /* generate and fill the else block */
   b = new_immBlock ();
-  add_in_edge (b, f);
+  add_immBlock_pred (b, f);
   set_value (1, new_Const (mode_Is, new_tarval_from_long (2, mode_Is)));
-  mature_block (b);
+  mature_immBlock (b);
   x_else = new_Jmp ();
 
   /* generate the join block and add all cfg edges */
   b = new_immBlock ();
-  add_in_edge (b, x_then);
-  add_in_edge (b, x_else);
+  add_immBlock_pred (b, x_then);
+  add_immBlock_pred (b, x_else);
 
   /* Generate the return node into current region. */
   {
@@ -125,14 +125,14 @@ int main(int argc, char **argv)
   }
   /* Now generate all instructions for this block and all its predecessor
      blocks so we can mature it. */
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* This adds the in edge of the end block which originates at the
      return statement.  The return node passes control flow to the
      end block.  */
-  add_in_edge (get_irg_end_block(irg), x);
+  add_immBlock_pred (get_irg_end_block(irg), x);
   /* Now we can mature the end block as all it's predecessors are known. */
-  mature_block (get_irg_end_block(irg));
+  mature_immBlock (get_irg_end_block(irg));
 
   finalize_cons (irg);
 
@@ -145,7 +145,7 @@ int main(int argc, char **argv)
   finalize_cons (irg);
 
   printf("Done building the graph.  Dumping it.\n");
-  dump_ir_block_graph (irg);
+  dump_ir_block_graph (irg, 0);
   printf("use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index b46b6c1..b53b653 100644 (file)
@@ -53,16 +53,16 @@ main(void)
 
   owner = get_glob_type();
   /* Type information for the procedure */
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                              NRARGS, NRES);
   /* The entity for the procedure */
   ent = new_entity (owner,
-                    id_from_str (METHODNAME, strlen(METHODNAME)),
+                    new_id_from_chars (METHODNAME, strlen(METHODNAME)),
                     proc_main);
   /* The type int.  This type is necessary to model the result and parameters
      the procedure. */
 #define PRIM_NAME "int"
-  typ = new_type_primitive(id_from_str(PRIM_NAME, strlen(PRIM_NAME)), mode_Is);
+  typ = new_type_primitive(new_id_from_chars(PRIM_NAME, strlen(PRIM_NAME)), mode_Is);
   /* The parameter and result types of the procedure. */
   set_method_param_type(proc_main, 0, typ);
   set_method_res_type(proc_main, 0, typ);
@@ -85,7 +85,7 @@ main(void)
   set_value (b_pos, new_Const (mode_Is, new_tarval_from_long (2, mode_Is)));
   /* We know all predecessors of the block and all set_values and set_stores are
      preformed.   We can mature the block.  */
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* Generate a conditional branch */
   cmp = new_Cmp(get_value(a_pos, mode_Is), get_value(b_pos, mode_Is));
@@ -95,7 +95,7 @@ main(void)
 
   /* generate and fill the then block */
   r = new_immBlock ();
-  add_in_edge (r, t);
+  add_immBlock_pred (r, t);
   {
     ir_node *b,*c;
     c = new_Const (mode_Is, new_tarval_from_long (3, mode_Is));
@@ -106,14 +106,14 @@ main(void)
   }
   set_value (a_pos, a);
 
-  mature_block (r);
+  mature_immBlock (r);
   x = new_Jmp ();
 
   /* generate the fall through block and add all cfg edges */
   r = new_immBlock ();
-  add_in_edge (r, f);
-  add_in_edge (r, x);
-  mature_block (r);
+  add_immBlock_pred (r, f);
+  add_immBlock_pred (r, x);
+  mature_immBlock (r);
   /* The Return statement */
   {
      ir_node *in[1], *store ;
@@ -124,8 +124,8 @@ main(void)
   }
 
   /* finalize the end block generated in new_ir_graph() */
-  add_in_edge (get_irg_end_block(irg), x);
-  mature_block (get_irg_end_block(irg));
+  add_immBlock_pred (get_irg_end_block(irg), x);
+  mature_immBlock (get_irg_end_block(irg));
 
   /* verify the graph */
   irg_vrfy(irg);
@@ -133,7 +133,7 @@ main(void)
 
   /* output the vcg file */
   printf("Done building the graph.  Dumping it.\n");
-  dump_ir_block_graph (irg);
+  dump_ir_block_graph (irg, 0);
   printf("use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index 63ace9d..50758d2 100644 (file)
@@ -62,17 +62,17 @@ main(void)
   set_opt_dead_node_elimination (1);
 
   /*** Make basic type information for primitive type int. ***/
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Iu);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Iu);
 
 #define METHODNAME "main"
 #define NRARGS 0
 #define NRES 1
 
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                               NRARGS, NRES);
   set_method_res_type(proc_main, 0, prim_t_int);
-  owner = new_type_class (id_from_str ("IF_WHILE_EXAMPLE", 16));
-  ent = new_entity (owner, id_from_str ("main", 4), proc_main);
+  owner = new_type_class (new_id_from_chars ("IF_WHILE_EXAMPLE", 16));
+  ent = new_entity (owner, new_id_from_chars ("main", 4), proc_main);
   get_entity_ld_name(ent);
 
   /* Generates start and end blocks and nodes and a first, initial block */
@@ -81,20 +81,20 @@ main(void)
   /* Generate two constants */
   set_value (0, new_Const (mode_Iu, new_tarval_from_long (0, mode_Iu)));
   set_value (1, new_Const (mode_Iu, new_tarval_from_long (1, mode_Iu)));
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* Generate a conditional branch */
   x = new_Jmp();
 
   /* generate the fall through block and add all cfg edges */
   r = new_immBlock ();
-  add_in_edge (r, x);
-  mature_block (r);
+  add_immBlock_pred (r, x);
+  mature_immBlock (r);
   x = new_Jmp ();
 
   /* generate a block for the loop header and the conditional branch */
   r = new_immBlock ();
-  add_in_edge (r, x);
+  add_immBlock_pred (r, x);
   x = new_Cond (new_Proj(new_Cmp(new_Const (mode_Iu, new_tarval_from_long (0, mode_Is)),
                                  new_Const (mode_Iu, new_tarval_from_long (0, mode_Is))),
                          mode_b, Eq));
@@ -103,10 +103,10 @@ main(void)
 
   /* generate the block for the loop body */
   b = new_immBlock ();
-  add_in_edge (b,t);
+  add_immBlock_pred (b,t);
   x = new_Jmp ();
-  add_in_edge (r, x);
-  mature_block (r);
+  add_immBlock_pred (r, x);
+  mature_immBlock (r);
 
   /* the code in the loop body,
      as we are dealing with local variables only the dataflow edges
@@ -114,12 +114,12 @@ main(void)
   set_value (2, get_value (0, mode_Iu));
   set_value (0, get_value (1, mode_Iu));
   set_value (1, get_value (2, mode_Iu));
-  mature_block (b);
+  mature_immBlock (b);
 
   /* generate the return block */
   r = new_immBlock ();
-  add_in_edge (r, f);
-  mature_block (r);
+  add_immBlock_pred (r, f);
+  mature_immBlock (r);
 
   {
      ir_node *in[1];
@@ -129,8 +129,8 @@ main(void)
   }
 
   /* finalize the end block generated in new_ir_graph() */
-  add_in_edge (get_irg_end_block(irg), x);
-  mature_block (get_irg_end_block(irg));
+  add_immBlock_pred (get_irg_end_block(irg), x);
+  mature_immBlock (get_irg_end_block(irg));
 
   finalize_cons (irg);
 
@@ -147,7 +147,7 @@ main(void)
   /* output the vcg file */
   printf("Done building the graph.  Dumping it with out-edges.\n");
   dump_out_edges();
-  dump_ir_graph (irg);
+  dump_ir_graph (irg, 0);
   printf("Use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index 104edf3..5dd4b85 100644 (file)
@@ -55,15 +55,15 @@ int main(int argc, char **argv)
   init_firm (NULL);
 
   /** make idents for all used identifiers in the program. */
-  ii  = id_from_str("i",  strlen("i"));
-  ci  = id_from_str("c",  strlen("c"));
-  di  = id_from_str("d",  strlen("d"));
-  ei  = id_from_str("e",  strlen("e"));
-  m1i = id_from_str("m1", strlen("m1"));
-  m2i = id_from_str("m2", strlen("m2"));
-  inti= id_from_str("int",strlen("int"));
-  ai  = id_from_str("a",  strlen("a"));
-  bi  = id_from_str("b",  strlen("b"));
+  ii  = new_id_from_chars("i",  strlen("i"));
+  ci  = new_id_from_chars("c",  strlen("c"));
+  di  = new_id_from_chars("d",  strlen("d"));
+  ei  = new_id_from_chars("e",  strlen("e"));
+  m1i = new_id_from_chars("m1", strlen("m1"));
+  m2i = new_id_from_chars("m2", strlen("m2"));
+  inti= new_id_from_chars("int",strlen("int"));
+  ai  = new_id_from_chars("a",  strlen("a"));
+  bi  = new_id_from_chars("b",  strlen("b"));
 
   /** make the type information needed */
   /* Language defined types */
@@ -104,7 +104,7 @@ int main(int argc, char **argv)
 
 
   printf("Done building the graph.  Dumping it.\n");
-  dump_all_types();
+  dump_all_types(0);
 
   printf("use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
index c85b2b3..f72080d 100644 (file)
@@ -71,11 +71,11 @@ int main(int argc, char **argv)
 #define NRARGS 0
 #define NRES 0
 
-  owner = new_type_class (id_from_str (CLASSNAME, strlen(CLASSNAME)));
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  owner = new_type_class (new_id_from_chars (CLASSNAME, strlen(CLASSNAME)));
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                               NRARGS, NRES);
   ent = new_entity ((type *)owner,
-                    id_from_str (METHODNAME, strlen(METHODNAME)),
+                    new_id_from_chars (METHODNAME, strlen(METHODNAME)),
                     (type *)proc_main);
   get_entity_ld_name(ent);
 #define NUM_OF_LOCAL_VARS 0
@@ -90,41 +90,41 @@ int main(int argc, char **argv)
   cond = new_Cond(new_Proj(new_Cmp(expr, c1), mode_b, Eq));
   f = new_Proj(cond, mode_X, 0);
   t = new_Proj(cond, mode_X, 1);
-  mature_block(get_irg_current_block(irg));
+  mature_immBlock(get_irg_current_block(irg));
 
   new_immBlock();
-  add_in_edge(get_irg_current_block(irg), t);
+  add_immBlock_pred(get_irg_current_block(irg), t);
   jmp = new_Jmp();
-  mature_block(get_irg_current_block(irg));
+  mature_immBlock(get_irg_current_block(irg));
 
   new_immBlock();
-  add_in_edge(get_irg_current_block(irg), f);
+  add_immBlock_pred(get_irg_current_block(irg), f);
   cond = new_Cond(new_Proj(new_Cmp(expr, c2), mode_b, Eq));
   f = new_Proj(cond, mode_X, 0);
   t = new_Proj(cond, mode_X, 1);
-  mature_block(get_irg_current_block(irg));
+  mature_immBlock(get_irg_current_block(irg));
 
   new_immBlock();
-  add_in_edge(get_irg_current_block(irg), t);
-  add_in_edge(get_irg_current_block(irg), jmp);
+  add_immBlock_pred(get_irg_current_block(irg), t);
+  add_immBlock_pred(get_irg_current_block(irg), jmp);
   jmp = new_Jmp();
-  mature_block(get_irg_current_block(irg));
+  mature_immBlock(get_irg_current_block(irg));
 
   new_immBlock();
-  add_in_edge(get_irg_current_block(irg), f);
+  add_immBlock_pred(get_irg_current_block(irg), f);
   t = new_Jmp();
-  mature_block(get_irg_current_block(irg));
+  mature_immBlock(get_irg_current_block(irg));
 
   new_immBlock();
-  add_in_edge(get_irg_current_block(irg), t);
-  add_in_edge(get_irg_current_block(irg), jmp);
+  add_immBlock_pred(get_irg_current_block(irg), t);
+  add_immBlock_pred(get_irg_current_block(irg), jmp);
 
   x = new_Return (get_store(), 0, NULL);
 
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
-  add_in_edge (get_irg_end_block(irg), x);
-  mature_block (get_irg_end_block(irg));
+  add_immBlock_pred (get_irg_end_block(irg), x);
+  mature_immBlock (get_irg_end_block(irg));
 
   finalize_cons (irg);
 
@@ -135,8 +135,9 @@ int main(int argc, char **argv)
   irg_vrfy(irg);
 
   printf("Dumping the graph and a control flow graph.\n");
-  dump_ir_block_graph (irg);
-  dump_cfg (irg);
+  char *dump_file_suffix = "";
+  dump_ir_block_graph (irg, dump_file_suffix);
+  dump_cfg (irg, dump_file_suffix);
   printf("Use xvcg to view these graphs:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index 23a9ada..441e2d5 100644 (file)
@@ -64,11 +64,11 @@ int main(int argc, char **argv)
 #define NRES 0
   printf("\nCreating an IR graph: %s...\n", CLASSNAME);
 
-  owner = new_type_class (id_from_str (CLASSNAME, strlen(CLASSNAME)));
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  owner = new_type_class (new_id_from_chars (CLASSNAME, strlen(CLASSNAME)));
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                               NRARGS, NRES);
   ent = new_entity (owner,
-                    id_from_str (METHODNAME, strlen(METHODNAME)),
+                    new_id_from_chars (METHODNAME, strlen(METHODNAME)),
                     proc_main);
   get_entity_ld_name(ent); /* To enforce name mangling for vcg graph name */
 
@@ -85,33 +85,33 @@ int main(int argc, char **argv)
   cond = new_Cond(new_Proj(new_Cmp(expr, c1), mode_b, Eq));
   f = new_Proj(cond, mode_X, 0);
   t = new_Proj(cond, mode_X, 1);
-  mature_block(get_irg_current_block(irg));
+  mature_immBlock(get_irg_current_block(irg));
 
   loopBlock1 = new_immBlock();
-  add_in_edge(loopBlock1, t);
+  add_immBlock_pred(loopBlock1, t);
   cond = new_Cond(new_Proj(new_Cmp(expr, c2), mode_b, Eq));
   f_l1 = new_Proj(cond, mode_X, 0);
   t_l1 = new_Proj(cond, mode_X, 1);
 
   loopBlock2 = new_immBlock();
-  add_in_edge(loopBlock2, f);
+  add_immBlock_pred(loopBlock2, f);
   cond = new_Cond(new_Proj(new_Cmp(expr, c3), mode_b, Eq));
   f_l2 = new_Proj(cond, mode_X, 0);
   t_l2 = new_Proj(cond, mode_X, 1);
 
-  add_in_edge(loopBlock1, t_l2);
-  add_in_edge(loopBlock2, t_l1);
-  mature_block(loopBlock1);
-  mature_block(loopBlock2);
+  add_immBlock_pred(loopBlock1, t_l2);
+  add_immBlock_pred(loopBlock2, t_l1);
+  mature_immBlock(loopBlock1);
+  mature_immBlock(loopBlock2);
 
   new_immBlock();
-  add_in_edge(get_irg_current_block(irg), f_l2);
-  add_in_edge(get_irg_current_block(irg), f_l1);
+  add_immBlock_pred(get_irg_current_block(irg), f_l2);
+  add_immBlock_pred(get_irg_current_block(irg), f_l1);
   x = new_Return (get_store(), 0, NULL);
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
-  add_in_edge (get_irg_end_block(irg), x);
-  mature_block (get_irg_end_block(irg));
+  add_immBlock_pred (get_irg_end_block(irg), x);
+  mature_immBlock (get_irg_end_block(irg));
 
   finalize_cons (irg);
 
@@ -122,8 +122,9 @@ int main(int argc, char **argv)
   irg_vrfy(irg);
 
   printf("Dumping the graph and a control flow graph.\n");
-  dump_ir_block_graph (irg);
-  dump_cfg (irg);
+  char *dump_file_suffix = "";
+  dump_ir_block_graph (irg, dump_file_suffix);
+  dump_cfg (irg, dump_file_suffix);
   printf("Use xvcg to view these graphs:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index 1ec5af1..fa0e436 100644 (file)
@@ -75,13 +75,13 @@ main(void)
   set_opt_dead_node_elimination (1);
 
   /*** Make basic type information for primitive type int. ***/
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Iu);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Iu);
 
   /* a class to get started with, containing the main procedure */
-  owner = new_type_class (id_from_str ("MEMORY_EXAMPLE", 14));
-  method = new_type_method (id_from_str("main", 4), 0, 1);
+  owner = new_type_class (new_id_from_chars ("MEMORY_EXAMPLE", 14));
+  method = new_type_method (new_id_from_chars("main", 4), 0, 1);
   set_method_res_type(method, 0, prim_t_int);
-  ent = new_entity (owner, id_from_str ("main", 4), method);
+  ent = new_entity (owner, new_id_from_chars ("main", 4), method);
   get_entity_ld_name(ent); /* To enforce name mangling for vcg graph name */
 
   /* Generates start and end blocks and nodes and a first, initial block */
@@ -91,11 +91,11 @@ main(void)
   a = new_simpleSel(
               get_store(),
               get_irg_globals(irg),
-              new_entity(get_glob_type(),id_from_str("VAR_A",6),prim_t_int));
+              new_entity(get_glob_type(),new_id_from_chars("VAR_A",6),prim_t_int));
   b = new_simpleSel(
               get_store(),
               get_irg_globals(irg),
-              new_entity(get_glob_type(),id_from_str("VAR_B",6),prim_t_int));
+              new_entity(get_glob_type(),new_id_from_chars("VAR_B",6),prim_t_int));
    /* set VAR_A and VAR_B to constant values */
   set_store (new_Proj (new_Store (get_store (), a,
                                  new_Const (mode_Iu, new_tarval_from_long (0, mode_Is))),
@@ -107,11 +107,11 @@ main(void)
 
   /* finish this first block */
   x = new_Jmp ();
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* a loop body */
   r = new_immBlock ();
-  add_in_edge (r, x);
+  add_immBlock_pred (r, x);
 
   /* exchange the content of the two variables. Exceptions not cached. */
   /* load the value and make it's effects visible. */
@@ -135,13 +135,13 @@ main(void)
           mode_b, Gt));
 
   /* build the cfg of the loop */
-  add_in_edge (r, new_Proj (x, mode_X, 0));
+  add_immBlock_pred (r, new_Proj (x, mode_X, 0));
   x = new_Proj (x, mode_X, 1);
-  mature_block(r);
+  mature_immBlock(r);
 
   /* generate the block the loop exits to */
   r = new_immBlock ();
-  add_in_edge (r, x);
+  add_immBlock_pred (r, x);
 
   /* generate the return block and return the content of VAR_A */
   {
@@ -151,9 +151,9 @@ main(void)
 
      x = new_Return (new_Proj(x, mode_M, 0), 1, in);
   }
-  mature_block (r);
-  add_in_edge (get_irg_end_block(irg), x);
-  mature_block (get_irg_end_block(irg));
+  mature_immBlock (r);
+  add_immBlock_pred (get_irg_end_block(irg), x);
+  mature_immBlock (get_irg_end_block(irg));
 
   finalize_cons (irg);
 
@@ -164,7 +164,7 @@ main(void)
   irg_vrfy(irg);
 
   printf("Done building the graph.  Dumping it.\n");
-  dump_ir_block_graph (irg);
+  dump_ir_block_graph (irg, 0);
   printf("Use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index d8ba70c..6dfdc0d 100644 (file)
@@ -68,30 +68,30 @@ main(void)
   set_opt_dead_node_elimination(1);
 
   /*** Make basic type information for primitive type int. ***/
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Is);
 
   /*** Make type information for the class (PRIMA). ***/
   /* The type of the class */
   class_prima = new_type_class(new_id_from_str ("PRIMA_INLINE"));
   /* We need type information for pointers to the class: */
-  class_p_ptr = new_type_pointer (id_from_str ("class_prima_ptr", 15),
+  class_p_ptr = new_type_pointer (new_id_from_chars ("class_prima_ptr", 15),
                                  class_prima);
   /* An entity for the field (a).  The entity constructor automatically adds
      the entity as member of the owner. */
-  a_e = new_entity(class_prima, id_from_str ("a", 1), prim_t_int);
+  a_e = new_entity(class_prima, new_id_from_chars ("a", 1), prim_t_int);
   /* An entity for the method set_a.  But first we need type information
      for the method. */
-  proc_set_a = new_type_method(id_from_str("set_a", 5), 2, 0);
+  proc_set_a = new_type_method(new_id_from_chars("set_a", 5), 2, 0);
   set_method_param_type(proc_set_a, 0, class_p_ptr);
   set_method_param_type(proc_set_a, 1, prim_t_int);
-  proc_set_a_e = new_entity(class_prima, id_from_str ("set_a", 5), proc_set_a);
+  proc_set_a_e = new_entity(class_prima, new_id_from_chars ("set_a", 5), proc_set_a);
   /* An entity for the method c. Implicit argument "self" must be modeled
      explicit! */
-  proc_c   = new_type_method(id_from_str("c", 1 ), 2, 1);
+  proc_c   = new_type_method(new_id_from_chars("c", 1 ), 2, 1);
   set_method_param_type(proc_c, 0, class_p_ptr);
   set_method_param_type(proc_c, 1, prim_t_int);
   set_method_res_type(proc_c, 0, prim_t_int);
-  proc_c_e = new_entity(class_prima, id_from_str ("c", 1), proc_c);
+  proc_c_e = new_entity(class_prima, new_id_from_chars ("c", 1), proc_c);
 
   /*** Now build procedure main. ***/
   /** Type information for main. **/
@@ -100,12 +100,12 @@ main(void)
      owner is the global type. */
   owner = get_glob_type();
   /* Main has zero parameters and one result. */
-  proc_main = new_type_method(id_from_str("OO_INLINE_EXAMPLE_main", 22), 0, 1);
+  proc_main = new_type_method(new_id_from_chars("OO_INLINE_EXAMPLE_main", 22), 0, 1);
   /* The result type is int. */
   set_method_res_type(proc_main, 0, prim_t_int);
 
   /* The entity for main. */
-  proc_main_e = new_entity (owner, id_from_str ("OO_INLINE_EXAMPLE_main", 22), proc_main);
+  proc_main_e = new_entity (owner, new_id_from_chars ("OO_INLINE_EXAMPLE_main", 22), proc_main);
 
   /** Build code for procedure main. **/
   /* We need one local variable (for "o"). */
@@ -166,11 +166,11 @@ main(void)
      in[0] = res;
      x = new_Return (get_store(), 1, in);
   }
-  mature_block (get_irg_current_block(main_irg));
+  mature_immBlock (get_irg_current_block(main_irg));
 
   /* complete the end_block */
-  add_in_edge (get_irg_end_block(main_irg), x);
-  mature_block (get_irg_end_block(main_irg));
+  add_immBlock_pred (get_irg_end_block(main_irg), x);
+  mature_immBlock (get_irg_end_block(main_irg));
 
   irg_vrfy(main_irg);
   finalize_cons (main_irg);
@@ -195,11 +195,11 @@ main(void)
 
   /* return nothing */
   x = new_Return (get_store (), 0, NULL);
-  mature_block (get_irg_current_block(set_a_irg));
+  mature_immBlock (get_irg_current_block(set_a_irg));
 
   /* complete the end_block */
-  add_in_edge (get_irg_end_block(set_a_irg), x);
-  mature_block (get_irg_end_block(set_a_irg));
+  add_immBlock_pred (get_irg_end_block(set_a_irg), x);
+  mature_immBlock (get_irg_end_block(set_a_irg));
 
   /* verify the graph */
   irg_vrfy(set_a_irg);
@@ -220,11 +220,11 @@ main(void)
   set_value(2, new_Const (mode_Is, new_tarval_from_long (0, mode_Is)));
 
   x = new_Jmp();
-  mature_block (get_irg_current_block(c_irg));
+  mature_immBlock (get_irg_current_block(c_irg));
 
   /* generate a block for the loop header and the conditional branch */
   r = new_immBlock ();
-  add_in_edge (r, x);
+  add_immBlock_pred (r, x);
   x = new_Cond (new_Proj(new_Cmp(new_Const (mode_Is, new_tarval_from_long (0, mode_Is)),
                                 new_Const (mode_Is, new_tarval_from_long (0, mode_Is))),
                         mode_b, Eq));
@@ -237,7 +237,7 @@ main(void)
 
   /* generate the block for the loop body */
   b = new_immBlock ();
-  add_in_edge (b, t);
+  add_immBlock_pred (b, t);
 
   /* The code in the loop body,
      as we are dealing with local variables only the dataflow edges
@@ -248,13 +248,13 @@ main(void)
   a_ptr = new_simpleSel(get_store(), self, a_e);
   set_store(new_Store(get_store(), a_ptr, get_value(2, mode_Is)));
   x = new_Jmp ();
-  add_in_edge(r, x);
-  mature_block (b);
-  mature_block (r);
+  add_immBlock_pred(r, x);
+  mature_immBlock (b);
+  mature_immBlock (r);
 
   /* generate the return block */
   r = new_immBlock ();
-  add_in_edge (r, f);
+  add_immBlock_pred (r, f);
   /* Select the entity and load the value */
   a_ptr = new_simpleSel(get_store(), self, a_e);
   a_val = new_Load(get_store(), a_ptr);
@@ -268,11 +268,11 @@ main(void)
 
     x = new_Return (get_store (), 1, in);
   }
-  mature_block (r);
+  mature_immBlock (r);
 
   /* complete the end_block */
-  add_in_edge (get_irg_end_block(c_irg), x);
-  mature_block (get_irg_end_block(c_irg));
+  add_immBlock_pred (get_irg_end_block(c_irg), x);
+  mature_immBlock (get_irg_end_block(c_irg));
 
   /* verify the graph */
   irg_vrfy(c_irg);
@@ -299,9 +299,10 @@ main(void)
   get_entity_ld_ident(proc_set_a_e);
   get_entity_ld_ident(proc_c_e);
   turn_off_edge_labels();
-  dump_all_ir_graphs(dump_ir_block_graph);
-  dump_all_ir_graphs(dump_ir_block_graph_w_types);
-  dump_all_types();
+  char *suffix = "";
+  dump_all_ir_graphs(dump_ir_block_graph, suffix);
+  dump_all_ir_graphs(dump_ir_block_graph_w_types, suffix);
+  dump_all_types(0);
 
   printf("Use xvcg to view these graphs:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
index 835d8be..20e8348 100644 (file)
@@ -66,30 +66,30 @@ main(void)
   set_opt_dead_node_elimination(1);
 
   /*** Make basic type information for primitive type int. ***/
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Is);
 
   /*** Make type information for the class (PRIMA). ***/
   /* The type of the class */
-  class_prima = new_type_class(id_from_str ("PRIMA", 5));
+  class_prima = new_type_class(new_id_from_chars ("PRIMA", 5));
   /* We need type information for pointers to the class: */
-  class_p_ptr = new_type_pointer (id_from_str ("class_prima_ptr", 15),
+  class_p_ptr = new_type_pointer (new_id_from_chars("class_prima_ptr", 15),
                                  class_prima);
   /* An entity for the field (a).  The entity constructor automatically adds
      the entity as member of the owner. */
-  a_e = new_entity(class_prima, id_from_str ("a", 1), prim_t_int);
+  a_e = new_entity(class_prima, new_id_from_chars ("a", 1), prim_t_int);
   /* An entity for the method set_a.  But first we need type information
      for the method. */
-  proc_set_a = new_type_method(id_from_str("set_a", 5), 2, 0);
+  proc_set_a = new_type_method(new_id_from_chars("set_a", 5), 2, 0);
   set_method_param_type(proc_set_a, 0, class_p_ptr);
   set_method_param_type(proc_set_a, 1, prim_t_int);
-  proc_set_a_e = new_entity(class_prima, id_from_str ("set_a", 5), proc_set_a);
+  proc_set_a_e = new_entity(class_prima, new_id_from_chars ("set_a", 5), proc_set_a);
   /* An entity for the method c. Implicit argument "self" must be modeled
      explicit! */
-  proc_c   = new_type_method(id_from_str("c", 1 ), 2, 1);
+  proc_c   = new_type_method(new_id_from_chars("c", 1 ), 2, 1);
   set_method_param_type(proc_c, 0, class_p_ptr);
   set_method_param_type(proc_c, 1, prim_t_int);
   set_method_res_type(proc_c, 0, prim_t_int);
-  proc_c_e = new_entity(class_prima, id_from_str ("c", 1), proc_c);
+  proc_c_e = new_entity(class_prima, new_id_from_chars ("c", 1), proc_c);
 
   /*** Now build procedure main. ***/
   /** Type information for main. **/
@@ -98,12 +98,12 @@ main(void)
      owner is the global type. */
   owner = get_glob_type();
   /* Main has zero parameters and one result. */
-  proc_main = new_type_method(id_from_str("OO_PROGRAM_EXAMPLE_main", 23), 0, 1);
+  proc_main = new_type_method(new_id_from_chars("OO_PROGRAM_EXAMPLE_main", 23), 0, 1);
   /* The result type is int. */
   set_method_res_type(proc_main, 0, prim_t_int);
 
   /* The entity for main. */
-  proc_main_e = new_entity (owner, id_from_str ("OO_PROGRAM_EXAMPLE_main", 23), proc_main);
+  proc_main_e = new_entity (owner, new_id_from_chars ("OO_PROGRAM_EXAMPLE_main", 23), proc_main);
 
   /** Build code for procedure main. **/
   /* We need one local variable (for "o"). */
@@ -163,11 +163,11 @@ main(void)
      in[0] = res;
      x = new_Return (get_store(), 1, in);
   }
-  mature_block (get_irg_current_block(main_irg));
+  mature_immBlock (get_irg_current_block(main_irg));
 
   /* complete the end_block */
-  add_in_edge (get_irg_end_block(main_irg), x);
-  mature_block (get_irg_end_block(main_irg));
+  add_immBlock_pred (get_irg_end_block(main_irg), x);
+  mature_immBlock (get_irg_end_block(main_irg));
 
   irg_vrfy(main_irg);
   finalize_cons (main_irg);
@@ -192,11 +192,11 @@ main(void)
 
   /* return nothing */
   x = new_Return (get_store (), 0, NULL);
-  mature_block (get_irg_current_block(set_a_irg));
+  mature_immBlock (get_irg_current_block(set_a_irg));
 
   /* complete the end_block */
-  add_in_edge (get_irg_end_block(set_a_irg), x);
-  mature_block (get_irg_end_block(set_a_irg));
+  add_immBlock_pred (get_irg_end_block(set_a_irg), x);
+  mature_immBlock (get_irg_end_block(set_a_irg));
 
   /* verify the graph */
   irg_vrfy(set_a_irg);
@@ -226,11 +226,11 @@ main(void)
 
     x = new_Return (get_store (), 1, in);
   }
-  mature_block (get_irg_current_block(c_irg));
+  mature_immBlock (get_irg_current_block(c_irg));
 
   /* complete the end_block */
-  add_in_edge (get_irg_end_block(c_irg), x);
-  mature_block (get_irg_end_block(c_irg));
+  add_immBlock_pred (get_irg_end_block(c_irg), x);
+  mature_immBlock (get_irg_end_block(c_irg));
 
   /* verify the graph */
   irg_vrfy(c_irg);
@@ -252,13 +252,13 @@ main(void)
   dump_consts_local(1);
   turn_off_edge_labels();
 
-  dump_all_ir_graphs(dump_ir_graph);
-  dump_all_ir_graphs(dump_ir_block_graph);
-  dump_all_ir_graphs(dump_ir_graph_w_types);
-  dump_all_ir_graphs(dump_ir_block_graph_w_types);
-  dump_all_ir_graphs(dump_type_graph);
-  dump_all_types();
-  dump_class_hierarchy (true);
+  dump_all_ir_graphs(dump_ir_graph, "");
+  dump_all_ir_graphs(dump_ir_block_graph, "");
+  dump_all_ir_graphs(dump_ir_graph_w_types, "");
+  dump_all_ir_graphs(dump_ir_block_graph_w_types, "");
+  dump_all_ir_graphs(dump_type_graph, "");
+  dump_all_types("");
+  dump_class_hierarchy (true, "");
 
   entity **free_methods;
   int arr_len;
@@ -266,11 +266,11 @@ main(void)
   cg_construct(arr_len, free_methods);
 
   interprocedural_view = 1;
-  dump_ir_graph(main_irg);
-  dump_ir_block_graph(main_irg);
-  dump_ir_graph_w_types(main_irg);
-  dump_ir_block_graph_w_types(main_irg);
-  dump_all_cg_block_graph();
+  dump_ir_graph(main_irg, "");
+  dump_ir_block_graph(main_irg, "");
+  dump_ir_graph_w_types(main_irg, "");
+  dump_ir_block_graph_w_types(main_irg, "");
+  dump_all_cg_block_graph("");
 
   printf("Use xvcg to view these graphs:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
index c70332e..ccf6bcf 100644 (file)
@@ -33,7 +33,7 @@ ir_graph *make_method(char *name, int n_locs) {
 
 
 ir_node *make_Call(ir_graph *c, int n_args, ir_node **args) {
-  entity *ent = get_irg_ent(c);
+  entity *ent = get_irg_entity(c);
   type *mtp = get_entity_type(ent);
   symconst_symbol sym;
   sym.entity_p = ent;
@@ -49,9 +49,9 @@ ir_node *make_Call(ir_graph *c, int n_args, ir_node **args) {
 
 void close_method(int n_ins, ir_node **ins) {
   ir_node *x =  new_Return (get_store(), n_ins, ins);
-  mature_block (get_cur_block());
-  add_in_edge  (get_cur_end_block(), x);
-  mature_block (get_cur_end_block());
+  mature_immBlock (get_cur_block());
+  add_immBlock_pred  (get_cur_end_block(), x);
+  mature_immBlock (get_cur_end_block());
   finalize_cons(current_ir_graph);
 }
 
index 2c283a1..9bdafb0 100644 (file)
@@ -65,7 +65,7 @@ int main(int argc, char **argv)
   set_optimize(1);
 
   /*** Make basic type information for primitive type int. ***/
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Is);
 
   /* FIRM was designed for oo languages where all methods belong to a class.
    * For imperative languages like C we view a file as a large class containing
@@ -78,13 +78,13 @@ int main(int argc, char **argv)
   printf("\nCreating an IR graph: THREE_CFPRED_EXAMPLE ...\n");
 
   owner = get_glob_type();
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                   NRARGS, NRES);
   set_method_param_type(proc_main, 0, prim_t_int);
   set_method_res_type(proc_main, 0, prim_t_int);
 
   ent = new_entity (owner,
-                    id_from_str (METHODNAME, strlen(METHODNAME)),
+                    new_id_from_chars (METHODNAME, strlen(METHODNAME)),
                     proc_main);
 
 #define NUM_OF_LOCAL_VARS 2
@@ -100,55 +100,55 @@ int main(int argc, char **argv)
   set_value(0, new_Const (mode_Is, new_tarval_from_long (6, mode_Is)));
   f = new_Proj(cond, mode_X, 0);
   t = new_Proj(cond, mode_X, 1);
-  mature_block(get_irg_current_block(irg));
+  mature_immBlock(get_irg_current_block(irg));
 
   /* end block to add jmps */
   endBlock = new_immBlock();
 
   /* Block 1 */
   Block1 = new_immBlock();
-  add_in_edge(Block1, t);
-  mature_block(Block1);
+  add_immBlock_pred(Block1, t);
+  mature_immBlock(Block1);
   set_value(0, new_Const (mode_Is, new_tarval_from_long (5, mode_Is)));
   jmp = new_Jmp();
-  add_in_edge(endBlock, jmp);
+  add_immBlock_pred(endBlock, jmp);
 
   /* scndCondBlock */
   scndCondBlock = new_immBlock();
-  add_in_edge(scndCondBlock, f);
-  mature_block(scndCondBlock);
+  add_immBlock_pred(scndCondBlock, f);
+  mature_immBlock(scndCondBlock);
   c1 = new_Const (mode_Is, new_tarval_from_long (3, mode_Is));
   cond = new_Cond(new_Proj(new_Cmp(c1, get_value(1, mode_Is)), mode_b, Eq));
   f = new_Proj(cond, mode_X, 0);
   t = new_Proj(cond, mode_X, 1);
-  mature_block(get_irg_current_block(irg));
+  mature_immBlock(get_irg_current_block(irg));
 
   /* Block 2 */
   Block2 = new_immBlock();
-  add_in_edge(Block2, f);
-  mature_block(Block2);
+  add_immBlock_pred(Block2, f);
+  mature_immBlock(Block2);
   jmp = new_Jmp();
-  add_in_edge(endBlock, jmp);
+  add_immBlock_pred(endBlock, jmp);
 
   /* Block 3 */
   Block3 = new_immBlock();
-  add_in_edge(Block3, t);
-  mature_block(Block3);
+  add_immBlock_pred(Block3, t);
+  mature_immBlock(Block3);
   jmp = new_Jmp();
-  add_in_edge(endBlock, jmp);
+  add_immBlock_pred(endBlock, jmp);
 
   /* finish the end Block */
-  switch_block(endBlock);
+  set_cur_block(endBlock);
   {
     ir_node *in[1];
     in[0] = get_value(0, mode_Is);
     x = new_Return (get_store(), 1, in);
   }
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
   /* finish the Block with the end node */
-  add_in_edge (get_irg_end_block(irg), x);
-  mature_block (get_irg_end_block(irg));
+  add_immBlock_pred (get_irg_end_block(irg), x);
+  mature_immBlock (get_irg_end_block(irg));
 
   /* verify the graph */
   irg_vrfy(irg);
@@ -158,8 +158,9 @@ int main(int argc, char **argv)
   dead_node_elimination(irg);
 
   printf("Dumping the graph and a control flow graph.\n");
-  dump_ir_block_graph (irg);
-  dump_cfg (irg);
+  char *suffix = "";
+  dump_ir_block_graph (irg, suffix);
+  dump_cfg (irg, suffix);
   printf("Use xvcg to view these graphs:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
index 302214c..b9040cb 100644 (file)
@@ -54,20 +54,20 @@ main(void)
   set_opt_cse(1);
   set_opt_dead_node_elimination (1);
 
-  prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is);
+  prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Is);
 
 #define METHODNAME "main_tp"
 #define NRARGS 1
 #define NRES 1
 
-  proc_main = new_type_method(id_from_str(METHODNAME, strlen(METHODNAME)),
+  proc_main = new_type_method(new_id_from_chars(METHODNAME, strlen(METHODNAME)),
                               NRARGS, NRES);
   set_method_param_type(proc_main, 0, prim_t_int);
   set_method_res_type(proc_main, 0, prim_t_int);
 
 
-  owner = new_type_class (id_from_str ("WHILE_EXAMPLE", 13));
-  ent = new_entity (owner, id_from_str ("main", strlen("main")), proc_main);
+  owner = new_type_class (new_id_from_chars ("WHILE_EXAMPLE", 13));
+  ent = new_entity (owner, new_id_from_chars ("main", strlen("main")), proc_main);
   get_entity_ld_name(ent); /* force name mangling */
 
   /* Generates start and end blocks and nodes and a first, initial block */
@@ -77,12 +77,12 @@ main(void)
   set_value (0, new_Proj(get_irg_args(irg), mode_Is, 0));
   set_value (1, new_Const (mode_Is, new_tarval_from_long (1, mode_Is)));
   x = new_Jmp();
-  mature_block (get_irg_current_block(irg));
+  mature_immBlock (get_irg_current_block(irg));
 
 
   /* generate a block for the loop header and the conditional branch */
   r = new_immBlock ();
-  add_in_edge (r, x);
+  add_immBlock_pred (r, x);
   x = new_Cond (new_Proj(new_Cmp(new_Const (mode_Is, new_tarval_from_long (0, mode_Is)),
                  get_value(1, mode_Is)),
                          mode_b, Eq));
@@ -91,9 +91,9 @@ main(void)
 
   /* generate the block for the loop body */
   b = new_immBlock ();
-  add_in_edge (b, t);
+  add_immBlock_pred (b, t);
   x = new_Jmp ();
-  add_in_edge (r, x);
+  add_immBlock_pred (r, x);
 
   /* The code in the loop body,
      as we are dealing with local variables only the dataflow edges
@@ -101,13 +101,13 @@ main(void)
   set_value (2, get_value (0, mode_Is));
   set_value (0, get_value (1, mode_Is));
   set_value (1, get_value (2, mode_Is));
-  mature_block (b);
-  mature_block (r);
+  mature_immBlock (b);
+  mature_immBlock (r);
 
   /* generate the return block */
   r = new_immBlock ();
-  add_in_edge (r, f);
-  mature_block (r);
+  add_immBlock_pred (r, f);
+  mature_immBlock (r);
 
   {
      ir_node *in[1];
@@ -117,8 +117,8 @@ main(void)
   }
 
   /* finalize the end block generated in new_ir_graph() */
-  add_in_edge (get_irg_end_block(irg), x);
-  mature_block (get_irg_end_block(irg));
+  add_immBlock_pred (get_irg_end_block(irg), x);
+  mature_immBlock (get_irg_end_block(irg));
 
   finalize_cons (irg);
 
@@ -133,8 +133,9 @@ main(void)
   /* output the vcg file */
   printf("Done building the graph.  Dumping it.\n");
   turn_off_edge_labels();
-  dump_all_types();
-  dump_ir_block_graph (irg);
+  char *suffix = "";
+  dump_all_types(suffix);
+  dump_ir_block_graph (irg, suffix);
   printf("Use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");