Skip to content

Commit 2428155

Browse files
committed
---
yaml --- r: 2453 b: refs/heads/master c: f627c2f h: refs/heads/master i: 2451: b6f06ad v: v3
1 parent 52823a4 commit 2428155

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 390ce40165e1052d675782812d8505064427ec51
2+
refs/heads/master: f627c2ff21405199bc59c8d388d9b25185465753

trunk/src/comp/middle/trans.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6160,28 +6160,24 @@ fn copy_any_self_to_alloca(@fn_ctxt fcx,
61606160
}
61616161

61626162

6163-
fn copy_args_to_allocas(@fn_ctxt fcx,
6163+
fn copy_args_to_allocas(@block_ctxt bcx,
61646164
vec[ast.arg] args,
61656165
vec[ty.arg] arg_tys) {
61666166

6167-
auto bcx = llallocas_block_ctxt(fcx);
6168-
61696167
let uint arg_n = 0u;
61706168

61716169
for (ast.arg aarg in args) {
61726170
if (aarg.mode != ast.alias) {
6173-
auto arg_t = type_of_arg(fcx.lcx, arg_tys.(arg_n));
6171+
auto arg_t = type_of_arg(bcx.fcx.lcx, arg_tys.(arg_n));
61746172
auto a = alloca(bcx, arg_t);
6175-
auto argval = fcx.llargs.get(aarg.id);
6173+
auto argval = bcx.fcx.llargs.get(aarg.id);
61766174
bcx.build.Store(argval, a);
61776175
// Overwrite the llargs entry for this arg with its alloca.
6178-
fcx.llargs.insert(aarg.id, a);
6176+
bcx.fcx.llargs.insert(aarg.id, a);
61796177
}
61806178

61816179
arg_n += 1u;
61826180
}
6183-
6184-
fcx.llallocas = bcx.llbb;
61856181
}
61866182

61876183
fn add_cleanups_for_args(&@block_ctxt bcx,
@@ -6317,9 +6313,9 @@ fn trans_fn(@local_ctxt cx, &ast._fn f, ast.def_id fid,
63176313
}
63186314

63196315
auto arg_tys = arg_tys_of_fn(fcx.lcx.ccx, ann);
6320-
copy_args_to_allocas(fcx, f.decl.inputs, arg_tys);
63216316

63226317
auto bcx = new_top_block_ctxt(fcx);
6318+
copy_args_to_allocas(bcx, f.decl.inputs, arg_tys);
63236319

63246320
add_cleanups_for_args(bcx, f.decl.inputs, arg_tys);
63256321

@@ -6431,9 +6427,9 @@ fn trans_obj(@local_ctxt cx, &ast._obj ob, ast.def_id oid,
64316427
fn_args, ty_params);
64326428

64336429
let vec[ty.arg] arg_tys = arg_tys_of_fn(ccx, ann);
6434-
copy_args_to_allocas(fcx, fn_args, arg_tys);
64356430

64366431
auto bcx = new_top_block_ctxt(fcx);
6432+
copy_args_to_allocas(bcx, fn_args, arg_tys);
64376433
auto lltop = bcx.llbb;
64386434

64396435
auto self_ty = ret_ty_of_fn(ccx, ann);
@@ -6584,9 +6580,9 @@ fn trans_tag_variant(@local_ctxt cx, ast.def_id tag_id,
65846580
}
65856581

65866582
auto arg_tys = arg_tys_of_fn(cx.ccx, variant.node.ann);
6587-
copy_args_to_allocas(fcx, fn_args, arg_tys);
65886583

65896584
auto bcx = new_top_block_ctxt(fcx);
6585+
copy_args_to_allocas(bcx, fn_args, arg_tys);
65906586
auto lltop = bcx.llbb;
65916587

65926588
// Cast the tag to a type we can GEP into.

0 commit comments

Comments
 (0)