-#include "irprog.h"
-#include "irgraph.h"
-#include "ircgcons.h"
-#include "firm_common_t.h"
-
-
-/** ir_prog */
-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 *glob_type; /**< global type. Must be a class as it can
- have fields and procedures. */
- type **types; /**< all types in the ir */
- ir_graph *const_code_irg; /**< This ir graph gives the proper environment
- to allocate nodes the represent values
- of constant entities. It is not meant as
- a procedure. */
-
- irg_outs_state outs_state; /**< Out edges. */
- ir_node **ip_outedges; /**< Huge Array that contains all out edges
- in interprocedural view. */
- ip_view_state ip_view; /**< State of interprocedural view. */
- ident *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
-};
+#include "array.h"
+
+/** Adds mode to the list of modes in irp. */
+void add_irp_mode(ir_mode *mode);
+
+/* inline functions */
+static inline ir_type *_get_segment_type(ir_segment_t segment)
+{
+ assert(segment <= IR_SEGMENT_LAST);
+ return irp->segment_types[segment];
+}
+
+static inline ir_type *_get_glob_type(void)
+{
+ return _get_segment_type(IR_SEGMENT_GLOBAL);
+}
+
+static inline ir_type *_get_tls_type(void)
+{
+ return _get_segment_type(IR_SEGMENT_THREAD_LOCAL);
+}
+
+static inline size_t _get_irp_n_irgs(void)
+{
+ assert(irp && irp->graphs);
+ return ARR_LEN(irp->graphs);
+}
+
+static inline ir_graph *_get_irp_irg(size_t pos)
+{
+ assert(pos < ARR_LEN(irp->graphs));
+ return irp->graphs[pos];
+}
+
+static inline size_t _get_irp_n_types(void)
+{
+ assert(irp && irp->types);
+ return ARR_LEN(irp->types);
+}
+
+static inline ir_type *_get_irp_type(size_t pos)
+{
+ assert(irp->types);
+ assert(pos < ARR_LEN(irp->types));
+ /* Don't set the skip_tid result so that no double entries are generated. */
+ return irp->types[pos];
+}
+
+static inline size_t _get_irp_n_modes(void)
+{
+ assert(irp->modes);
+ return ARR_LEN(irp->modes);
+}