From 95c08e37872da325bb785ee4832f5cc4709c2860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinbrink?= Date: Thu, 2 Jul 2015 18:11:24 +0200 Subject: [PATCH] Skip the pointless tupling/untupling of argument types in trans_closure The tupling only happens for actual closures, same for the untupling. The only code that actually sees the tupled types is some debugging output for which it is actually rather confusing to have the types tupled, because neither the function signature in Rust nor the function signature for LLVM has them tupled. --- src/librustc_trans/trans/base.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index 156d591b909f..37302ceb6139 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -1578,16 +1578,6 @@ pub fn trans_closure<'a, 'b, 'tcx>(ccx: &CrateContext<'a, 'tcx>, decl.inputs.iter() .map(|arg| node_id_type(bcx, arg.id)) .collect::>(); - let monomorphized_arg_types = match closure_env { - closure::ClosureEnv::NotClosure => { - monomorphized_arg_types - } - - // Tuple up closure argument types for the "rust-call" ABI. - closure::ClosureEnv::Closure(_) => { - vec![ccx.tcx().mk_tup(monomorphized_arg_types)] - } - }; for monomorphized_arg_type in &monomorphized_arg_types { debug!("trans_closure: monomorphized_arg_type: {:?}", monomorphized_arg_type); @@ -1600,8 +1590,7 @@ pub fn trans_closure<'a, 'b, 'tcx>(ccx: &CrateContext<'a, 'tcx>, create_datums_for_fn_args_under_call_abi(bcx, arg_scope, &monomorphized_arg_types[..]) } _ => { - let arg_tys = untuple_arguments_if_necessary(ccx, &monomorphized_arg_types, abi); - create_datums_for_fn_args(bcx, &arg_tys) + create_datums_for_fn_args(bcx, &monomorphized_arg_types) } };