Changed phase node initializer to take const ir_node
[libfirm] / ir / ir / irtypes.h
index 28b80ae..461300a 100644 (file)
 #include "irmemory.h"
 #include "callgraph.h"
 #include "field_temperature.h"
+#include "irphases_t.h"
 
 #include "pset.h"
 #include "set.h"
 #include "list.h"
 
+struct ir_phase;
+
 /** The type of an ir_op. */
 struct ir_op {
        unsigned code;          /**< The unique opcode of the op. */
@@ -53,6 +56,7 @@ struct ir_op {
        int op_index;           /**< The index of the first data operand, 0 for most cases, 1 for Div etc. */
        unsigned flags;         /**< Flags describing the behavior of the ir_op, a bitmasks of irop_flags. */
        void *tag;              /**< Some custom pointer the op's creator can attach stuff to. */
+       void *attr;             /**< custom pointer where op's creator can attach attribute stuff to. */
 
        ir_op_ops ops;          /**< The operations of the this op. */
 };
@@ -132,10 +136,8 @@ typedef struct {
        ir_node ** in_cg;           /**< array with predecessors in
                                     * interprocedural_view, if they differ
                                     * from intraprocedural predecessors */
-       int *backedge;              /**< Field n set to true if pred n is backedge.
-                                        @@@ @todo Ev. replace by bit field! */
-       int *cg_backedge;           /**< Field n set to true if pred n is interprocedural backedge.
-                                        @@@ @todo Ev. replace by bit field! */
+       unsigned *backedge;         /**< Raw Bitfield n set to true if pred n is backedge.*/
+       unsigned *cg_backedge;      /**< Raw Bitfield n set to true if pred n is interprocedural backedge. */
        ir_extblk *extblk;          /**< The extended basic block this block belongs to. */
        ir_region *region;          /**< The immediate structural region this block belongs to. */
        unsigned mb_depth;          /**< The macroblock depth: A distance from the macroblock header */
@@ -208,9 +210,8 @@ typedef struct {
 /** Filter attributes. */
 typedef struct {
        long proj;                 /**< contains the result position to project (Proj) */
-       ir_node ** in_cg;          /**< array with interprocedural predecessors (Phi) */
-       int *backedge;             /**< Field n set to true if pred n is backedge.
-                                       @todo Ev. replace by bitfield! */
+       ir_node **in_cg;           /**< array with interprocedural predecessors (Phi) */
+       unsigned *backedge;        /**< Raw Bitfield n set to true if pred n is backedge. */
 } filter_attr;
 
 /** CallBegin attributes. */
@@ -300,9 +301,8 @@ typedef union {
        load_attr      load;          /**< For Load. */
        store_attr     store;         /**< For Store. */
        phi0_attr      phi0;          /**< for Phi0 nodes. */
-       int            *phi_backedge; /**< For Phi after construction.
-                                          Field n set to true if pred n is backedge.
-                                          @todo Ev. replace by bitfield! */
+       unsigned       *phi_backedge; /**< For Phi after construction.
+                                          Raw Bitfield n set to true if pred n is backedge. */
        long           proj;          /**< For Proj: contains the result position to project */
        confirm_attr   confirm;       /**< For Confirm: compare operation and region. */
        filter_attr    filter;        /**< For Filter */
@@ -345,8 +345,8 @@ struct ir_node {
        struct dbg_info *dbi;    /**< A pointer to information for debug support. */
        /* ------- For debugging ------- */
 #ifdef DEBUG_libfirm
-       unsigned flags;
-       int out_valid;
+       unsigned out_valid : 1;
+       unsigned flags     : 31;
        long node_nr;            /**< A unique node number for each node to make output
                                      readable. */
 #endif
@@ -415,8 +415,7 @@ struct ir_graph {
                                            class it belongs to. */
        ir_type *frame_type;           /**< A class type representing the stack frame.
                                            Can include "inner" methods. */
-       ir_node *anchor;               /**< The anchor node. */
-       ir_node **proj_args;           /**< Projs of the methods arguments. */
+       ir_node *anchor;               /**< Pointer to the anchor node of this graph. */
        struct obstack *obst;          /**< The obstack where all of the ir_nodes live. */
        ir_node *current_block;        /**< Current block for newly gen_*()-erated ir_nodes. */
        struct obstack *extbb_obst;    /**< The obstack for extended basic block info. */
@@ -461,9 +460,9 @@ struct ir_graph {
                                                the node. */
 
        ir_graph **callers;                /**< For callgraph analysis: list of caller graphs. */
-       unsigned char *caller_isbe;        /**< For callgraph analysis: set if backedge. */
+       unsigned *caller_isbe;             /**< For callgraph analysis: raw bitset if backedge info calculated. */
        cg_callee_entry **callees;         /**< For callgraph analysis: list of callee calls */
-       unsigned char *callee_isbe;        /**< For callgraph analysis: set if backedge. */
+       unsigned *callee_isbe;             /**< For callgraph analysis: raw bitset if backedge info calculated. */
        int        callgraph_loop_depth;         /**< For callgraph analysis */
        int        callgraph_recursion_depth;    /**< For callgraph analysis */
        double     method_execution_frequency;   /**< For callgraph analysis */
@@ -482,10 +481,12 @@ struct ir_graph {
        irg_edges_info_t edge_info;        /**< edge info for automatic outs */
        ir_node **idx_irn_map;             /**< Array mapping node indexes to nodes. */
 
+       int index;                         /**< a unique number for each graph */
+       ir_phase *phases[PHASE_LAST];      /**< Phase information. */
 #ifdef DEBUG_libfirm
-       int             n_outs;            /**< Size wasted for outs */
-       long graph_nr;                     /**< a unique graph number for each graph to make output
-                                               readable. */
+       int   n_outs;                      /**< Size wasted for outs */
+       long graph_nr;                     /**< a unique graph number for each
+                                               graph to make output readable. */
 #endif
 
 #ifndef NDEBUG
@@ -539,18 +540,16 @@ struct ir_prog {
        double max_method_execution_frequency;  /**< needed in callgraph. */
        irp_temperature_state temperature_state; /**< accumulated temperatures computed? */
        exec_freq_state execfreq_state;      /**< The state of execution frequency information */
-#ifdef INTERPROCEDURAL_VIEW
        loop_nesting_depth_state lnd_state;  /**< The state of loop nesting depth information. */
-#endif
        ir_class_cast_state class_cast_state;    /**< The state of cast operations in code. */
        ir_address_taken_computed_state globals_adr_taken_state;  /**< Address taken state of the globals. */
 
        ir_exc_region_t last_region_nr;      /**< The last exception region number that was assigned. */
        ir_label_t last_label_nr;            /**< The highest label number for generating unique labels. */
+       int  max_irg_idx;                    /**< highest unused irg index */
 #ifdef DEBUG_libfirm
        long max_node_nr;                    /**< to generate unique numbers for nodes. */
 #endif
 };
 
-
 #endif