+/**
+ * Do the necessary graph transformations to transform
+ * Call nodes.
+ */
+static void transform_alloc_calls(ir_graph *irg, walk_env_t *env)
+{
+ ir_node *call, *next, *mem, *size;
+ ir_type *ftp, *atp, *tp;
+
+ /* kill all dead allocs */
+ for (call = env->dead_allocs; call; call = next) {
+ next = get_irn_link(call);
+
+ DBG((dbgHandle, LEVEL_1, "%+F allocation of %+F unused, deleted.\n", irg, call));
+
+ mem = get_Call_mem(call);
+ turn_into_tuple(call, pn_Call_max);
+ set_Tuple_pred(call, pn_Call_M_regular, mem);
+ set_Tuple_pred(call, pn_Call_X_except, new_r_Bad(irg));
+ set_Tuple_pred(call, pn_Call_T_result, new_r_Bad(irg));
+ set_Tuple_pred(call, pn_Call_M_except, mem);
+ set_Tuple_pred(call, pn_Call_P_value_res_base, new_r_Bad(irg));
+
+ ++env->nr_deads;
+ }
+
+ /* convert all non-escaped heap allocs into frame variables */
+ ftp = get_irg_frame_type(irg);
+ for (call = env->found_allocs; call; call = next) {
+ next = get_irn_link(call);
+ }
+}
+
+