@@ -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 : @mut 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
@@ -458,7 +458,7 @@ fn struct_llfields(cx: &mut CrateContext, st: &Struct, sizing: bool) -> ~[Type]
458
458
*
459
459
* This should ideally be less tightly tied to `_match`.
460
460
*/
461
- pub fn trans_switch ( bcx : @mut Block , r : & Repr , scrutinee : ValueRef )
461
+ pub fn trans_switch ( bcx : @Block , r : & Repr , scrutinee : ValueRef )
462
462
-> ( _match:: branch_kind , Option < ValueRef > ) {
463
463
match * r {
464
464
CEnum ( ..) | General ( ..) => {
@@ -476,7 +476,7 @@ pub fn trans_switch(bcx: @mut Block, r: &Repr, scrutinee: ValueRef)
476
476
477
477
478
478
/// Obtain the actual discriminant of a value.
479
- pub fn trans_get_discr ( bcx : @mut Block , r : & Repr , scrutinee : ValueRef , cast_to : Option < Type > )
479
+ pub fn trans_get_discr ( bcx : @Block , r : & Repr , scrutinee : ValueRef , cast_to : Option < Type > )
480
480
-> ValueRef {
481
481
let signed;
482
482
let val;
@@ -505,7 +505,7 @@ pub fn trans_get_discr(bcx: @mut Block, r: &Repr, scrutinee: ValueRef, cast_to:
505
505
}
506
506
}
507
507
508
- fn nullable_bitdiscr ( bcx : @mut Block , nonnull : & Struct , nndiscr : Disr , ptrfield : uint ,
508
+ fn nullable_bitdiscr ( bcx : @Block , nonnull : & Struct , nndiscr : Disr , ptrfield : uint ,
509
509
scrutinee : ValueRef ) -> ValueRef {
510
510
let cmp = if nndiscr == 0 { IntEQ } else { IntNE } ;
511
511
let llptr = Load ( bcx, GEPi ( bcx, scrutinee, [ 0 , ptrfield] ) ) ;
@@ -514,7 +514,7 @@ fn nullable_bitdiscr(bcx: @mut Block, nonnull: &Struct, nndiscr: Disr, ptrfield:
514
514
}
515
515
516
516
/// Helper for cases where the discriminant is simply loaded.
517
- fn load_discr ( bcx : @mut Block , ity : IntType , ptr : ValueRef , min : Disr , max : Disr )
517
+ fn load_discr ( bcx : @Block , ity : IntType , ptr : ValueRef , min : Disr , max : Disr )
518
518
-> ValueRef {
519
519
let llty = ll_inttype ( bcx. ccx ( ) , ity) ;
520
520
assert_eq ! ( val_ty( ptr) , llty. ptr_to( ) ) ;
@@ -542,7 +542,7 @@ fn load_discr(bcx: @mut Block, ity: IntType, ptr: ValueRef, min: Disr, max: Disr
542
542
*
543
543
* This should ideally be less tightly tied to `_match`.
544
544
*/
545
- pub fn trans_case ( bcx : @mut Block , r : & Repr , discr : Disr ) -> _match:: opt_result {
545
+ pub fn trans_case ( bcx : @Block , r : & Repr , discr : Disr ) -> _match:: opt_result {
546
546
match * r {
547
547
CEnum ( ity, _, _) => {
548
548
_match:: single_result ( rslt ( bcx, C_integral ( ll_inttype ( bcx. ccx ( ) , ity) ,
@@ -567,7 +567,7 @@ pub fn trans_case(bcx: @mut Block, r: &Repr, discr: Disr) -> _match::opt_result
567
567
* representation. The fields, if any, should then be initialized via
568
568
* `trans_field_ptr`.
569
569
*/
570
- pub fn trans_start_init ( bcx : @mut Block , r : & Repr , val : ValueRef , discr : Disr ) {
570
+ pub fn trans_start_init ( bcx : @Block , r : & Repr , val : ValueRef , discr : Disr ) {
571
571
match * r {
572
572
CEnum ( ity, min, max) => {
573
573
assert_discr_in_range ( ity, min, max, discr) ;
@@ -623,7 +623,7 @@ pub fn num_args(r: &Repr, discr: Disr) -> uint {
623
623
}
624
624
625
625
/// Access a field, at a point when the value's case is known.
626
- pub fn trans_field_ptr ( bcx : @mut Block , r : & Repr , val : ValueRef , discr : Disr ,
626
+ pub fn trans_field_ptr ( bcx : @Block , r : & Repr , val : ValueRef , discr : Disr ,
627
627
ix : uint ) -> ValueRef {
628
628
// Note: if this ever needs to generate conditionals (e.g., if we
629
629
// decide to do some kind of cdr-coding-like non-unique repr
@@ -656,7 +656,7 @@ pub fn trans_field_ptr(bcx: @mut Block, r: &Repr, val: ValueRef, discr: Disr,
656
656
}
657
657
}
658
658
659
- fn struct_field_ptr ( bcx : @mut Block , st : & Struct , val : ValueRef , ix : uint ,
659
+ fn struct_field_ptr ( bcx : @Block , st : & Struct , val : ValueRef , ix : uint ,
660
660
needs_cast : bool ) -> ValueRef {
661
661
let ccx = bcx. ccx ( ) ;
662
662
@@ -672,7 +672,7 @@ fn struct_field_ptr(bcx: @mut Block, st: &Struct, val: ValueRef, ix: uint,
672
672
}
673
673
674
674
/// Access the struct drop flag, if present.
675
- pub fn trans_drop_flag_ptr ( bcx : @mut Block , r : & Repr , val : ValueRef ) -> ValueRef {
675
+ pub fn trans_drop_flag_ptr ( bcx : @Block , r : & Repr , val : ValueRef ) -> ValueRef {
676
676
match * r {
677
677
Univariant ( ref st, true ) => GEPi ( bcx, val, [ 0 , st. fields . len ( ) - 1 ] ) ,
678
678
_ => bcx. ccx ( ) . sess . bug ( "tried to get drop flag of non-droppable type" )
0 commit comments