Skip to content

Commit 302ec53

Browse files
committed
---
yaml --- r: 4191 b: refs/heads/master c: 55a65a5 h: refs/heads/master i: 4189: 15856f1 4187: aa15852 4183: 9d7df72 4175: 9e20849 4159: 72678da v: v3
1 parent 5b28744 commit 302ec53

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
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: b977b5c508bc34fea27a2bfa4b637ab6df8ad7f4
2+
refs/heads/master: 55a65a51aafe3097ff13055578d265adcc47c42b

trunk/src/comp/back/abi.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,9 @@ const fn_field_box: int = 1;
9797

9898
const closure_elt_tydesc: int = 0;
9999

100-
const closure_elt_target: int = 1;
100+
const closure_elt_bindings: int = 1;
101101

102-
const closure_elt_bindings: int = 2;
103-
104-
const closure_elt_ty_params: int = 3;
102+
const closure_elt_ty_params: int = 2;
105103

106104
const ivec_default_length: uint = 4u;
107105

trunk/src/comp/middle/trans.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3721,14 +3721,14 @@ fn build_environment(cx: &@block_ctxt, upvars: &freevar_set) ->
37213721
}
37223722

37233723
// Create an environment and populate it with the bindings.
3724-
let tydesc_count = std::ivec::len[ValueRef](cx.fcx.lltydescs);
3724+
let tydesc_count = std::ivec::len(cx.fcx.lltydescs);
37253725
let llenvptrty =
3726-
T_closure_ptr(*bcx_ccx(cx), T_ptr(T_nil()), val_ty(llbindingsptr),
3727-
tydesc_count);
3726+
T_closure_ptr(*bcx_ccx(cx), val_ty(llbindingsptr), tydesc_count);
37283727
let llenvptr = alloca(cx, llvm::LLVMGetElementType(llenvptrty));
37293728
let llbindingsptrptr =
37303729
cx.build.GEP(llenvptr,
3731-
~[C_int(0), C_int(abi::box_rc_field_body), C_int(2)]);
3730+
~[C_int(0), C_int(abi::box_rc_field_body),
3731+
C_int(abi::closure_elt_bindings)]);
37323732
cx.build.Store(llbindingsptr, llbindingsptrptr);
37333733

37343734
// Copy in our type descriptors, in case the iterator body needs to refer
@@ -4610,8 +4610,7 @@ fn trans_bind_1(cx: &@block_ctxt, f: &@ast::expr, f_res: &lval_result,
46104610
// closure_tys = [tydesc_ty, outgoing_fty, [bound_ty1, bound_ty2,
46114611
// ...], [tydesc_ty, tydesc_ty, ...]]
46124612
let closure_tys: ty::t[] =
4613-
~[tydesc_ty, outgoing_fty, bindings_ty,
4614-
ty::mk_imm_tup(bcx_tcx(cx), captured_tys)];
4613+
~[tydesc_ty, bindings_ty, ty::mk_imm_tup(bcx_tcx(cx), captured_tys)];
46154614

46164615
// Finally, synthesize a type for that whole vector.
46174616
let closure_ty: ty::t = ty::mk_imm_tup(bcx_tcx(cx), closure_tys);

trunk/src/comp/middle/trans_common.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -674,23 +674,20 @@ fn T_typaram(tn: &type_names) -> TypeRef {
674674

675675
fn T_typaram_ptr(tn: &type_names) -> TypeRef { ret T_ptr(T_typaram(tn)); }
676676

677-
fn T_closure_ptr(cx: &crate_ctxt, lltarget_ty: TypeRef,
678-
llbindings_ty: TypeRef, n_ty_params: uint) -> TypeRef {
677+
fn T_closure_ptr(cx: &crate_ctxt, llbindings_ty: TypeRef,
678+
n_ty_params: uint) -> TypeRef {
679679
// NB: keep this in sync with code in trans_bind; we're making
680680
// an LLVM typeref structure that has the same "shape" as the ty::t
681681
// it constructs.
682-
683-
ret T_ptr(T_box(T_struct(~[T_ptr(cx.tydesc_type), lltarget_ty,
682+
ret T_ptr(T_box(T_struct(~[T_ptr(cx.tydesc_type),
684683
llbindings_ty,
685684
T_captured_tydescs(cx, n_ty_params)])));
686685
}
687686

688687
fn T_opaque_closure_ptr(cx: &crate_ctxt) -> TypeRef {
689688
let s = "*closure";
690689
if cx.tn.name_has_type(s) { ret cx.tn.get_type(s); }
691-
let t =
692-
T_closure_ptr(cx, T_struct(~[T_ptr(T_nil()), T_ptr(T_nil())]),
693-
T_nil(), 0u);
690+
let t = T_closure_ptr(cx, T_nil(), 0u);
694691
cx.tn.associate(s, t);
695692
ret t;
696693
}
@@ -836,4 +833,4 @@ fn C_named_struct(T: TypeRef, elts: &ValueRef[]) -> ValueRef {
836833
fn C_array(ty: TypeRef, elts: &ValueRef[]) -> ValueRef {
837834
ret llvm::LLVMConstArray(ty, std::ivec::to_ptr(elts),
838835
std::ivec::len(elts));
839-
}
836+
}

0 commit comments

Comments
 (0)