about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-03-02 03:54:14 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-03-02 03:54:14 +0530
commitd9b352fdc1d8960d00efde768b66f9af486db6c2 (patch)
tree367505a751d84b062e25d4ccd6b2fc465b647311
parent644b931437402d9e27606923bda4f63b7365d516 (diff)
parent708c3858e3e98d1b362b73510aa48416c3f68e51 (diff)
downloadrust-d9b352fdc1d8960d00efde768b66f9af486db6c2.tar.gz
rust-d9b352fdc1d8960d00efde768b66f9af486db6c2.zip
Rollup merge of #22923 - dotdash:trans_arg, r=eddyb
 The logic for the argument translation was duplicated here.
-rw-r--r--src/librustc_trans/trans/callee.rs21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/librustc_trans/trans/callee.rs b/src/librustc_trans/trans/callee.rs
index 4f234fac9a4..78bfcdb7d3f 100644
--- a/src/librustc_trans/trans/callee.rs
+++ b/src/librustc_trans/trans/callee.rs
@@ -927,20 +927,21 @@ fn trans_args_under_call_abi<'blk, 'tcx>(
                                                           tuple_expr.id));
             let repr = adt::represent_type(bcx.ccx(), tuple_type);
             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(
                     bcx,
-                    field_types[i],
+                    field_type,
                     |srcval| {
                         adt::trans_field_ptr(bcx, repr_ptr, srcval, 0, i)
-                    });
-                let arg_datum = arg_datum.to_expr_datum();
-                let arg_datum =
-                    unpack_datum!(bcx, arg_datum.to_rvalue_datum(bcx, "arg"));
-                let arg_datum =
-                    unpack_datum!(bcx, arg_datum.to_appropriate_datum(bcx));
-                llargs.push(arg_datum.add_clean(bcx.fcx, arg_cleanup_scope));
-            }
+                    }).to_expr_datum();
+                unpack_result!(bcx, trans_arg_datum(
+                    bcx,
+                    field_type,
+                    arg_datum,
+                    arg_cleanup_scope,
+                    DontAutorefArg)
+                )
+            }));
         }
         _ => {
             bcx.sess().span_bug(tuple_expr.span,