@@ -106,7 +106,7 @@ pub struct Struct {
106
106
* these, for places in trans where the `ty::t` isn't directly
107
107
* available.
108
108
*/
109
- pub fn represent_node ( bcx : block , node : ast:: node_id ) -> @Repr {
109
+ pub fn represent_node ( bcx : @ mut Block , node : ast:: node_id ) -> @Repr {
110
110
represent_type ( bcx. ccx ( ) , node_id_type ( bcx, node) )
111
111
}
112
112
@@ -283,7 +283,7 @@ fn struct_llfields(cx: &mut CrateContext, st: &Struct, sizing: bool) -> ~[Type]
283
283
*
284
284
* This should ideally be less tightly tied to `_match`.
285
285
*/
286
- pub fn trans_switch ( bcx : block , r : & Repr , scrutinee : ValueRef )
286
+ pub fn trans_switch ( bcx : @ mut Block , r : & Repr , scrutinee : ValueRef )
287
287
-> ( _match:: branch_kind , Option < ValueRef > ) {
288
288
match * r {
289
289
CEnum ( * ) | General ( * ) => {
@@ -301,7 +301,7 @@ pub fn trans_switch(bcx: block, r: &Repr, scrutinee: ValueRef)
301
301
302
302
303
303
/// Obtain the actual discriminant of a value.
304
- pub fn trans_get_discr ( bcx : block , r : & Repr , scrutinee : ValueRef )
304
+ pub fn trans_get_discr ( bcx : @ mut Block , r : & Repr , scrutinee : ValueRef )
305
305
-> ValueRef {
306
306
match * r {
307
307
CEnum ( min, max) => load_discr ( bcx, scrutinee, min, max) ,
@@ -315,7 +315,7 @@ pub fn trans_get_discr(bcx: block, r: &Repr, scrutinee: ValueRef)
315
315
}
316
316
}
317
317
318
- fn nullable_bitdiscr ( bcx : block , nonnull : & Struct , nndiscr : int , ptrfield : uint ,
318
+ fn nullable_bitdiscr ( bcx : @ mut Block , nonnull : & Struct , nndiscr : int , ptrfield : uint ,
319
319
scrutinee : ValueRef ) -> ValueRef {
320
320
let cmp = if nndiscr == 0 { IntEQ } else { IntNE } ;
321
321
let llptr = Load ( bcx, GEPi ( bcx, scrutinee, [ 0 , ptrfield] ) ) ;
@@ -324,7 +324,7 @@ fn nullable_bitdiscr(bcx: block, nonnull: &Struct, nndiscr: int, ptrfield: uint,
324
324
}
325
325
326
326
/// Helper for cases where the discriminant is simply loaded.
327
- fn load_discr ( bcx : block , scrutinee : ValueRef , min : int , max : int )
327
+ fn load_discr ( bcx : @ mut Block , scrutinee : ValueRef , min : int , max : int )
328
328
-> ValueRef {
329
329
let ptr = GEPi ( bcx, scrutinee, [ 0 , 0 ] ) ;
330
330
if max + 1 == min {
@@ -348,7 +348,7 @@ fn load_discr(bcx: block, scrutinee: ValueRef, min: int, max: int)
348
348
*
349
349
* This should ideally be less tightly tied to `_match`.
350
350
*/
351
- pub fn trans_case ( bcx : block , r : & Repr , discr : int ) -> _match:: opt_result {
351
+ pub fn trans_case ( bcx : @ mut Block , r : & Repr , discr : int ) -> _match:: opt_result {
352
352
match * r {
353
353
CEnum ( * ) => {
354
354
_match:: single_result ( rslt ( bcx, C_int ( bcx. ccx ( ) , discr) ) )
@@ -371,7 +371,7 @@ pub fn trans_case(bcx: block, r: &Repr, discr: int) -> _match::opt_result {
371
371
* representation. The fields, if any, should then be initialized via
372
372
* `trans_field_ptr`.
373
373
*/
374
- pub fn trans_start_init ( bcx : block , r : & Repr , val : ValueRef , discr : int ) {
374
+ pub fn trans_start_init ( bcx : @ mut Block , r : & Repr , val : ValueRef , discr : int ) {
375
375
match * r {
376
376
CEnum ( min, max) => {
377
377
assert ! ( min <= discr && discr <= max) ;
@@ -417,7 +417,7 @@ pub fn num_args(r: &Repr, discr: int) -> uint {
417
417
}
418
418
419
419
/// Access a field, at a point when the value's case is known.
420
- pub fn trans_field_ptr ( bcx : block , r : & Repr , val : ValueRef , discr : int ,
420
+ pub fn trans_field_ptr ( bcx : @ mut Block , r : & Repr , val : ValueRef , discr : int ,
421
421
ix : uint ) -> ValueRef {
422
422
// Note: if this ever needs to generate conditionals (e.g., if we
423
423
// decide to do some kind of cdr-coding-like non-unique repr
@@ -449,7 +449,7 @@ pub fn trans_field_ptr(bcx: block, r: &Repr, val: ValueRef, discr: int,
449
449
}
450
450
}
451
451
452
- fn struct_field_ptr ( bcx : block , st : & Struct , val : ValueRef , ix : uint ,
452
+ fn struct_field_ptr ( bcx : @ mut Block , st : & Struct , val : ValueRef , ix : uint ,
453
453
needs_cast : bool ) -> ValueRef {
454
454
let ccx = bcx. ccx ( ) ;
455
455
@@ -467,7 +467,7 @@ fn struct_field_ptr(bcx: block, st: &Struct, val: ValueRef, ix: uint,
467
467
}
468
468
469
469
/// Access the struct drop flag, if present.
470
- pub fn trans_drop_flag_ptr ( bcx : block , r : & Repr , val : ValueRef ) -> ValueRef {
470
+ pub fn trans_drop_flag_ptr ( bcx : @ mut Block , r : & Repr , val : ValueRef ) -> ValueRef {
471
471
match * r {
472
472
Univariant ( ref st, true ) => GEPi ( bcx, val, [ 0 , st. fields . len ( ) - 1 ] ) ,
473
473
_ => bcx. ccx ( ) . sess . bug ( "tried to get drop flag of non-droppable type" )
0 commit comments