X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firprog.h;h=ea3fc01389efcb99edf01e34bb4297f06ed11796;hb=5f8ddee6b08c8040c0a304a347d65045c1141d52;hp=961857c3514aee13fcf044fba6e551333024d3bb;hpb=3841faf71dcf8efa8312d0ebd9941f1e0fc08d72;p=libfirm diff --git a/ir/ir/irprog.h b/ir/ir/irprog.h index 961857c35..ea3fc0138 100644 --- a/ir/ir/irprog.h +++ b/ir/ir/irprog.h @@ -12,7 +12,7 @@ ** - A global type that can be thought of as a god-class containing all ** global variables and procedures. This is not the base class of ** all classes in a class hierarchy (as, e.g., "object" in java). -** - An obstack containing global things, e.g., the above mentioned lists. +** - (An obstack containing global things, e.g., the above mentioned lists.) */ # ifndef _IRPROG_H_ @@ -20,36 +20,42 @@ # include "irnode.h" # include "type.h" -/*# include "obst.h"*/ - -typedef struct ir_prog { - firm_kind kind; - 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 themselves - on an obstack, too? */ -} ir_prog; + + +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); /* Creates a new ir_prog, returns it and sets irp with it. - Automatically called by init_firm through init_prog. */ + Automatically called by init_firm through init_irprog. */ ir_prog *new_ir_prog (void); - -/** Functions to access the fields of ir_prog **/ -type_class *get_glob_type(void); +/* Access the main routine of the compiled program. */ +ir_graph *get_irp_main_irg(); +void set_irp_main_irg(ir_graph *main_irg); /* Adds irg to the list of ir graphs in irp. */ void add_irp_irg(ir_graph *irg); +int get_irp_n_irgs(); +ir_graph *get_irp_irg(int pos); +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); + +#ifdef DEBUG_libfirm +/* Returns a new, unique number to number nodes or the like. */ +int get_irp_new_node_nr(); +#endif #endif /* ifndef _IRPROG_H_ */