if (! is_Call(call))
continue;
+ /* the call must be in the same block as the return */
+ if (get_nodes_block(call) != get_nodes_block(ret))
+ continue;
+
/* check if it's a recursive call */
call_ptr = get_Call_ptr(call);
- if (get_irn_op(call_ptr) != op_SymConst)
- continue;
-
- if (get_SymConst_kind(call_ptr) != symconst_addr_ent)
+ if (! is_SymConst(call_ptr) || get_SymConst_kind(call_ptr) != symconst_addr_ent)
continue;
ent = get_SymConst_entity(call_ptr);
for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
irg = get_irp_irg(i);
+ current_ir_graph = irg;
+
if (opt_tail_rec_irg(irg))
++n_opt_applications;
}