rewrite vrp scanning to use a phase instead of attrs in ir_node
[libfirm] / include / libfirm / irpass.h
index 666f005..b1e3e0d 100644 (file)
@@ -118,6 +118,15 @@ int ir_prog_pass_mgr_run(ir_prog_pass_manager_t *mgr);
  */
 void term_prog_pass_mgr(ir_prog_pass_manager_t *mgr);
 
+/**
+ * Set the run index for an irgraph pass manager.
+ *
+ * @param mgr      the manager
+ * @param run_idx  the index for the first pass of this manager
+ */
+void ir_graph_pass_mgr_set_run_idx(
+       ir_graph_pass_manager_t *mgr, unsigned run_idx);
+
 /**
  * Creates an ir_graph pass for running void function(ir_graph *irg).
  * Uses the default verifier and dumper.
@@ -159,6 +168,16 @@ ir_graph_pass_t *def_graph_pass_constructor(
        ir_graph_pass_t *memory,
        const char *name, int (*function)(ir_graph *irg, void *context));
 
+/**
+ * Set the run_parallel property of a graph pass.
+ * If the flag is set to non-zero, the pass can be executed
+ * parallel on all graphs of a ir_prog.
+ *
+ * @param pass  the pass
+ * @param flag  new flag setting
+ */
+void ir_graph_pass_set_parallel(ir_graph_pass_t *pass, int flag);
+
 /**
  * Creates an ir_prog pass for running void function().
  * Uses the default verifier and dumper.
@@ -181,10 +200,32 @@ ir_prog_pass_t *def_prog_pass(
  * @param name      the name of this pass
  * @param function  the function to run
  *
- * @return  the newly created ir_graph pass
+ * @return  the newly created ir_prog pass
  */
 ir_prog_pass_t *def_prog_pass_constructor(
        ir_prog_pass_t *memory,
-       const char *name, void (*function)(ir_prog *irp, void *context));
+       const char *name, int (*function)(ir_prog *irp, void *context));
+
+/**
+ * Create a pass that calls some function.
+ * This pass calls the given function, but has no dump nor verify.
+ *
+ * @param name      the name of this pass
+ * @param function  the function to run
+ * @param context   context parameter
+ *
+ * @return  the newly created ir_prog pass
+ */
+ir_prog_pass_t *call_function_pass(
+       const char *name, void (*function)(void *context), void *context);
+
+/**
+ * Set the run index for an irprog pass manager.
+ *
+ * @param mgr      the manager
+ * @param run_idx  the index for the first pass of this manager
+ */
+void ir_prog_pass_mgr_set_run_idx(
+       ir_prog_pass_manager_t *mgr, unsigned run_idx);
 
 #endif