*/
int optimize_graph_df(ir_graph *irg);
+/**
+ * Creates an ir_graph pass for optimize_graph_df().
+ *
+ * @param name the name of this pass or NULL
+ * @param verify should this pass be verified?
+ * @param dump should this pass result be dumped?
+ *
+ * @return the newly created ir_graph pass
+ */
+ir_graph_pass_t *optimize_graph_df_pass(const char *name, int verify, int dump);
+
/** Performs dead node elimination by copying the ir graph to a new obstack.
*
* The major intention of this pass is to free memory occupied by
#include "adt/pdeq.h"
+#include "irpass_t.h"
#include "irflag_t.h"
#include "iredges_t.h"
#include "irtools.h"
current_ir_graph = rem;
return changed;
}
+
+/**
+ * Wrapper for running optimize_graph_df() as an ir_graph pass.
+ */
+static int pass_wrapper(ir_graph *irg, void *context) {
+ (void)context;
+ return optimize_graph_df(irg);
+} /* pass_wrapper */
+
+/* Creates an ir_graph pass for optimize_graph_df. */
+ir_graph_pass_t *optimize_graph_df_pass(const char *name, int verify, int dump) {
+ struct ir_graph_pass_t *pass = XMALLOCZ(ir_graph_pass_t);
+
+ pass->kind = k_ir_prog_pass;
+ pass->run_on_irg = pass_wrapper;
+ pass->context = pass;
+ pass->name = name ? name : "optimize_graph_df";
+ pass->verify = verify != 0;
+ pass->dump = dump != 0;
+
+ INIT_LIST_HEAD(&pass->list);
+
+ return pass;
+} /* combo_pass */