anchor_end, /**< end node of this ir_graph */
anchor_end_reg, /**< end node of this ir_graph */
anchor_end_except, /**< end node of this ir_graph */
- anchor_cstore, /**< constant store -- no more needed!! */
anchor_frame, /**< method's frame */
anchor_globals, /**< pointer to the data segment containing all
globals as well as global procedures. */
ir_node *current_block; /**< block for newly gen_*()-erated ir_nodes */
struct obstack *extbb_obst; /**< obstack for extended basic block info */
+ unsigned last_node_idx; /**< last IR node index for this graph */
+
/* -- Fields for graph properties -- */
irg_inline_property inline_property; /**< How to handle inlineing. */
unsigned additional_properties; /**< additional graph properties. */
return irg->anchors[anchor_end_except];
}
-static INLINE ir_node *
-_get_irg_cstore(const ir_graph *irg) {
- return irg->anchors[anchor_cstore];
-}
-
-static INLINE void
-_set_irg_cstore(ir_graph *irg, ir_node *node) {
- irg->anchors[anchor_cstore] = node;
-}
-
static INLINE ir_node *
_get_irg_frame(const ir_graph *irg) {
return irg->anchors[anchor_frame];
++irg->block_visited;
}
+static INLINE void
+_dec_irg_block_visited(ir_graph *irg) {
+ --irg->block_visited;
+}
+
static INLINE unsigned
_get_irg_estimated_node_cnt(const ir_graph *irg) {
return irg->estimated_node_count;
}
+/**
+ * Returns the next IR node index for the given graph.
+ */
+static INLINE unsigned
+get_irg_next_node_idx(ir_graph *irg) {
+ return irg->last_node_idx++;
+}
+
+/**
+ * Kill a node from the irg. BEWARE: this kills
+ * all later created nodes.
+ */
+static INLINE void
+irg_kill_node(ir_graph *irg, ir_node *n) {
+ if (get_irn_idx(n) + 1 == irg->last_node_idx)
+ --irg->last_node_idx;
+ obstack_free(irg->obst, n);
+}
+
#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 set_irg_end(irg, node) _set_irg_end(irg, node)
#define get_irg_end_reg(irg) _get_irg_end_reg(irg)
#define get_irg_end_except(irg) _get_irg_end_except(irg)
-#define get_irg_cstore(irg) _get_irg_cstore(irg)
-#define set_irg_cstore(irg, node) _set_irg_cstore(irg, node)
#define get_irg_frame(irg) _get_irg_frame(irg)
#define set_irg_frame(irg, node) _set_irg_frame(irg, node)
#define get_irg_globals(irg) _get_irg_globals(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 dec_irg_block_visited(irg) _dec_irg_block_visited(irg)
#define get_irg_estimated_node_cnt(irg) _get_irg_estimated_node_cnt(irg)
# endif /* _IRGRAPH_T_H_ */