CVS:
[libfirm] / ir / ir / irprog.h
index 117abbd..ea3fc01 100644 (file)
 # include "irnode.h"
 # include "type.h"
 
-struct ir_prog {
-  firm_kind kind;
-  ir_graph *main_irg;              /* entry point to the compiled program */
-                  /* or a list, in case we compile a library or the like? */
-  ir_graph **graphs;               /* all graphs in the ir */
-  type **types;                    /* all types in the ir */
-  type_class *glob_type;           /* global type.  Class as it can have
-                                     fields and procedures.  Does this work?
-                                     Better name??? @@@ */
-  /*struct obstack *obst;          * @@@ Should we place all types and
-                                      entities on an obstack, too? */
-#ifdef DEBUG_libfirm
-  long max_node_nr;                /* to generate unique numbers for nodes. */
-#endif
-};
 
 typedef struct ir_prog ir_prog;
 
 /* A variable from where everything in the ir can be accessed. */
-ir_prog *irp;
-
+extern ir_prog *irp;
 
 /* initializes ir_prog. Calles the constructor for an ir_prog. */
 void init_irprog(void);
@@ -58,10 +42,13 @@ void      set_irp_main_irg(ir_graph *main_irg);
 void      add_irp_irg(ir_graph *irg);
 int       get_irp_n_irgs();
 ir_graph *get_irp_irg(int pos);
-  /*     set_irp_irg()     und das gleiche fuer type */
+void      set_irp_irg(int pos, ir_graph *irg);
 
 /* Adds type to the list of types in irp. */
-void      add_irp_type(type *typ);
+void  add_irp_type(type *typ);
+int   get_irp_n_types();
+type *get_irp_type(int pos);
+void  set_irp_type(int pos, type *typ);
 
 /** Functions to access the fields of ir_prog **/
 type_class *get_glob_type(void);