Skip to content

Commit a114df4

Browse files
committed
---
yaml --- r: 53985 b: refs/heads/dist-snap c: 99ac243 h: refs/heads/master i: 53983: 0b3e7b3 v: v3
1 parent 79d5a6e commit a114df4

File tree

2 files changed

+27
-35
lines changed

2 files changed

+27
-35
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: 0847d52a8677a39525b7cf7a09571851b6deb8b9
10+
refs/heads/dist-snap: 99ac243e7b789b54231e4607aa775174c7c3995a
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/middle/trans/callee.rs

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,14 @@ pub fn trans_call_inner(
492492
}
493493
};
494494

495-
let args_res = trans_args(bcx, llenv, args, fn_expr_ty,
496-
dest, ret_flag, autoref_arg);
497-
bcx = args_res.bcx;
498-
let mut llargs = /*bad*/copy args_res.args;
495+
let llretslot = trans_ret_slot(bcx, fn_expr_ty, dest);
496+
497+
let mut llargs = ~[];
498+
llargs.push(llretslot);
499+
llargs.push(llenv);
500+
bcx = trans_args(bcx, args, fn_expr_ty,
501+
ret_flag, autoref_arg, &mut llargs);
499502

500-
let llretslot = args_res.retslot;
501503

502504
// Now that the arguments have finished evaluating, we need to revoke
503505
// the cleanup for the self argument, if it exists
@@ -555,30 +557,12 @@ pub enum CallArgs {
555557
ArgVals(&'self [ValueRef])
556558
}
557559

558-
pub struct Args {
559-
bcx: block,
560-
args: ~[ValueRef],
561-
retslot: ValueRef
562-
}
563-
564-
pub fn trans_args(cx: block,
565-
llenv: ValueRef,
566-
+args: CallArgs,
567-
fn_ty: ty::t,
568-
dest: expr::Dest,
569-
ret_flag: Option<ValueRef>,
570-
+autoref_arg: AutorefArg) -> Args {
571-
let _icx = cx.insn_ctxt("trans_args");
572-
let mut temp_cleanups = ~[];
573-
let arg_tys = ty::ty_fn_args(fn_ty);
574-
let mut llargs: ~[ValueRef] = ~[];
575-
576-
let mut bcx = cx;
577-
560+
pub fn trans_ret_slot(+bcx: block,
561+
+fn_ty: ty::t,
562+
+dest: expr::Dest) -> ValueRef
563+
{
578564
let retty = ty::ty_fn_ret(fn_ty);
579-
580-
// Arg 0: Output pointer.
581-
let llretslot = match dest {
565+
match dest {
582566
expr::SaveIn(dst) => dst,
583567
expr::Ignore => {
584568
if ty::type_is_nil(retty) {
@@ -589,13 +573,21 @@ pub fn trans_args(cx: block,
589573
alloc_ty(bcx, retty)
590574
}
591575
}
592-
};
593-
llargs.push(llretslot);
576+
}
577+
}
594578

595-
// Arg 1: Env (closure-bindings / self value)
596-
llargs.push(llenv);
579+
pub fn trans_args(+cx: block,
580+
+args: CallArgs,
581+
+fn_ty: ty::t,
582+
+ret_flag: Option<ValueRef>,
583+
+autoref_arg: AutorefArg,
584+
+llargs: &mut ~[ValueRef]) -> block
585+
{
586+
let _icx = cx.insn_ctxt("trans_args");
587+
let mut temp_cleanups = ~[];
588+
let arg_tys = ty::ty_fn_args(fn_ty);
597589

598-
// ... then explicit args.
590+
let mut bcx = cx;
599591

600592
// First we figure out the caller's view of the types of the arguments.
601593
// This will be needed if this is a generic call, because the callee has
@@ -624,7 +616,7 @@ pub fn trans_args(cx: block,
624616
revoke_clean(bcx, *c)
625617
}
626618

627-
Args { bcx: bcx, args: llargs, retslot: llretslot }
619+
return bcx;
628620
}
629621

630622
pub enum AutorefArg {

0 commit comments

Comments
 (0)