aboutsummaryrefslogtreecommitdiff
path: root/src/comp
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-03-02 16:31:20 -0800
committerPatrick Walton <[email protected]>2011-03-02 16:31:20 -0800
commit5ebb91f24d84391f6c821c54fb8c497964eac6c3 (patch)
treea8237949933acfd7b898e235ec4a5df9aa673797 /src/comp
parentrustc: For derived tydescs, explicitly store 0 for size and align when the ty... (diff)
downloadrust-5ebb91f24d84391f6c821c54fb8c497964eac6c3.tar.xz
rust-5ebb91f24d84391f6c821c54fb8c497964eac6c3.zip
rustc: Teach iter_structural_ty about dynamically-sized tuples and records
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/trans.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 2258ee18..f58fe188 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -1596,8 +1596,10 @@ fn iter_structural_ty_full(@block_ctxt cx,
case (ty.ty_tup(?args)) {
let int i = 0;
for (@ty.t arg in args) {
- auto elt_a = r.bcx.build.GEP(av, vec(C_int(0), C_int(i)));
- auto elt_b = r.bcx.build.GEP(bv, vec(C_int(0), C_int(i)));
+ r = GEP_tup_like(r.bcx, t, av, vec(0, i));
+ auto elt_a = r.val;
+ r = GEP_tup_like(r.bcx, t, bv, vec(0, i));
+ auto elt_b = r.val;
r = f(r.bcx,
load_scalar_or_boxed(r.bcx, elt_a, arg),
load_scalar_or_boxed(r.bcx, elt_b, arg),
@@ -1608,8 +1610,10 @@ fn iter_structural_ty_full(@block_ctxt cx,
case (ty.ty_rec(?fields)) {
let int i = 0;
for (ty.field fld in fields) {
- auto llfld_a = r.bcx.build.GEP(av, vec(C_int(0), C_int(i)));
- auto llfld_b = r.bcx.build.GEP(bv, vec(C_int(0), C_int(i)));
+ r = GEP_tup_like(r.bcx, t, av, vec(0, i));
+ auto llfld_a = r.val;
+ r = GEP_tup_like(r.bcx, t, bv, vec(0, i));
+ auto llfld_b = r.val;
r = f(r.bcx,
load_scalar_or_boxed(r.bcx, llfld_a, fld.ty),
load_scalar_or_boxed(r.bcx, llfld_b, fld.ty),