make verifier a bit less strict about keeps
[libfirm] / ir / opt / tailrec.c
index 5ca9549..11e9088 100644 (file)
@@ -46,6 +46,7 @@
 #include "trouts.h"
 #include "irouts.h"
 #include "irhooks.h"
+#include "ircons_t.h"
 #include "xmalloc.h"
 
 DEBUG_ONLY(static firm_dbg_module_t *dbg);
@@ -262,10 +263,7 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env) {
         * ok, we are here, so we have build and collected all needed Phi's
         * now exchange all Projs into links to Phi
         */
-       for (p = data.proj_m; p; p = n) {
-               n = get_irn_link(p);
-               exchange(p, phis[0]);
-       }
+       exchange(data.proj_m, phis[0]);
        for (p = data.proj_data; p; p = n) {
                long proj = get_Proj_proj(p);
 
@@ -631,10 +629,10 @@ int opt_tail_rec_irg(ir_graph *irg) {
                /* check if it's a recursive call */
                call_ptr = get_Call_ptr(call);
 
-               if (! is_SymConst_addr_ent(call_ptr))
+               if (! is_Global(call_ptr))
                        continue;
 
-               ent = get_SymConst_entity(call_ptr);
+               ent = get_Global_entity(call_ptr);
                if (!ent || get_entity_irg(ent) != irg)
                        continue;