-#if 0 /* old. now better, correcter, faster implementation. */
- if (n_exc > 0) {
- /* -- If the exception control flow from the inlined Call directly
- branched to the end block we now have the following control
- flow predecessor pattern: ProjX -> Tuple -> Jmp. We must
- remove the Jmp along with it's empty block and add Jmp's
- predecessors as predecessors of this end block. No problem if
- there is no exception, because then branches Bad to End which
- is fine. --
- @@@ can't we know this beforehand: by getting the Proj(1) from
- the Call link list and checking whether it goes to Proj. */
- /* find the problematic predecessor of the end block. */
- end_bl = get_irg_end_block(current_ir_graph);
- for (i = 0; i < get_Block_n_cfgpreds(end_bl); i++) {
- cf_op = get_Block_cfgpred(end_bl, i);
- if (get_irn_op(cf_op) == op_Proj) {
- cf_op = get_Proj_pred(cf_op);
- if ((get_irn_op(cf_op) == op_Tuple) && (cf_op == call)) {
- /* There are unoptimized tuples from inlineing before when no exc */
- assert(get_Proj_proj(get_Block_cfgpred(end_bl, i)) == pn_Call_X_except);
- cf_op = get_Tuple_pred(cf_op, pn_Call_X_except);
- assert(get_irn_op(cf_op) == op_Jmp);
- break;
- }
- }
- }
- /* repair */
- if (i < get_Block_n_cfgpreds(end_bl)) {
- bl = get_nodes_block(cf_op);
- arity = get_Block_n_cfgpreds(end_bl) + get_Block_n_cfgpreds(bl) - 1;
- cf_pred = xmalloc (arity * sizeof(*cf_pred));
- for (j = 0; j < i; j++)
- cf_pred[j] = get_Block_cfgpred(end_bl, j);
- for (j = j; j < i + get_Block_n_cfgpreds(bl); j++)
- cf_pred[j] = get_Block_cfgpred(bl, j-i);
- for (j = j; j < arity; j++)
- cf_pred[j] = get_Block_cfgpred(end_bl, j-get_Block_n_cfgpreds(bl) +1);
- set_irn_in(end_bl, arity, cf_pred);
- free(cf_pred);
- /* Remove the exception pred from post-call Tuple. */
- set_Tuple_pred(call, pn_Call_X_except, new_Bad());
- }
- }
-#endif
-