removed exc.h from libfirm interface
[libfirm] / ir / ir / irprog.c
index 0c55579..53759f4 100644 (file)
@@ -1,12 +1,14 @@
-/* Copyright (C) 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
-** irprog.c: ir representation of a program
-*/
-
-/* $Id$ */
+/*
+ * Project:     libFIRM
+ * File name:   ir/ir/irprog.c
+ * Purpose:     Entry point to the representation of a whole program.
+ * Author:      Goetz Lindenmaier
+ * Modified by:
+ * Created:     2000
+ * CVS-ID:      $Id$
+ * Copyright:   (c) 2000-2003 Universität Karlsruhe
+ * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ */
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
@@ -55,6 +57,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 +70,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 +167,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;