Skip to content

Commit 03482dc

Browse files
committed
---
yaml --- r: 48812 b: refs/heads/snap-stage3 c: e821671 h: refs/heads/master v: v3
1 parent 3a0a14a commit 03482dc

File tree

4 files changed

+27
-55
lines changed

4 files changed

+27
-55
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 14df8447445440794d363f6dc3fbb5220bb0a775
4+
refs/heads/snap-stage3: e82167198900a8d592535f40307f7c3a71b8b72b
55
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

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

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

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

499-
let llretslot = args_res.retslot;
500502

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

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

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

597-
// ... then explicit args.
589+
let mut bcx = cx;
598590

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

626-
Args { bcx: bcx, args: llargs, retslot: llretslot }
618+
return bcx;
627619
}
628620

629621
pub enum AutorefArg {

branches/snap-stage3/src/libsyntax/ext/expand.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,6 @@ pub fn core_macros() -> ~str {
456456
if !$cond {
457457
::core::sys::fail_assert(stringify!($cond), file!(), line!())
458458
}
459-
};
460-
($cond:expr, $msg:expr) => {
461-
if !$cond {
462-
::core::sys::fail_assert($msg, file!(), line!())
463-
}
464459
}
465460
)
466461

branches/snap-stage3/src/test/run-fail/issue-2761.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)