}
/**
- * Datatype of the generic op handler for optimisation. If it exchanged node
- * with something else, then it must return the new node, otherwise NULL.
+ * Datatype of the generic op handler for optimisation.
*/
-typedef ir_node*(*peephole_opt_func) (ir_node *node);
+typedef void (*peephole_opt_func) (ir_node *node);
+
+/**
+ * must be called from peephole optimisations before a node is exchanged,
+ * so bepeephole can update it's internal state.
+ */
+void be_peephole_before_exchange(const ir_node *old_node, ir_node *new_node);
+
+/**
+ * must be called from peephole optimisations after a node is exchanged,
+ * so bepeephole can update it's internal state.
+ */
+void be_peephole_after_exchange(ir_node *new_node);
/**
* Do peephole optimisations. It traverses the schedule of all blocks in