@@ -44,9 +44,6 @@ pub fn expand_boxed_vec_ty(tcx: ty::ctxt, t: ty::t) -> ty::t {
44
44
ty:: ty_str( ty:: vstore_uniq) | ty:: ty_vec( _, ty:: vstore_uniq) => {
45
45
ty:: mk_uniq ( tcx, unboxed_vec_ty)
46
46
}
47
- ty:: ty_str( ty:: vstore_box) | ty:: ty_vec( _, ty:: vstore_box) => {
48
- ty:: mk_box ( tcx, unboxed_vec_ty)
49
- }
50
47
_ => tcx. sess . bug ( "non boxed-vec type \
51
48
in tvec::expand_boxed_vec_ty")
52
49
}
@@ -65,21 +62,6 @@ pub fn get_alloc(bcx: &Block, vptr: ValueRef) -> ValueRef {
65
62
Load ( bcx, GEPi ( bcx, vptr, [ 0 u, abi:: vec_elt_alloc] ) )
66
63
}
67
64
68
- pub fn get_bodyptr ( bcx : & Block , vptr : ValueRef , t : ty:: t ) -> ValueRef {
69
- let vt = vec_types ( bcx, t) ;
70
-
71
- let managed = match ty:: get ( vt. vec_ty ) . sty {
72
- ty:: ty_str( ty:: vstore_box) | ty:: ty_vec( _, ty:: vstore_box) => true ,
73
- _ => false
74
- } ;
75
-
76
- if managed {
77
- GEPi ( bcx, vptr, [ 0 u, abi:: box_field_body] )
78
- } else {
79
- vptr
80
- }
81
- }
82
-
83
65
pub fn get_dataptr ( bcx : & Block , vptr : ValueRef ) -> ValueRef {
84
66
let _icx = push_ctxt ( "tvec::get_dataptr" ) ;
85
67
GEPi ( bcx, vptr, [ 0 u, abi:: vec_elt_elems, 0 u] )
@@ -381,7 +363,7 @@ pub fn trans_uniq_or_managed_vstore<'a>(bcx: &'a Block<'a>,
381
363
let temp_scope = fcx. push_custom_cleanup_scope ( ) ;
382
364
fcx. schedule_free_value ( cleanup:: CustomScope ( temp_scope) , val, heap) ;
383
365
384
- let dataptr = get_dataptr ( bcx, get_bodyptr ( bcx , val, vt . vec_ty ) ) ;
366
+ let dataptr = get_dataptr ( bcx, val) ;
385
367
386
368
debug ! ( "alloc_vec() returned val={}, dataptr={}" ,
387
369
bcx. val_to_str( val) , bcx. val_to_str( dataptr) ) ;
@@ -570,10 +552,9 @@ pub fn get_base_and_byte_len(bcx: &Block,
570
552
let len = Mul ( bcx, count, vt. llunit_size ) ;
571
553
( base, len)
572
554
}
573
- ty:: vstore_uniq | ty :: vstore_box => {
555
+ ty:: vstore_uniq => {
574
556
assert ! ( type_is_immediate( bcx. ccx( ) , vt. vec_ty) ) ;
575
- let llval = Load ( bcx, llval) ;
576
- let body = get_bodyptr ( bcx, llval, vec_ty) ;
557
+ let body = Load ( bcx, llval) ;
577
558
( get_dataptr ( bcx, body) , get_fill ( bcx, body) )
578
559
}
579
560
}
@@ -610,10 +591,9 @@ pub fn get_base_and_len(bcx: &Block,
610
591
let count = Load ( bcx, GEPi ( bcx, llval, [ 0 u, abi:: slice_elt_len] ) ) ;
611
592
( base, count)
612
593
}
613
- ty:: vstore_uniq | ty :: vstore_box => {
594
+ ty:: vstore_uniq => {
614
595
assert ! ( type_is_immediate( bcx. ccx( ) , vt. vec_ty) ) ;
615
- let llval = Load ( bcx, llval) ;
616
- let body = get_bodyptr ( bcx, llval, vec_ty) ;
596
+ let body = Load ( bcx, llval) ;
617
597
( get_dataptr ( bcx, body) , UDiv ( bcx, get_fill ( bcx, body) , vt. llunit_size ) )
618
598
}
619
599
}
@@ -730,7 +710,7 @@ pub fn iter_vec_uniq<'r,
730
710
f : iter_vec_block < ' r , ' b > )
731
711
-> & ' b Block < ' b > {
732
712
let _icx = push_ctxt ( "tvec::iter_vec_uniq" ) ;
733
- let data_ptr = get_dataptr ( bcx, get_bodyptr ( bcx , vptr, vec_ty ) ) ;
713
+ let data_ptr = get_dataptr ( bcx, vptr) ;
734
714
iter_vec_raw ( bcx, data_ptr, vec_ty, fill, f)
735
715
}
736
716
0 commit comments