added function for convertion debug info
[libfirm] / ir / ir / irgraph_t.h
index 7739f07..3d29819 100644 (file)
 #include "irtypeinfo.h"
 #include "irprog.h"
 #include "pseudo_irg.h"
+#include "type_t.h"
+#include "tr_inheritance.h"
 
 #include "irloop.h"
+#include "execution_frequency.h"
 
 #include "obst.h"
 #include "pset.h"
-#include "type_t.h"
+#include "set.h"
 
 #define FRAME_TP_SUFFIX "frame_tp"
 
+/**
+ * Edge info to put into an irg.
+ */
+typedef struct _irg_edge_info_t {
+       set *edges;
+       unsigned activated : 1;
+} irg_edge_info_t;
+
+
 /** ir_graph holds all information for a procedure */
 struct ir_graph {
   firm_kind         kind;            /**<  always set to k_ir_graph*/
@@ -55,36 +67,40 @@ struct ir_graph {
   struct ir_node *cstore;        /**< constant store -- no more needed!! */
   struct ir_node *frame;         /**< method's frame */
   struct ir_node *globals;       /**< pointer to the data segment containing all
-                    globals as well as global procedures. */
+                                      globals as well as global procedures. */
   struct ir_node *initial_mem;   /**< initial memory of this graph */
   struct ir_node *args;          /**< methods arguments */
-  struct ir_node **proj_args;          /**< projs off the methods arguments */
+  struct ir_node **proj_args;    /**< projs of the methods arguments */
   struct ir_node *bad;           /**< bad node of this ir_graph, the one and
                     only in this graph */
   struct ir_node *no_mem;        /**< NoMem node of this ir_graph, the one and
-                    only in this graph */
+                                      only in this graph */
   /* GL removed: we need unknown with mode for analyses. */
   /*   struct ir_node *unknown;*/           /**< unknown node of this ir_graph */
   struct obstack *obst;          /**< obstack where all of the ir_nodes live */
-  struct ir_node *current_block;     /**< block for newly gen_*()-erated
-                    ir_nodes */
+  struct ir_node *current_block; /**< block for newly gen_*()-erated ir_nodes */
+  struct obstack *extbb_obst;    /**< obstack for extended basic block info */
 
   /* -- Fields indicating different states of irgraph -- */
   irg_phase_state phase_state;       /**< compiler phase */
   op_pin_state op_pin_state_pinned;  /**< Flag for status of nodes */
   irg_outs_state outs_state;         /**< Out edges. */
   irg_dom_state dom_state;           /**< Dominator information */
-  irg_typeinfo_state typeinfo_state;       /**< Validity of type information */
+  ir_typeinfo_state typeinfo_state;        /**< Validity of type information */
   irg_callee_info_state callee_info_state; /**< Validity of callee information */
   irg_inline_property inline_property;     /**< How to handle inlineing. */
   irg_loopinfo_state loopinfo_state;       /**< state of loop information */
+  exec_freq_state   execfreq_state;        /**< state of execution frequency information */
+  ir_class_cast_state class_cast_state;    /**< kind of cast operations in code. */
+  irg_extblk_info_state extblk_state;      /**< state of extended basic block info */
 
   /* -- Fields for construction -- */
 #if USE_EXPLICIT_PHI_IN_STACK
   struct Phi_in_stack *Phi_in_stack; /**< needed for automatic Phi construction */
 #endif
   int n_loc;                         /**< number of local variable in this
-                    procedure including procedure parameters. */
+                                          procedure including procedure parameters. */
+  void **loc_descriptions;           /**< storage for local variable desriptions */
 
   /* -- Fields for optimizations / analysis information -- */
   pset *value_table;                 /**< hash table for global value numbering (cse)
@@ -92,7 +108,7 @@ struct ir_graph {
   struct ir_node **outs;             /**< Space for the out arrays. */
 
 #ifdef DEBUG_libfirm
-  int             n_outs;            /* < Size wasted for outs */
+  int             n_outs;            /**< Size wasted for outs */
 #endif /* defined DEBUG_libfirm */
   struct ir_loop *loop;              /**< The outermost loop */
   void *link;                        /**< A void* field to link any information to
@@ -102,8 +118,10 @@ struct ir_graph {
   unsigned char *caller_isbe;        /**< For callgraph analysis: set if backedge. */
   ir_graph **callees;                /**< For callgraph analysis. */
   unsigned char *callee_isbe;        /**< For callgraph analysis: set if backedge. */
-  int        callgraph_loop_depth;
-  int        callgraph_recursion_depth;
+  int        callgraph_loop_depth;         /**< For callgraph analysis */
+  int        callgraph_recursion_depth;    /**< For callgraph analysis */
+  double     method_execution_frequency;   /**< For callgraph analysis */
+
   ir_loop   *l;
 
   /* -- Fields for Walking the graph -- */
@@ -116,6 +134,10 @@ struct ir_graph {
   int graph_nr;             /**< a unique graph number for each graph to make output
                    readable. */
 #endif
+
+#if FIRM_EDGES_INPLACE
+  irg_edge_info_t edge_info;  /**< edge info for automatic outs */
+#endif
 };
 
 /**
@@ -357,7 +379,8 @@ _get_irg_outs_state(const ir_graph *irg) {
 
 static INLINE void
 _set_irg_outs_inconsistent(ir_graph *irg) {
-  irg->outs_state = outs_inconsistent;
+  if (irg->outs_state == outs_consistent)
+    irg->outs_state = outs_inconsistent;
 }
 
 static INLINE irg_dom_state
@@ -380,6 +403,11 @@ _set_irg_loopinfo_state(ir_graph *irg, irg_loopinfo_state s) {
   irg->loopinfo_state = s;
 }
 
+static INLINE void
+_set_irg_loopinfo_inconsistent(ir_graph *irg) {
+  irg->loopinfo_state &= ~loopinfo_valid;
+}
+
 static INLINE void
 _set_irg_pinned(ir_graph *irg, op_pin_state p) {
   irg->op_pin_state_pinned = p;
@@ -484,6 +512,7 @@ _inc_irg_block_visited(ir_graph *irg) {
 #define set_irg_dom_inconsistent(irg)      _set_irg_dom_inconsistent(irg)
 #define get_irg_loopinfo_state(irg)        _get_irg_loopinfo_state(irg)
 #define set_irg_loopinfo_state(irg, s)     _set_irg_loopinfo_state(irg, s)
+#define set_irg_loopinfo_inconsistent(irg) _set_irg_loopinfo_inconsistent(irg)
 #define set_irg_pinned(irg, p)             _set_irg_pinned(irg, p)
 #define get_irg_callee_info_state(irg)     _get_irg_callee_info_state(irg)
 #define set_irg_callee_info_state(irg, s)  _set_irg_callee_info_state(irg, s)