@@ -131,7 +131,7 @@ fn simplified_glue_type(tcx: ty::ctxt, field: uint, t: ty::t) -> ty::t {
131
131
t
132
132
}
133
133
134
- fn lazily_emit_tydesc_glue ( ccx : @CrateContext , field : uint , ti : @tydesc_info ) {
134
+ pub fn lazily_emit_tydesc_glue ( ccx : @CrateContext , field : uint , ti : @tydesc_info ) {
135
135
let _icx = push_ctxt ( "lazily_emit_tydesc_glue" ) ;
136
136
137
137
let simpl = simplified_glue_type ( ccx. tcx , field, ti. ty ) ;
@@ -367,17 +367,9 @@ fn make_drop_glue<'a>(bcx: &'a Block<'a>, v0: ValueRef, t: ty::t) -> &'a Block<'
367
367
let lluniquevalue = GEPi ( bcx, v0, [ 0 , abi:: trt_field_box] ) ;
368
368
// Only drop the value when it is non-null
369
369
with_cond ( bcx, IsNotNull ( bcx, Load ( bcx, lluniquevalue) ) , |bcx| {
370
- let llvtable = Load ( bcx, GEPi ( bcx, v0, [ 0 , abi:: trt_field_vtable] ) ) ;
371
-
372
- // Cast the vtable to a pointer to a pointer to a tydesc.
373
- let llvtable = PointerCast ( bcx, llvtable,
374
- ccx. tydesc_type . ptr_to ( ) . ptr_to ( ) ) ;
375
- let lltydesc = Load ( bcx, llvtable) ;
376
- call_tydesc_glue_full ( bcx,
377
- lluniquevalue,
378
- lltydesc,
379
- abi:: tydesc_field_drop_glue,
380
- None ) ;
370
+ let lldtor_ptr = Load ( bcx, GEPi ( bcx, v0, [ 0 , abi:: trt_field_vtable] ) ) ;
371
+ let lldtor = Load ( bcx, lldtor_ptr) ;
372
+ Call ( bcx, lldtor, [ PointerCast ( bcx, lluniquevalue, Type :: i8p ( ) ) ] , [ ] ) ;
381
373
bcx
382
374
} )
383
375
}
0 commit comments