@@ -196,7 +196,7 @@ fn trans_struct_drop_flag<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
196
196
let struct_data = if ty:: type_is_sized ( bcx. tcx ( ) , t) {
197
197
v0
198
198
} else {
199
- let llval = GEPi ( bcx, v0, & [ 0 , abi:: slice_elt_base ] ) ;
199
+ let llval = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_ADDR ] ) ;
200
200
Load ( bcx, llval)
201
201
} ;
202
202
let drop_flag = unpack_datum ! ( bcx, adt:: trans_drop_flag_ptr( bcx, & * repr, struct_data) ) ;
@@ -237,8 +237,8 @@ fn trans_struct_drop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
237
237
let ( struct_data, info) = if ty:: type_is_sized ( bcx. tcx ( ) , t) {
238
238
( v0, None )
239
239
} else {
240
- let data = GEPi ( bcx, v0, & [ 0 , abi:: slice_elt_base ] ) ;
241
- let info = GEPi ( bcx, v0, & [ 0 , abi:: slice_elt_len ] ) ;
240
+ let data = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_ADDR ] ) ;
241
+ let info = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_EXTRA ] ) ;
242
242
( Load ( bcx, data) , Some ( Load ( bcx, info) ) )
243
243
} ;
244
244
@@ -255,14 +255,14 @@ fn trans_struct_drop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
255
255
// The dtor expects a fat pointer, so make one, even if we have to fake it.
256
256
let boxed_ty = ty:: mk_open ( bcx. tcx ( ) , t) ;
257
257
let scratch = datum:: rvalue_scratch_datum ( bcx, boxed_ty, "__fat_ptr_drop_self" ) ;
258
- Store ( bcx, value, GEPi ( bcx, scratch. val , & [ 0 , abi:: slice_elt_base ] ) ) ;
258
+ Store ( bcx, value, GEPi ( bcx, scratch. val , & [ 0 , abi:: FAT_PTR_ADDR ] ) ) ;
259
259
Store ( bcx,
260
260
// If we just had a thin pointer, make a fat pointer by sticking
261
261
// null where we put the unsizing info. This works because t
262
262
// is a sized type, so we will only unpack the fat pointer, never
263
263
// use the fake info.
264
264
info. unwrap_or ( C_null ( Type :: i8p ( bcx. ccx ( ) ) ) ) ,
265
- GEPi ( bcx, scratch. val , & [ 0 , abi:: slice_elt_len ] ) ) ;
265
+ GEPi ( bcx, scratch. val , & [ 0 , abi:: FAT_PTR_EXTRA ] ) ) ;
266
266
PointerCast ( variant_cx, scratch. val , params[ 0 ] )
267
267
} else {
268
268
PointerCast ( variant_cx, value, params[ 0 ] )
@@ -280,8 +280,8 @@ fn trans_struct_drop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
280
280
} else {
281
281
let boxed_ty = ty:: mk_open ( bcx. tcx ( ) , * ty) ;
282
282
let scratch = datum:: rvalue_scratch_datum ( bcx, boxed_ty, "__fat_ptr_drop_field" ) ;
283
- Store ( bcx, llfld_a, GEPi ( bcx, scratch. val , & [ 0 , abi:: slice_elt_base ] ) ) ;
284
- Store ( bcx, info. unwrap ( ) , GEPi ( bcx, scratch. val , & [ 0 , abi:: slice_elt_len ] ) ) ;
283
+ Store ( bcx, llfld_a, GEPi ( bcx, scratch. val , & [ 0 , abi:: FAT_PTR_ADDR ] ) ) ;
284
+ Store ( bcx, info. unwrap ( ) , GEPi ( bcx, scratch. val , & [ 0 , abi:: FAT_PTR_EXTRA ] ) ) ;
285
285
scratch. val
286
286
} ;
287
287
variant_cx. fcx . schedule_drop_mem ( cleanup:: CustomScope ( field_scope) ,
@@ -369,11 +369,11 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>)
369
369
tvec:: make_drop_glue_unboxed ( bcx, v0, unit_ty, true )
370
370
}
371
371
ty:: ty_trait( ..) => {
372
- let lluniquevalue = GEPi ( bcx, v0, & [ 0 , abi:: trt_field_box ] ) ;
372
+ let lluniquevalue = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_ADDR ] ) ;
373
373
// Only drop the value when it is non-null
374
374
let concrete_ptr = Load ( bcx, lluniquevalue) ;
375
375
with_cond ( bcx, IsNotNull ( bcx, concrete_ptr) , |bcx| {
376
- let dtor_ptr = Load ( bcx, GEPi ( bcx, v0, & [ 0 , abi:: trt_field_vtable ] ) ) ;
376
+ let dtor_ptr = Load ( bcx, GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_EXTRA ] ) ) ;
377
377
let dtor = Load ( bcx, dtor_ptr) ;
378
378
Call ( bcx,
379
379
dtor,
@@ -383,12 +383,12 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>)
383
383
} )
384
384
}
385
385
ty:: ty_struct( ..) if !ty:: type_is_sized ( bcx. tcx ( ) , content_ty) => {
386
- let llval = GEPi ( bcx, v0, & [ 0 , abi:: slice_elt_base ] ) ;
386
+ let llval = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_ADDR ] ) ;
387
387
let llbox = Load ( bcx, llval) ;
388
388
let not_null = IsNotNull ( bcx, llbox) ;
389
389
with_cond ( bcx, not_null, |bcx| {
390
390
let bcx = drop_ty ( bcx, v0, content_ty, None ) ;
391
- let info = GEPi ( bcx, v0, & [ 0 , abi:: slice_elt_len ] ) ;
391
+ let info = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_EXTRA ] ) ;
392
392
let info = Load ( bcx, info) ;
393
393
let ( llsize, llalign) = size_and_align_of_dst ( bcx, content_ty, info) ;
394
394
trans_exchange_free_dyn ( bcx, llbox, llsize, llalign)
@@ -440,12 +440,12 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>)
440
440
t,
441
441
|bb, vv, tt| drop_ty ( bb, vv, tt, None ) ) ,
442
442
ty:: ty_closure( ref f) if f. store == ty:: UniqTraitStore => {
443
- let box_cell_v = GEPi ( bcx, v0, & [ 0 u, abi:: fn_field_box ] ) ;
443
+ let box_cell_v = GEPi ( bcx, v0, & [ 0 u, abi:: FAT_PTR_EXTRA ] ) ;
444
444
let env = Load ( bcx, box_cell_v) ;
445
445
let env_ptr_ty = Type :: at_box ( bcx. ccx ( ) , Type :: i8 ( bcx. ccx ( ) ) ) . ptr_to ( ) ;
446
446
let env = PointerCast ( bcx, env, env_ptr_ty) ;
447
447
with_cond ( bcx, IsNotNull ( bcx, env) , |bcx| {
448
- let dtor_ptr = GEPi ( bcx, env, & [ 0 u, abi:: box_field_drop_glue ] ) ;
448
+ let dtor_ptr = GEPi ( bcx, env, & [ 0 u, abi:: BOX_FIELD_DROP_GLUE ] ) ;
449
449
let dtor = Load ( bcx, dtor_ptr) ;
450
450
Call ( bcx, dtor, & [ PointerCast ( bcx, box_cell_v, Type :: i8p ( bcx. ccx ( ) ) ) ] , None ) ;
451
451
bcx
@@ -456,8 +456,8 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>)
456
456
// above), because this happens for a trait field in an unsized
457
457
// struct. If anything is null, it is the whole struct and we won't
458
458
// get here.
459
- let lluniquevalue = GEPi ( bcx, v0, & [ 0 , abi:: trt_field_box ] ) ;
460
- let dtor_ptr = Load ( bcx, GEPi ( bcx, v0, & [ 0 , abi:: trt_field_vtable ] ) ) ;
459
+ let lluniquevalue = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_ADDR ] ) ;
460
+ let dtor_ptr = Load ( bcx, GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_EXTRA ] ) ) ;
461
461
let dtor = Load ( bcx, dtor_ptr) ;
462
462
Call ( bcx,
463
463
dtor,
0 commit comments