Fixed some obviously wrong conditions.
[libfirm] / ir / opt / return.c
index 796baeb..55bde8a 100644 (file)
@@ -30,6 +30,7 @@
 #include "ircons_t.h"
 #include "irnode_t.h"
 #include "irgmod.h"
+#include "irpass.h"
 
 #define set_bit(n)      (returns[(n) >> 3] |= 1 << ((n) & 7))
 #define get_bit(n)      (returns[(n) >> 3] & (1 << ((n) & 7)))
@@ -166,6 +167,12 @@ void normalize_one_return(ir_graph *irg) {
        set_irg_loopinfo_inconsistent(irg);
 }
 
+/* Create a graph pass. */
+ir_graph_pass_t *normalize_one_return_pass(const char *name)
+{
+       return def_graph_pass(name ? name : "one_ret", normalize_one_return);
+}
+
 /**
  * Check, whether a Return can be moved on block upwards.
  *
@@ -373,3 +380,9 @@ void normalize_n_returns(ir_graph *irg) {
        set_irg_outs_inconsistent(irg);
        set_irg_loopinfo_inconsistent(current_ir_graph);
 }
+
+/* Create a graph pass. */
+ir_graph_pass_t *normalize_n_returns_pass(const char *name)
+{
+       return def_graph_pass(name ? name : "n_rets", normalize_n_returns);
+}