- if (get_irn_idx(n) + 1 == irg->last_node_idx)
- --irg->last_node_idx;
- obstack_free(irg->obst, n);
+ unsigned idx = get_irn_idx(n);
+ if (idx + 1 == irg->last_node_idx)
+ --irg->last_node_idx;
+ irg->idx_irn_map[idx] = NULL;
+ obstack_free(irg->obst, n);
+}
+
+/**
+ * Get the node for an index.
+ * @param irg The graph.
+ * @param idx The index you want the node for.
+ * @return The node with that index or NULL, if there is no node with that index.
+ * @note The node you got might be dead.
+ */
+static INLINE ir_node *
+get_idx_irn(ir_graph *irg, unsigned idx) {
+ assert(idx < (unsigned) ARR_LEN(irg->idx_irn_map));
+ return irg->idx_irn_map[idx];