some fixes for xml dumper / still buggy.
[libfirm] / ir / ir / irprog.c
index 0c55579..5b9ca0e 100644 (file)
@@ -1,9 +1,9 @@
 /* Copyright (C) 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
-** irprog.c: ir representation of a program
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
+* irprog.c: ir representation of a program
 */
 
 /* $Id$ */
@@ -55,6 +55,11 @@ ir_prog *new_ir_prog (void) {
   /* res->obst      = (struct obstack *) xmalloc (sizeof (struct obstack)); */
   res->graphs = NEW_ARR_F (ir_graph *, 1);
   res->types  = NEW_ARR_F (type *, 1);
+
+#ifdef DEBUG_libfirm
+  res->max_node_nr = 0;
+#endif
+
   res->glob_type = new_type_class(id_from_str (GLOBAL_TYPE_NAME,
                                               strlen(GLOBAL_TYPE_NAME)));
   /* Remove type from type list.  Must be treated differently than
@@ -63,9 +68,6 @@ ir_prog *new_ir_prog (void) {
 
   res->const_code_irg = new_const_code_irg();
 
-#ifdef DEBUG_libfirm
-  res->max_node_nr = 1;
-#endif
 
   return res;
 }
@@ -163,7 +165,7 @@ void  set_irp_type(int pos, type *typ) {
 }
 
 #ifdef DEBUG_libfirm
-static int get_irp_new_node_nr() {
+int get_irp_new_node_nr() {
   assert(irp);
   irp->max_node_nr = irp->max_node_nr + 1;
   return irp->max_node_nr - 1;