#include "config.h"
#endif
+#include "lowering.h"
#include "irprog_t.h"
#include "irnode_t.h"
#include "type_t.h"
#include "ircons.h"
#include "irgmod.h"
#include "irgwalk.h"
-#include "typewalk.h"
-#include "lower_calls.h"
-#include "return.h"
#include "irtools.h"
+#include "iroptimize.h"
#include "array.h"
#include "pmap.h"
#include "xmalloc.h"
int n_ress, n_params, nn_ress, nn_params, i, first_variadic;
ident *id;
add_hidden hidden_params;
+ int changed = 0;
variadicity var;
if (is_lowered_type(mtp)) {
address will be transmitted as a hidden parameter. */
ptr_tp = lp->find_pointer_type(res_tp, get_modeP_data(), lp->def_ptr_alignment);
params[nn_params++] = ptr_tp;
+ changed++;
if (lp->flags & LF_RETURN_HIDDEN)
results[nn_ress++] = ptr_tp;
}
set_method_first_variadic_param_index(lowered, first_variadic);
/* associate the lowered type with the original one for easier access */
+ if(changed) {
+ set_method_calling_convention(lowered,
+ get_method_calling_convention(mtp) | cc_compound_ret);
+ }
set_lowered_type(mtp, lowered);
return lowered;
*/
static void add_hidden_param(ir_graph *irg, int n_com, ir_node **ins, cl_entry *entry, wlk_env *env)
{
- ir_node *p, *n, *src, *mem;
+ ir_node *p, *n, *src, *mem, *blk;
ir_entity *ent;
ir_type *owner;
int idx, n_args;
ins[idx] = get_CopyB_dst(p);
mem = get_CopyB_mem(p);
+ blk = get_nodes_block(p);
/* get rid of the CopyB */
turn_into_tuple(p, pn_CopyB_max);
set_Tuple_pred(p, pn_CopyB_M_regular, mem);
- set_Tuple_pred(p, pn_CopyB_M_except, get_irg_bad(irg));
- set_Tuple_pred(p, pn_CopyB_X_except, get_irg_bad(irg));
+ set_Tuple_pred(p, pn_CopyB_M_except, get_irg_bad(irg));
+ set_Tuple_pred(p, pn_CopyB_X_regular, new_r_Jmp(irg, blk));
+ set_Tuple_pred(p, pn_CopyB_X_except, get_irg_bad(irg));
++n_args;
}