3 * File name: ir/ir/irprog_t.h
4 * Purpose: Entry point to the representation of a whole program 0-- private header.
5 * Author: Goetz Lindenmaier
9 * Copyright: (c) 2000-2003 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
27 #include "firm_common_t.h"
35 ir_graph *main_irg; /**< entry point to the compiled program
36 @@@ or a list, in case we compile a library or the like? */
37 ir_graph **graphs; /**< all graphs in the ir */
38 type *glob_type; /**< global type. Must be a class as it can
39 have fields and procedures. */
40 type **types; /**< all types in the ir */
41 ir_graph *const_code_irg; /**< This ir graph gives the proper environment
42 to allocate nodes the represent values
43 of constant entities. It is not meant as
46 irg_outs_state outs_state; /**< Out edges. */
47 ir_node **ip_outedges; /**< Huge Array that contains all out edges
48 in interprocedural view. */
49 ip_view_state ip_view; /**< State of interprocedural view. */
51 /*struct obstack *obst; * @@@ Should we place all types and
52 entities on an obstack, too? */
55 long max_node_nr; /**< to generate unique numbers for nodes. */
59 INLINE void remove_irp_type_from_list (type *typ);
62 __get_glob_type(void) {
64 return irp->glob_type = skip_tid(irp->glob_type);
68 __get_irp_n_irgs(void) {
69 assert (irp && irp->graphs);
70 /* Strangely the first element of the array is NULL. Why?? */
71 return (ARR_LEN((irp)->graphs));
74 static INLINE ir_graph *
75 __get_irp_irg(int pos){
76 assert (irp && irp->graphs);
77 /* Strangely the first element of the array is NULL. Why?? */
78 return irp->graphs[pos];
83 __get_irp_n_types (void) {
84 assert (irp && irp->types);
85 /* Strangely the first element of the array is NULL. Why?? */
86 return (ARR_LEN((irp)->types));
90 __get_irp_type(int pos) {
91 assert (irp && irp->types);
92 /* Strangely the first element of the array is NULL. Why?? */
93 /* Don't set the skip_tid result so that no double entries are generated. */
94 return skip_tid(irp->types[pos]);
98 /** Returns a new, unique number to number nodes or the like. */
99 int get_irp_new_node_nr(void);
102 static INLINE ir_graph *
103 __get_const_code_irg(void)
105 return irp->const_code_irg;
108 void set_irp_ip_outedges(ir_node ** ip_outedges);
109 ir_node** get_irp_ip_outedges(void);
111 #define get_irp_n_irgs() __get_irp_n_irgs()
112 #define get_irp_irg(pos) __get_irp_irg(pos)
113 #define get_irp_n_types() __get_irp_n_types()
114 #define get_irp_type(pos) __get_irp_type(pos)
115 #define get_const_code_irg() __get_const_code_irg()
116 #define get_glob_type() __get_glob_type()
118 #endif /* ifndef _IRPROG_T_H_ */