Use trans_arg_datum in trans_args_under_call_abi
The logic for the argument translation was duplicated here.
This commit is contained in:
parent
41f8b1e89b
commit
708c3858e3
1 changed files with 11 additions and 10 deletions
|
@ -927,20 +927,21 @@ fn trans_args_under_call_abi<'blk, 'tcx>(
|
||||||
tuple_expr.id));
|
tuple_expr.id));
|
||||||
let repr = adt::represent_type(bcx.ccx(), tuple_type);
|
let repr = adt::represent_type(bcx.ccx(), tuple_type);
|
||||||
let repr_ptr = &*repr;
|
let repr_ptr = &*repr;
|
||||||
for i in 0..field_types.len() {
|
llargs.extend(field_types.iter().enumerate().map(|(i, field_type)| {
|
||||||
let arg_datum = tuple_lvalue_datum.get_element(
|
let arg_datum = tuple_lvalue_datum.get_element(
|
||||||
bcx,
|
bcx,
|
||||||
field_types[i],
|
field_type,
|
||||||
|srcval| {
|
|srcval| {
|
||||||
adt::trans_field_ptr(bcx, repr_ptr, srcval, 0, i)
|
adt::trans_field_ptr(bcx, repr_ptr, srcval, 0, i)
|
||||||
});
|
}).to_expr_datum();
|
||||||
let arg_datum = arg_datum.to_expr_datum();
|
unpack_result!(bcx, trans_arg_datum(
|
||||||
let arg_datum =
|
bcx,
|
||||||
unpack_datum!(bcx, arg_datum.to_rvalue_datum(bcx, "arg"));
|
field_type,
|
||||||
let arg_datum =
|
arg_datum,
|
||||||
unpack_datum!(bcx, arg_datum.to_appropriate_datum(bcx));
|
arg_cleanup_scope,
|
||||||
llargs.push(arg_datum.add_clean(bcx.fcx, arg_cleanup_scope));
|
DontAutorefArg)
|
||||||
}
|
)
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
bcx.sess().span_bug(tuple_expr.span,
|
bcx.sess().span_bug(tuple_expr.span,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue