@@ -111,7 +111,7 @@ pub struct Struct {
111
111
* these, for places in trans where the `ty::t` isn't directly
112
112
* available.
113
113
*/
114
- pub fn represent_node ( bcx : @ Block , node : ast:: NodeId ) -> @Repr {
114
+ pub fn represent_node ( bcx : & Block , node : ast:: NodeId ) -> @Repr {
115
115
represent_type ( bcx. ccx ( ) , node_id_type ( bcx, node) )
116
116
}
117
117
@@ -463,7 +463,7 @@ fn struct_llfields(cx: &CrateContext, st: &Struct, sizing: bool) -> ~[Type] {
463
463
*
464
464
* This should ideally be less tightly tied to `_match`.
465
465
*/
466
- pub fn trans_switch ( bcx : @ Block , r : & Repr , scrutinee : ValueRef )
466
+ pub fn trans_switch ( bcx : & Block , r : & Repr , scrutinee : ValueRef )
467
467
-> ( _match:: branch_kind , Option < ValueRef > ) {
468
468
match * r {
469
469
CEnum ( ..) | General ( ..) => {
@@ -481,7 +481,7 @@ pub fn trans_switch(bcx: @Block, r: &Repr, scrutinee: ValueRef)
481
481
482
482
483
483
/// Obtain the actual discriminant of a value.
484
- pub fn trans_get_discr ( bcx : @ Block , r : & Repr , scrutinee : ValueRef , cast_to : Option < Type > )
484
+ pub fn trans_get_discr ( bcx : & Block , r : & Repr , scrutinee : ValueRef , cast_to : Option < Type > )
485
485
-> ValueRef {
486
486
let signed;
487
487
let val;
@@ -510,7 +510,7 @@ pub fn trans_get_discr(bcx: @Block, r: &Repr, scrutinee: ValueRef, cast_to: Opti
510
510
}
511
511
}
512
512
513
- fn nullable_bitdiscr ( bcx : @ Block , nonnull : & Struct , nndiscr : Disr , ptrfield : uint ,
513
+ fn nullable_bitdiscr ( bcx : & Block , nonnull : & Struct , nndiscr : Disr , ptrfield : uint ,
514
514
scrutinee : ValueRef ) -> ValueRef {
515
515
let cmp = if nndiscr == 0 { IntEQ } else { IntNE } ;
516
516
let llptr = Load ( bcx, GEPi ( bcx, scrutinee, [ 0 , ptrfield] ) ) ;
@@ -519,7 +519,7 @@ fn nullable_bitdiscr(bcx: @Block, nonnull: &Struct, nndiscr: Disr, ptrfield: uin
519
519
}
520
520
521
521
/// Helper for cases where the discriminant is simply loaded.
522
- fn load_discr ( bcx : @ Block , ity : IntType , ptr : ValueRef , min : Disr , max : Disr )
522
+ fn load_discr ( bcx : & Block , ity : IntType , ptr : ValueRef , min : Disr , max : Disr )
523
523
-> ValueRef {
524
524
let llty = ll_inttype ( bcx. ccx ( ) , ity) ;
525
525
assert_eq ! ( val_ty( ptr) , llty. ptr_to( ) ) ;
@@ -547,7 +547,8 @@ fn load_discr(bcx: @Block, ity: IntType, ptr: ValueRef, min: Disr, max: Disr)
547
547
*
548
548
* This should ideally be less tightly tied to `_match`.
549
549
*/
550
- pub fn trans_case ( bcx : @Block , r : & Repr , discr : Disr ) -> _match:: opt_result {
550
+ pub fn trans_case < ' a > ( bcx : & ' a Block < ' a > , r : & Repr , discr : Disr )
551
+ -> _match:: opt_result < ' a > {
551
552
match * r {
552
553
CEnum ( ity, _, _) => {
553
554
_match:: single_result ( rslt ( bcx, C_integral ( ll_inttype ( bcx. ccx ( ) , ity) ,
@@ -572,7 +573,7 @@ pub fn trans_case(bcx: @Block, r: &Repr, discr: Disr) -> _match::opt_result {
572
573
* representation. The fields, if any, should then be initialized via
573
574
* `trans_field_ptr`.
574
575
*/
575
- pub fn trans_start_init ( bcx : @ Block , r : & Repr , val : ValueRef , discr : Disr ) {
576
+ pub fn trans_start_init ( bcx : & Block , r : & Repr , val : ValueRef , discr : Disr ) {
576
577
match * r {
577
578
CEnum ( ity, min, max) => {
578
579
assert_discr_in_range ( ity, min, max, discr) ;
@@ -628,7 +629,7 @@ pub fn num_args(r: &Repr, discr: Disr) -> uint {
628
629
}
629
630
630
631
/// Access a field, at a point when the value's case is known.
631
- pub fn trans_field_ptr ( bcx : @ Block , r : & Repr , val : ValueRef , discr : Disr ,
632
+ pub fn trans_field_ptr ( bcx : & Block , r : & Repr , val : ValueRef , discr : Disr ,
632
633
ix : uint ) -> ValueRef {
633
634
// Note: if this ever needs to generate conditionals (e.g., if we
634
635
// decide to do some kind of cdr-coding-like non-unique repr
@@ -661,7 +662,7 @@ pub fn trans_field_ptr(bcx: @Block, r: &Repr, val: ValueRef, discr: Disr,
661
662
}
662
663
}
663
664
664
- fn struct_field_ptr ( bcx : @ Block , st : & Struct , val : ValueRef , ix : uint ,
665
+ fn struct_field_ptr ( bcx : & Block , st : & Struct , val : ValueRef , ix : uint ,
665
666
needs_cast : bool ) -> ValueRef {
666
667
let ccx = bcx. ccx ( ) ;
667
668
@@ -677,7 +678,7 @@ fn struct_field_ptr(bcx: @Block, st: &Struct, val: ValueRef, ix: uint,
677
678
}
678
679
679
680
/// Access the struct drop flag, if present.
680
- pub fn trans_drop_flag_ptr ( bcx : @ Block , r : & Repr , val : ValueRef ) -> ValueRef {
681
+ pub fn trans_drop_flag_ptr ( bcx : & Block , r : & Repr , val : ValueRef ) -> ValueRef {
681
682
match * r {
682
683
Univariant ( ref st, true ) => GEPi ( bcx, val, [ 0 , st. fields . len ( ) - 1 ] ) ,
683
684
_ => bcx. ccx ( ) . sess . bug ( "tried to get drop flag of non-droppable type" )
0 commit comments