+/**
+ * Set the node data for an irn.
+ *
+ * @param phase The phase.
+ * @param irn The node.
+ * @param data The node data.
+ *
+ * @return The old data or NULL if there was none.
+ */
+static inline void *phase_set_irn_data(ir_phase *ph, const ir_node *irn,
+ void *data)
+{
+ unsigned idx = get_irn_idx(irn);
+ void *res;
+
+ /* Assure that there's a sufficient amount of slots. */
+ private_phase_assure_capacity(ph, idx + 1);
+
+ res = ph->data_ptr[idx];
+ ph->data_ptr[idx] = data;
+
+ return res;
+}
+
+/**
+ * convenience function that returns phase information attached to a node
+ */
+static inline void *get_irn_phase_info(const ir_node *irn, ir_phase_id id)
+{
+ const ir_graph *irg = get_irn_irg(irn);
+ const ir_phase *ph = irg_get_phase(irg, id);
+ return phase_get_irn_data(ph, irn);
+}
+
+/**
+ * Get or set information a phase holds about a node.
+ * If the given phase does not hold information of the node,
+ * the information structure will be created, initialized (see the data_init
+ * function of ir_phase), and returned.
+ * @param irn The node.
+ * @param id The ID of the phase.
+ */
+static inline void *get_or_set_irn_phase_info(const ir_node *irn, ir_phase_id id)
+{
+ const ir_graph *irg = get_irn_irg(irn);
+ ir_phase *ph = irg_get_phase(irg, id);
+ return phase_get_or_set_irn_data(ph, irn);
+}
+
+static inline void *set_irn_phase_info(const ir_node *irn, ir_phase_id id,
+ void *data)
+{
+ const ir_graph *irg = get_irn_irg(irn);
+ ir_phase *ph = irg_get_phase(irg, id);
+ return phase_set_irn_data(ph, irn, data);
+}