- /* Cleanup, verify the graph. */
- ir_free_resources(irg, resources);
+/**
+ * Wrapper to run ir_lower_mux() as an ir_graph pass
+ */
+static int pass_wrapper(ir_graph *irg, void *context)
+{
+ pass_t *pass = (pass_t*)context;
+
+ lower_mux(irg, pass->cb_func);
+ return 0;
+}
+
+ir_graph_pass_t *lower_mux_pass(const char *name, lower_mux_callback *cb_func)
+{
+ pass_t *pass = XMALLOCZ(pass_t);