@@ -130,7 +130,7 @@ pub struct Struct<'tcx> {
130
130
/// Convenience for `represent_type`. There should probably be more or
131
131
/// these, for places in trans where the `Ty` isn't directly
132
132
/// available.
133
- pub fn represent_node < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > ,
133
+ pub fn represent_node < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > ,
134
134
node : ast:: NodeId ) -> Rc < Repr < ' tcx > > {
135
135
represent_type ( bcx. ccx ( ) , node_id_type ( bcx, node) )
136
136
}
@@ -710,7 +710,7 @@ fn struct_llfields<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, st: &Struct<'tcx>,
710
710
/// destructuring; this may or may not involve the actual discriminant.
711
711
///
712
712
/// This should ideally be less tightly tied to `_match`.
713
- pub fn trans_switch < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > ,
713
+ pub fn trans_switch < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > ,
714
714
r : & Repr < ' tcx > , scrutinee : ValueRef )
715
715
-> ( _match:: BranchKind , Option < ValueRef > ) {
716
716
match * r {
@@ -727,7 +727,7 @@ pub fn trans_switch<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
727
727
728
728
729
729
/// Obtain the actual discriminant of a value.
730
- pub fn trans_get_discr < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , r : & Repr < ' tcx > ,
730
+ pub fn trans_get_discr < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > , r : & Repr < ' tcx > ,
731
731
scrutinee : ValueRef , cast_to : Option < Type > )
732
732
-> ValueRef {
733
733
let signed;
@@ -798,8 +798,8 @@ fn load_discr(bcx: Block, ity: IntType, ptr: ValueRef, min: Disr, max: Disr)
798
798
/// discriminant-like value returned by `trans_switch`.
799
799
///
800
800
/// This should ideally be less tightly tied to `_match`.
801
- pub fn trans_case < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , r : & Repr , discr : Disr )
802
- -> _match:: OptResult < ' blk , ' tcx > {
801
+ pub fn trans_case < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > , r : & Repr , discr : Disr )
802
+ -> _match:: OptResult < ' fcx , ' blk , ' tcx > {
803
803
match * r {
804
804
CEnum ( ity, _, _) => {
805
805
_match:: SingleResult ( Result :: new ( bcx, C_integral ( ll_inttype ( bcx. ccx ( ) , ity) ,
@@ -822,7 +822,7 @@ pub fn trans_case<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr, discr: Disr)
822
822
823
823
/// Set the discriminant for a new value of the given case of the given
824
824
/// representation.
825
- pub fn trans_set_discr < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , r : & Repr < ' tcx > ,
825
+ pub fn trans_set_discr < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > , r : & Repr < ' tcx > ,
826
826
val : ValueRef , discr : Disr ) {
827
827
match * r {
828
828
CEnum ( ity, min, max) => {
@@ -892,7 +892,7 @@ pub fn num_args(r: &Repr, discr: Disr) -> uint {
892
892
}
893
893
894
894
/// Access a field, at a point when the value's case is known.
895
- pub fn trans_field_ptr < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , r : & Repr < ' tcx > ,
895
+ pub fn trans_field_ptr < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > , r : & Repr < ' tcx > ,
896
896
val : ValueRef , discr : Disr , ix : uint ) -> ValueRef {
897
897
// Note: if this ever needs to generate conditionals (e.g., if we
898
898
// decide to do some kind of cdr-coding-like non-unique repr
@@ -931,7 +931,7 @@ pub fn trans_field_ptr<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr<'tcx>,
931
931
}
932
932
}
933
933
934
- pub fn struct_field_ptr < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , st : & Struct < ' tcx > , val : ValueRef ,
934
+ pub fn struct_field_ptr < ' fcx , ' blk , ' tcx > ( bcx : Block < ' fcx , ' blk , ' tcx > , st : & Struct < ' tcx > , val : ValueRef ,
935
935
ix : uint , needs_cast : bool ) -> ValueRef {
936
936
let val = if needs_cast {
937
937
let ccx = bcx. ccx ( ) ;
@@ -945,12 +945,12 @@ pub fn struct_field_ptr<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, st: &Struct<'tcx>, v
945
945
GEPi ( bcx, val, & [ 0 , ix] )
946
946
}
947
947
948
- pub fn fold_variants < ' blk , ' tcx , F > ( bcx : Block < ' blk , ' tcx > ,
948
+ pub fn fold_variants < ' fcx , ' blk , ' tcx , F > ( bcx : Block < ' fcx , ' blk , ' tcx > ,
949
949
r : & Repr < ' tcx > ,
950
950
value : ValueRef ,
951
951
mut f : F )
952
- -> Block < ' blk , ' tcx > where
953
- F : FnMut ( Block < ' blk , ' tcx > , & Struct < ' tcx > , ValueRef ) -> Block < ' blk , ' tcx > ,
952
+ -> Block < ' fcx , ' blk , ' tcx > where
953
+ F : FnMut ( Block < ' fcx , ' blk , ' tcx > , & Struct < ' tcx > , ValueRef ) -> Block < ' fcx , ' blk , ' tcx > ,
954
954
{
955
955
let fcx = bcx. fcx ;
956
956
match * r {
@@ -963,23 +963,23 @@ pub fn fold_variants<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
963
963
Unreachable ( unr_cx) ;
964
964
965
965
let discr_val = trans_get_discr ( bcx, r, value, None ) ;
966
- let llswitch = Switch ( bcx, discr_val, unr_cx. llbb , cases. len ( ) ) ;
966
+ let llswitch = Switch ( bcx, discr_val, unr_cx. data . llbb , cases. len ( ) ) ;
967
967
let bcx_next = fcx. new_temp_block ( "enum-variant-iter-next" ) ;
968
968
969
969
for ( discr, case) in cases. iter ( ) . enumerate ( ) {
970
970
let mut variant_cx = fcx. new_temp_block (
971
971
& format ! ( "enum-variant-iter-{}" , & discr. to_string( ) ) [ ]
972
972
) ;
973
973
let rhs_val = C_integral ( ll_inttype ( ccx, ity) , discr as u64 , true ) ;
974
- AddCase ( llswitch, rhs_val, variant_cx. llbb ) ;
974
+ AddCase ( llswitch, rhs_val, variant_cx. data . llbb ) ;
975
975
976
976
let fields = case. fields . iter ( ) . map ( |& ty|
977
977
type_of:: type_of ( bcx. ccx ( ) , ty) ) . collect :: < Vec < _ > > ( ) ;
978
978
let real_ty = Type :: struct_ ( ccx, & fields[ ] , case. packed ) ;
979
979
let variant_value = PointerCast ( variant_cx, value, real_ty. ptr_to ( ) ) ;
980
980
981
981
variant_cx = f ( variant_cx, case, variant_value) ;
982
- Br ( variant_cx, bcx_next. llbb ) ;
982
+ Br ( variant_cx, bcx_next. data . llbb ) ;
983
983
}
984
984
985
985
bcx_next
@@ -989,9 +989,8 @@ pub fn fold_variants<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
989
989
}
990
990
991
991
/// Access the struct drop flag, if present.
992
- pub fn trans_drop_flag_ptr < ' blk , ' tcx > ( mut bcx : Block < ' blk , ' tcx > , r : & Repr < ' tcx > , val : ValueRef )
993
- -> datum:: DatumBlock < ' blk , ' tcx , datum:: Expr >
994
- {
992
+ pub fn trans_drop_flag_ptr < ' fcx , ' blk , ' tcx > ( mut bcx : Block < ' fcx , ' blk , ' tcx > , r : & Repr < ' tcx > , val : ValueRef )
993
+ -> datum:: DatumBlock < ' fcx , ' blk , ' tcx , datum:: Expr > {
995
994
let tcx = bcx. tcx ( ) ;
996
995
let ptr_ty = ty:: mk_imm_ptr ( bcx. tcx ( ) , tcx. types . bool ) ;
997
996
match * r {
0 commit comments