Skip to content

Commit adc786a

Browse files
committed
---
yaml --- r: 3909 b: refs/heads/master c: 7376e75 h: refs/heads/master i: 3907: 178c03d v: v3
1 parent dd44ed7 commit adc786a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
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: 40f617390d26816374d5ca54f2b3ea699471e0c8
2+
refs/heads/master: 7376e751aeed046c29ff4b892b359002de145d2d

trunk/src/comp/middle/trans.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ type crate_ctxt =
146146
ty::ctxt tcx,
147147
stats stats,
148148
@upcall::upcalls upcalls,
149+
TypeRef rust_object_type,
149150
TypeRef tydesc_type,
150151
TypeRef task_type);
151152

@@ -773,7 +774,7 @@ fn type_of_fn_full(&@crate_ctxt cx, &span sp, ast::proto proto,
773774

774775
// Arg 2: Env (closure-bindings / self-obj)
775776
if (is_method) {
776-
atys += ~[T_rust_object()];
777+
atys += ~[cx.rust_object_type];
777778
} else {
778779
atys += ~[T_opaque_closure_ptr(*cx)];
779780
}
@@ -901,7 +902,7 @@ fn type_of_inner(&@crate_ctxt cx, &span sp, &ty::t t) -> TypeRef {
901902
llty = T_fn_pair(*cx, nft);
902903
}
903904
case (ty::ty_obj(?meths)) {
904-
llty = T_rust_object();
905+
llty = cx.rust_object_type;
905906
}
906907
case (ty::ty_res(_, ?sub, ?tps)) {
907908
auto sub1 = ty::substitute_type_params(cx.tcx, tps, sub);
@@ -6963,7 +6964,7 @@ fn trans_anon_obj(@block_ctxt bcx, &span sp, &ast::anon_obj anon_obj,
69636964
}
69646965

69656966
// Allocate the object that we're going to return.
6966-
auto pair = alloca(bcx, T_rust_object());
6967+
auto pair = alloca(bcx, ccx.rust_object_type);
69676968

69686969
// Take care of cleanups.
69696970
auto t = node_id_type(ccx, id);
@@ -7124,9 +7125,9 @@ fn trans_anon_obj(@block_ctxt bcx, &span sp, &ast::anon_obj anon_obj,
71247125
}
71257126

71267127
// Cast the final object to how we want its type to appear.
7127-
pair = bcx.build.PointerCast(pair, T_ptr(T_rust_object()));
7128+
pair = bcx.build.PointerCast(pair, T_ptr(ccx.rust_object_type));
71287129

7129-
// Return the object we built.
7130+
// return the object we built.
71307131
ret rslt(bcx, pair);
71317132
}
71327133

@@ -7554,7 +7555,7 @@ fn copy_any_self_to_alloca(@fn_ctxt fcx) {
75547555
auto bcx = llstaticallocas_block_ctxt(fcx);
75557556
alt ({ fcx.llself }) {
75567557
case (some(?pair)) {
7557-
auto a = alloca(bcx, T_rust_object());
7558+
auto a = alloca(bcx, fcx.lcx.ccx.rust_object_type);
75587559
bcx.build.Store(pair.v, a);
75597560
fcx.llself = some[val_self_pair](rec(v=a, t=pair.t));
75607561
}
@@ -7769,7 +7770,7 @@ fn process_fwding_mthd(@local_ctxt cx, &span sp, @ty::method m,
77697770

77707771
// The outer object will arrive in the forwarding function via the llenv
77717772
// argument. Put it in an alloca so that we can GEP into it later.
7772-
auto llself_obj_ptr = alloca(bcx, T_rust_object());
7773+
auto llself_obj_ptr = alloca(bcx, fcx.lcx.ccx.rust_object_type);
77737774
bcx.build.Store(fcx.llenv, llself_obj_ptr);
77747775

77757776
// Grab hold of the outer object so we can pass it into the inner object,
@@ -9225,6 +9226,7 @@ fn trans_crate(&session::session sess, &@ast::crate crate, &ty::ctxt tcx,
92259226
mutable n_real_glues=0u),
92269227
upcalls=upcall::declare_upcalls(tn, tydesc_type, taskptr_type,
92279228
llmod),
9229+
rust_object_type=T_rust_object(),
92289230
tydesc_type=tydesc_type,
92299231
task_type=task_type);
92309232
auto cx = new_local_ctxt(ccx);

0 commit comments

Comments
 (0)