@@ -146,6 +146,7 @@ type crate_ctxt =
146
146
ty:: ctxt tcx,
147
147
stats stats,
148
148
@upcall:: upcalls upcalls,
149
+ TypeRef rust_object_type ,
149
150
TypeRef tydesc_type ,
150
151
TypeRef task_type ) ;
151
152
@@ -773,7 +774,7 @@ fn type_of_fn_full(&@crate_ctxt cx, &span sp, ast::proto proto,
773
774
774
775
// Arg 2: Env (closure-bindings / self-obj)
775
776
if ( is_method) {
776
- atys += ~[ T_rust_object ( ) ] ;
777
+ atys += ~[ cx . rust_object_type ] ;
777
778
} else {
778
779
atys += ~[ T_opaque_closure_ptr ( * cx) ] ;
779
780
}
@@ -901,7 +902,7 @@ fn type_of_inner(&@crate_ctxt cx, &span sp, &ty::t t) -> TypeRef {
901
902
llty = T_fn_pair ( * cx, nft) ;
902
903
}
903
904
case ( ty:: ty_obj ( ?meths) ) {
904
- llty = T_rust_object ( ) ;
905
+ llty = cx . rust_object_type ;
905
906
}
906
907
case ( ty:: ty_res ( _, ?sub, ?tps) ) {
907
908
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,
6963
6964
}
6964
6965
6965
6966
// 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 ) ;
6967
6968
6968
6969
// Take care of cleanups.
6969
6970
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,
7124
7125
}
7125
7126
7126
7127
// 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 ) ) ;
7128
7129
7129
- // Return the object we built.
7130
+ // return the object we built.
7130
7131
ret rslt( bcx, pair) ;
7131
7132
}
7132
7133
@@ -7554,7 +7555,7 @@ fn copy_any_self_to_alloca(@fn_ctxt fcx) {
7554
7555
auto bcx = llstaticallocas_block_ctxt( fcx) ;
7555
7556
alt ( { fcx. llself } ) {
7556
7557
case ( some( ?pair) ) {
7557
- auto a = alloca( bcx, T_rust_object ( ) ) ;
7558
+ auto a = alloca( bcx, fcx . lcx . ccx . rust_object_type ) ;
7558
7559
bcx. build. Store ( pair. v, a) ;
7559
7560
fcx. llself = some[ val_self_pair] ( rec( v=a, t=pair. t) ) ;
7560
7561
}
@@ -7769,7 +7770,7 @@ fn process_fwding_mthd(@local_ctxt cx, &span sp, @ty::method m,
7769
7770
7770
7771
// The outer object will arrive in the forwarding function via the llenv
7771
7772
// 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 ) ;
7773
7774
bcx. build. Store ( fcx. llenv, llself_obj_ptr) ;
7774
7775
7775
7776
// 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,
9225
9226
mutable n_real_glues=0 u) ,
9226
9227
upcalls=upcall:: declare_upcalls( tn, tydesc_type, taskptr_type,
9227
9228
llmod) ,
9229
+ rust_object_type=T_rust_object ( ) ,
9228
9230
tydesc_type=tydesc_type,
9229
9231
task_type=task_type) ;
9230
9232
auto cx = new_local_ctxt( ccx) ;
0 commit comments