#include "irprog.h"
#include "pseudo_irg.h"
#include "type_t.h"
+#include "entity_t.h"
#include "typegmod.h"
#include "tr_inheritance.h"
every time someone walks through
the graph */
unsigned long block_visited; /**< same as visited, for a complete block */
+ unsigned estimated_node_count; /**< estimated number of nodes in this graph,
+ updated after every walk */
+#if FIRM_EDGES_INPLACE
+ irg_edge_info_t edge_info; /**< edge info for automatic outs */
+#endif
#ifdef DEBUG_libfirm
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
};
/**
* Initializes the graph construction module
*/
-void init_irgraph(void);
+void firm_init_irgraph(void);
/* Internal constructor that does not add to irp_irgs or the like. */
ir_graph *new_r_ir_graph (entity *ent, int n_loc);
static INLINE unsigned
_get_irg_additional_properties(const ir_graph *irg) {
+ if (irg->additional_properties & mtp_property_inherited)
+ return get_method_additional_properties(get_entity_type(irg->ent));
return irg->additional_properties;
}
static INLINE void
_set_irg_additional_properties(ir_graph *irg, unsigned mask) {
- irg->additional_properties = mask;
+ /* do not allow to set the mtp_property_inherited flag or
+ * the automatic inheritance of flags will not work */
+ irg->additional_properties = mask & ~mtp_property_inherited;
}
static INLINE void
-_set_irg_additional_property(ir_graph *irg, irg_additional_property flag) {
- irg->additional_properties |= flag;
+_set_irg_additional_property(ir_graph *irg, mtp_additional_property flag) {
+ unsigned prop = irg->additional_properties;
+
+ if (prop & mtp_property_inherited)
+ prop = get_method_additional_properties(get_entity_type(irg->ent));
+ irg->additional_properties = prop | flag;
}
static INLINE void
++irg->block_visited;
}
+static INLINE unsigned
+_get_irg_estimated_node_cnt(const ir_graph *irg) {
+ return irg->estimated_node_count;
+}
+
#define get_interprocedural_view() _get_interprocedural_view()
#define is_ir_graph(thing) _is_ir_graph(thing)
#define get_irg_start_block(irg) _get_irg_start_block(irg)
#define get_irg_block_visited(irg) _get_irg_block_visited(irg)
#define set_irg_block_visited(irg, v) _set_irg_block_visited(irg, v)
#define inc_irg_block_visited(irg) _inc_irg_block_visited(irg)
+#define get_irg_estimated_node_cnt(irg) _get_irg_estimated_node_cnt(irg)
# endif /* _IRGRAPH_T_H_ */