Skip to content

Commit 6e1b29e

Browse files
committed
---
yaml --- r: 34749 b: refs/heads/master c: c6780fb h: refs/heads/master i: 34747: 01f3e0d v: v3
1 parent 22216cb commit 6e1b29e

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: c4155f5ea37b9921eff310d9ca06402d0bb9b0f6
2+
refs/heads/master: c6780fbb0c62819b2b1851c08a2c08fb3f1c9695
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024

trunk/src/rustc/middle/trans/closure.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ fn store_environment(bcx: block,
244244
fn build_closure(bcx0: block,
245245
cap_vars: ~[capture::capture_var],
246246
ck: ty::closure_kind,
247-
id: ast::node_id,
248247
include_ret_handle: Option<ValueRef>) -> closure_result {
249248
let _icx = bcx0.insn_ctxt("closure::build_closure");
250249
// If we need to, package up the iterator body to call
@@ -255,7 +254,7 @@ fn build_closure(bcx0: block,
255254
let mut env_vals = ~[];
256255
for vec::each(cap_vars) |cap_var| {
257256
debug!("Building closure: captured variable %?", *cap_var);
258-
let datum = expr::trans_local_var(bcx, id, cap_var.def);
257+
let datum = expr::trans_local_var(bcx, cap_var.def);
259258
match cap_var.mode {
260259
capture::cap_ref => {
261260
assert ck == ty::ck_block;
@@ -370,7 +369,7 @@ fn trans_expr_fn(bcx: block,
370369
let cap_vars = capture::compute_capture_vars(ccx.tcx, id, proto,
371370
cap_clause);
372371
let ret_handle = match is_loop_body { Some(x) => x, None => None };
373-
let {llbox, cdata_ty, bcx} = build_closure(bcx, cap_vars, ck, id,
372+
let {llbox, cdata_ty, bcx} = build_closure(bcx, cap_vars, ck,
374373
ret_handle);
375374
trans_closure(ccx, sub_path, decl, body, llfn, no_self,
376375
bcx.fcx.param_substs, id, |fcx| {

trunk/src/rustc/middle/trans/expr.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -748,13 +748,13 @@ fn trans_def_lvalue(bcx: block, ref_expr: @ast::expr,
748748
_ => {
749749
DatumBlock {
750750
bcx: bcx,
751-
datum: trans_local_var(bcx, ref_expr.id, def)
751+
datum: trans_local_var(bcx, def)
752752
}
753753
}
754754
}
755755
}
756756

757-
fn trans_local_var(bcx: block, ref_id: ast::node_id, def: ast::def) -> Datum {
757+
fn trans_local_var(bcx: block, def: ast::def) -> Datum {
758758
let _icx = bcx.insn_ctxt("trans_local_var");
759759

760760
return match def {
@@ -776,10 +776,10 @@ fn trans_local_var(bcx: block, ref_id: ast::node_id, def: ast::def) -> Datum {
776776
}
777777
}
778778
ast::def_arg(nid, _) => {
779-
take_local(bcx, ref_id, bcx.fcx.llargs, nid)
779+
take_local(bcx, bcx.fcx.llargs, nid)
780780
}
781781
ast::def_local(nid, _) | ast::def_binding(nid, _) => {
782-
take_local(bcx, ref_id, bcx.fcx.lllocals, nid)
782+
take_local(bcx, bcx.fcx.lllocals, nid)
783783
}
784784
ast::def_self(nid) => {
785785
let self_info: ValSelfData = match bcx.fcx.llself {
@@ -809,15 +809,8 @@ fn trans_local_var(bcx: block, ref_id: ast::node_id, def: ast::def) -> Datum {
809809
};
810810

811811
fn take_local(bcx: block,
812-
ref_id: ast::node_id,
813812
table: HashMap<ast::node_id, local_val>,
814813
nid: ast::node_id) -> Datum {
815-
let is_last_use = match bcx.ccx().maps.last_use_map.find(ref_id) {
816-
None => false,
817-
Some(vars) => (*vars).contains(&nid)
818-
};
819-
820-
let source = if is_last_use {FromLastUseLvalue} else {FromLvalue};
821814

822815
let (v, mode) = match table.find(nid) {
823816
Some(local_mem(v)) => (v, ByRef),
@@ -829,10 +822,10 @@ fn trans_local_var(bcx: block, ref_id: ast::node_id, def: ast::def) -> Datum {
829822
};
830823
let ty = node_id_type(bcx, nid);
831824

832-
debug!("take_local(nid=%?, last_use=%b, v=%s, mode=%?, ty=%s)",
833-
nid, is_last_use, bcx.val_str(v), mode, bcx.ty_to_str(ty));
825+
debug!("take_local(nid=%?, v=%s, mode=%?, ty=%s)",
826+
nid, bcx.val_str(v), mode, bcx.ty_to_str(ty));
834827

835-
Datum { val: v, ty: ty, mode: mode, source: source }
828+
Datum { val: v, ty: ty, mode: mode, source: FromLvalue }
836829
}
837830
}
838831

0 commit comments

Comments
 (0)