@@ -144,7 +144,7 @@ pub struct Struct<'tcx> {
144
144
* these, for places in trans where the `Ty` isn't directly
145
145
* available.
146
146
*/
147
- pub fn represent_node < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > ,
147
+ pub fn represent_node < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > ,
148
148
node : ast:: NodeId ) -> Rc < Repr < ' tcx > > {
149
149
represent_type ( bcx. ccx ( ) , node_id_type ( bcx, node) )
150
150
}
@@ -626,7 +626,7 @@ fn struct_llfields<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, st: &Struct<'tcx>,
626
626
*
627
627
* This should ideally be less tightly tied to `_match`.
628
628
*/
629
- pub fn trans_switch < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > ,
629
+ pub fn trans_switch < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > ,
630
630
r : & Repr < ' tcx > , scrutinee : ValueRef )
631
631
-> ( _match:: BranchKind , Option < ValueRef > ) {
632
632
match * r {
@@ -643,7 +643,7 @@ pub fn trans_switch<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
643
643
644
644
645
645
/// Obtain the actual discriminant of a value.
646
- pub fn trans_get_discr < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , r : & Repr < ' tcx > ,
646
+ pub fn trans_get_discr < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > , r : & Repr < ' tcx > ,
647
647
scrutinee : ValueRef , cast_to : Option < Type > )
648
648
-> ValueRef {
649
649
let signed;
@@ -719,8 +719,8 @@ fn load_discr(bcx: Block, ity: IntType, ptr: ValueRef, min: Disr, max: Disr)
719
719
*
720
720
* This should ideally be less tightly tied to `_match`.
721
721
*/
722
- pub fn trans_case < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , r : & Repr , discr : Disr )
723
- -> _match:: OptResult < ' blk , ' tcx > {
722
+ pub fn trans_case < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > , r : & Repr , discr : Disr )
723
+ -> _match:: OptResult < ' fcx , ' blk , ' tcx > {
724
724
match * r {
725
725
CEnum ( ity, _, _) => {
726
726
_match:: SingleResult ( Result :: new ( bcx, C_integral ( ll_inttype ( bcx. ccx ( ) , ity) ,
@@ -745,7 +745,7 @@ pub fn trans_case<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr, discr: Disr)
745
745
* Set the discriminant for a new value of the given case of the given
746
746
* representation.
747
747
*/
748
- pub fn trans_set_discr < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , r : & Repr < ' tcx > ,
748
+ pub fn trans_set_discr < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > , r : & Repr < ' tcx > ,
749
749
val : ValueRef , discr : Disr ) {
750
750
match * r {
751
751
CEnum ( ity, min, max) => {
@@ -824,7 +824,7 @@ pub fn num_args(r: &Repr, discr: Disr) -> uint {
824
824
}
825
825
826
826
/// Access a field, at a point when the value's case is known.
827
- pub fn trans_field_ptr < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , r : & Repr < ' tcx > ,
827
+ pub fn trans_field_ptr < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > , r : & Repr < ' tcx > ,
828
828
val : ValueRef , discr : Disr , ix : uint ) -> ValueRef {
829
829
// Note: if this ever needs to generate conditionals (e.g., if we
830
830
// decide to do some kind of cdr-coding-like non-unique repr
@@ -863,7 +863,7 @@ pub fn trans_field_ptr<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr<'tcx>,
863
863
}
864
864
}
865
865
866
- pub fn struct_field_ptr < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , st : & Struct < ' tcx > , val : ValueRef ,
866
+ pub fn struct_field_ptr < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > , st : & Struct < ' tcx > , val : ValueRef ,
867
867
ix : uint , needs_cast : bool ) -> ValueRef {
868
868
let val = if needs_cast {
869
869
let ccx = bcx. ccx ( ) ;
@@ -877,10 +877,10 @@ pub fn struct_field_ptr<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, st: &Struct<'tcx>, v
877
877
GEPi ( bcx, val, & [ 0 , ix] )
878
878
}
879
879
880
- pub fn fold_variants < ' blk , ' tcx > (
881
- bcx : Block < ' blk , ' tcx > , r : & Repr < ' tcx > , value : ValueRef ,
882
- f : |Block < ' blk , ' tcx > , & Struct < ' tcx > , ValueRef | -> Block < ' blk , ' tcx > )
883
- -> Block < ' blk , ' tcx > {
880
+ pub fn fold_variants < ' fcx , ' blk , ' tcx > (
881
+ bcx : Block < ' fcx , ' blk , ' tcx > , r : & Repr < ' tcx > , value : ValueRef ,
882
+ f : |Block < ' fcx , ' blk , ' tcx > , & Struct < ' tcx > , ValueRef | -> Block < ' fcx , ' blk , ' tcx > )
883
+ -> Block < ' fcx , ' blk , ' tcx > {
884
884
let fcx = bcx. fcx;
885
885
match * r {
886
886
Univariant ( ref st, _) => {
@@ -892,23 +892,23 @@ pub fn fold_variants<'blk, 'tcx>(
892
892
Unreachable ( unr_cx) ;
893
893
894
894
let discr_val = trans_get_discr ( bcx, r, value, None ) ;
895
- let llswitch = Switch ( bcx, discr_val, unr_cx. llbb , cases. len ( ) ) ;
895
+ let llswitch = Switch ( bcx, discr_val, unr_cx. data . llbb , cases. len ( ) ) ;
896
896
let bcx_next = fcx. new_temp_block ( "enum-variant-iter-next" ) ;
897
897
898
898
for ( discr, case) in cases. iter ( ) . enumerate ( ) {
899
899
let mut variant_cx = fcx. new_temp_block (
900
900
format ! ( "enum-variant-iter-{}" , discr. to_string( ) ) . as_slice ( )
901
901
) ;
902
902
let rhs_val = C_integral ( ll_inttype ( ccx, ity) , discr as u64 , true ) ;
903
- AddCase ( llswitch, rhs_val, variant_cx. llbb ) ;
903
+ AddCase ( llswitch, rhs_val, variant_cx. data . llbb ) ;
904
904
905
905
let fields = case. fields . iter ( ) . map ( |& ty|
906
906
type_of:: type_of ( bcx. ccx ( ) , ty) ) . collect :: < Vec < _ > > ( ) ;
907
907
let real_ty = Type :: struct_ ( ccx, fields. as_slice ( ) , case. packed ) ;
908
908
let variant_value = PointerCast ( variant_cx, value, real_ty. ptr_to ( ) ) ;
909
909
910
910
variant_cx = f ( variant_cx, case, variant_value) ;
911
- Br ( variant_cx, bcx_next. llbb ) ;
911
+ Br ( variant_cx, bcx_next. data . llbb ) ;
912
912
}
913
913
914
914
bcx_next
@@ -918,8 +918,8 @@ pub fn fold_variants<'blk, 'tcx>(
918
918
}
919
919
920
920
/// Access the struct drop flag, if present.
921
- pub fn trans_drop_flag_ptr < ' blk , ' tcx > ( mut bcx : Block < ' blk , ' tcx > , r : & Repr < ' tcx > , val : ValueRef )
922
- -> datum:: DatumBlock < ' blk , ' tcx , datum:: Expr > {
921
+ pub fn trans_drop_flag_ptr < ' fcx , ' blk , ' tcx > ( mut bcx : Block < ' fcx , ' blk , ' tcx > , r : & Repr < ' tcx > , val : ValueRef )
922
+ -> datum:: DatumBlock < ' fcx , ' blk , ' tcx , datum:: Expr > {
923
923
let ptr_ty = ty:: mk_imm_ptr ( bcx. tcx ( ) , ty:: mk_bool ( ) ) ;
924
924
match * r {
925
925
Univariant ( ref st, true ) => {
0 commit comments