used new verify_node operation
[libfirm] / ir / ir / irgraph.c
index 713a992..f372e50 100644 (file)
@@ -33,6 +33,7 @@
 # include "irouts.h"
 # include "irhooks.h"
 # include "irgwalk.h"
+# include "iredges_t.h"
 
 /**
  * Indicates, whether additional data can be registered to graphs.
@@ -126,6 +127,8 @@ new_r_ir_graph (entity *ent, int n_loc)
   res = alloc_graph();
   res->kind = k_ir_graph;
 
+  edges_init_graph(res);
+
   /* inform statistics here, as blocks will be already build on this graph */
   hook_new_graph(res, ent);
 
@@ -168,7 +171,8 @@ new_r_ir_graph (entity *ent, int n_loc)
   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->typeinfo_state = ir_typeinfo_none;
+  set_irp_typeinfo_inconsistent();           /* there is a new graph with typeinfo_none. */
   res->loopinfo_state = loopinfo_none;
 
   /*-- Type information for the procedure of the graph --*/
@@ -290,6 +294,7 @@ ir_graph *new_const_code_irg(void) {
   set_irn_visited(res->no_mem, -1);
 
   res->phase_state = phase_high;
+
   return res;
 }
 
@@ -570,7 +575,7 @@ int node_is_in_irgs_storage(ir_graph *irg, ir_node *n)
   struct _obstack_chunk *p;
 
   /*
-   * checks wheater the ir_node pointer i on the obstack.
+   * checks weather the ir_node pointer is on the obstack.
    * A more sophisticated check would test the "whole" ir_node
    */
   for (p = irg->obst->chunk; p; p = p->prev) {
@@ -774,7 +779,7 @@ void set_irg_loc_description(ir_graph *irg, int n, void *description)
   assert(0 <= n && n < irg->n_loc);
 
   if (! irg->loc_descriptions)
-    irg->loc_descriptions = xmalloc(sizeof(*irg->loc_descriptions) * irg->n_loc);
+    irg->loc_descriptions = xcalloc(sizeof(*irg->loc_descriptions), irg->n_loc);
 
   irg->loc_descriptions[n] = description;
 }