backend: put ignore regs into beirg
[libfirm] / ir / ir / irpass.c
index 935ad26..adc75a8 100644 (file)
@@ -31,7 +31,7 @@
 #include "irgraph_t.h"
 #include "irprog_t.h"
 #include "irdump.h"
-#include "irvrfy.h"
+#include "irverify.h"
 #include "xmalloc.h"
 
 /*Add a graph pass to a graph pass manager. */
@@ -134,7 +134,7 @@ void ir_prog_pass_mgr_add_graph_pass(
        /* not found, create a new wrapper */
        graph_mgr = new_graph_pass_mgr(
                "graph_pass_wrapper", mgr->verify_all, mgr->dump_all);
-       graph_mgr->run_idx = mgr->n_passes;
+       graph_mgr->run_idx = mgr->run_idx + mgr->n_passes;
 
        ir_graph_pass_mgr_add(graph_mgr, pass);
 
@@ -157,12 +157,9 @@ void ir_prog_pass_mgr_add_graph_mgr(
        ir_prog_pass_mgr_add(mgr, pass);
 }
 
-/**
- * Create a suffix for dumping.
- */
-void create_suffix(char *suffix, size_t n, const char *pass_name, unsigned index)
+static void create_suffix(char *suffix, size_t n, const char *pass_name)
 {
-       snprintf(suffix, n, "-%02u_%s", index, pass_name);
+       snprintf(suffix, n, "%s.svg", pass_name);
 }
 
 /* Run all passes of an ir_graph pass manager. */
@@ -194,9 +191,9 @@ int ir_graph_pass_mgr_run(ir_graph_pass_manager_t *mgr)
                                if (pass->dump_irg) {
                                        pass->dump_irg(irg, pass->context, idx);
                                } else {
-                                       char suffix[1024];
-                                       create_suffix(suffix, sizeof(suffix), pass->name, idx);
-                                       dump_ir_block_graph(irg, suffix);
+                                       char buf[1024];
+                                       create_suffix(buf, sizeof(buf), pass->name);
+                                       dump_ir_graph(irg, buf);
                                }
                        }
                        ++idx;
@@ -243,9 +240,9 @@ int ir_prog_pass_mgr_run(ir_prog_pass_manager_t *mgr)
                        if (pass->dump_irprog) {
                                pass->dump_irprog(irp, pass->context, idx);
                        } else {
-                               char suffix[1024];
-                               create_suffix(suffix, sizeof(suffix), pass->name, idx);
-                               dump_all_ir_graphs(dump_ir_block_graph, suffix);
+                               char buf[1024];
+                               create_suffix(buf, sizeof(buf), pass->name);
+                               dump_all_ir_graphs(buf);
                        }
                }
                if (pass->is_wrapper) {
@@ -337,7 +334,7 @@ void ir_graph_pass_mgr_set_run_idx(
  * @param mgr      the manager
  * @param run_idx  the index for the first pass of this manager
  */
-void ir_prog_pass_manager_set_run_idx(
+void ir_prog_pass_mgr_set_run_idx(
        ir_prog_pass_manager_t *mgr, unsigned run_idx)
 {
        mgr->run_idx = run_idx;
@@ -346,7 +343,8 @@ void ir_prog_pass_manager_set_run_idx(
 /**
  * Wrapper for running void function(ir_graph *irg) as an ir_graph pass.
  */
-static int void_graph_wrapper(ir_graph *irg, void *context) {
+static int void_graph_wrapper(ir_graph *irg, void *context)
+{
        void (*function)(ir_graph *irg) = context;
        function(irg);
        return 0;
@@ -371,7 +369,8 @@ ir_graph_pass_t *def_graph_pass(
 /**
  * Wrapper for running void function(ir_graph *irg) as an ir_graph pass.
  */
-static int int_graph_wrapper(ir_graph *irg, void *context) {
+static int int_graph_wrapper(ir_graph *irg, void *context)
+{
        int (*function)(ir_graph *irg) = context;
        return function(irg);
 }  /* int_graph_wrapper */
@@ -410,11 +409,17 @@ ir_graph_pass_t *def_graph_pass_constructor(
        return pass;
 }  /* def_graph_pass_constructor */
 
+/* set the run parallel property */
+void ir_graph_pass_set_parallel(ir_graph_pass_t *pass, int flag)
+{
+       pass->run_parallel = flag != 0;
+}  /* ir_graph_pass_set_parallel */
 
 /**
  * Wrapper for running void function(void) as an ir_prog pass.
  */
-static int void_prog_wrapper(ir_prog *irp, void *context) {
+static int void_prog_wrapper(ir_prog *irp, void *context)
+{
        void (*function)(void) = context;
 
        (void)irp;
@@ -469,7 +474,8 @@ struct pass_t {
 /**
  * Wrapper for the call_function pass.
  */
-static int call_function_wrapper(ir_prog *irp, void *context) {
+static int call_function_wrapper(ir_prog *irp, void *context)
+{
        struct pass_t *pass = context;
 
        (void)irp;