@@ -683,7 +683,7 @@ fn type_of_inner(@crate_ctxt cx, @ty.t t) -> TypeRef {
683
683
684
684
let TypeRef llty = 0 as TypeRef ;
685
685
686
- alt ( t . struct ) {
686
+ alt ( ty . struct ( t ) ) {
687
687
case ( ty. ty_native ) { llty = T_ptr ( T_i8 ( ) ) ; }
688
688
case ( ty. ty_nil ) { llty = T_nil ( ) ; }
689
689
case ( ty. ty_bool ) { llty = T_bool ( ) ; }
@@ -789,7 +789,7 @@ fn type_of_inner(@crate_ctxt cx, @ty.t t) -> TypeRef {
789
789
}
790
790
791
791
fn type_of_arg ( @local_ctxt cx , & ty. arg arg ) -> TypeRef {
792
- alt ( arg . ty . struct ) {
792
+ alt ( ty. struct ( arg . ty ) ) {
793
793
case ( ty. ty_param ( _) ) {
794
794
if ( arg. mode == ast. alias ) {
795
795
ret T_typaram_ptr ( cx. ccx . tn ) ;
@@ -811,7 +811,7 @@ fn type_of_arg(@local_ctxt cx, &ty.arg arg) -> TypeRef {
811
811
812
812
fn type_of_ty_param_count_and_ty ( @local_ctxt lcx ,
813
813
ty. ty_param_count_and_ty tpt ) -> TypeRef {
814
- alt ( tpt. _1 . struct ) {
814
+ alt ( ty . struct ( tpt. _1 ) ) {
815
815
case ( ty. ty_fn ( ?proto, ?inputs, ?output) ) {
816
816
auto llfnty = type_of_fn ( lcx. ccx , proto, inputs, output, tpt. _0 ) ;
817
817
ret T_fn_pair ( lcx. ccx . tn , llfnty) ;
@@ -1148,7 +1148,7 @@ fn array_alloca(@block_ctxt cx, TypeRef t, ValueRef n) -> ValueRef {
1148
1148
// types.
1149
1149
fn simplify_type ( @crate_ctxt ccx , @ty. t typ ) -> @ty. t {
1150
1150
fn simplifier ( @crate_ctxt ccx , @ty. t typ ) -> @ty. t {
1151
- alt ( typ . struct ) {
1151
+ alt ( ty . struct ( typ ) ) {
1152
1152
case ( ty. ty_box ( _) ) {
1153
1153
ret ty. mk_imm_box ( ccx. tystore , ty. mk_nil ( ccx. tystore ) ) ;
1154
1154
}
@@ -1172,7 +1172,7 @@ fn static_size_of_tag(@crate_ctxt cx, @ty.t t) -> uint {
1172
1172
1173
1173
auto tid;
1174
1174
let vec[ @ty. t] subtys;
1175
- alt ( t . struct ) {
1175
+ alt ( ty . struct ( t ) ) {
1176
1176
case ( ty. ty_tag ( ?tid_, ?subtys_) ) {
1177
1177
tid = tid_;
1178
1178
subtys = subtys_;
@@ -1232,7 +1232,7 @@ fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result {
1232
1232
ret res( bcx, off) ;
1233
1233
}
1234
1234
1235
- alt ( t . struct ) {
1235
+ alt ( ty . struct ( t ) ) {
1236
1236
case ( ty. ty_param( ?p) ) {
1237
1237
auto szptr = field_of_tydesc( cx, t, abi. tydesc_field_size) ;
1238
1238
ret res( szptr. bcx, szptr. bcx. build. Load ( szptr. val) ) ;
@@ -1287,7 +1287,7 @@ fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result {
1287
1287
}
1288
1288
1289
1289
fn dynamic_align_of( @block_ctxt cx, @ty. t t) -> result {
1290
- alt ( t . struct ) {
1290
+ alt ( ty . struct ( t ) ) {
1291
1291
case ( ty. ty_param( ?p) ) {
1292
1292
auto aptr = field_of_tydesc( cx, t, abi. tydesc_field_align) ;
1293
1293
ret res( aptr. bcx, aptr. bcx. build. Load ( aptr. val) ) ;
@@ -1526,7 +1526,7 @@ fn linearize_ty_params(@block_ctxt cx, @ty.t t) ->
1526
1526
mutable vec[ uint] defs) ;
1527
1527
1528
1528
fn linearizer( @rr r, @ty. t t) {
1529
- alt( t . struct ) {
1529
+ alt( ty . struct ( t ) ) {
1530
1530
case ( ty. ty_param( ?pid) ) {
1531
1531
let bool seen = false ;
1532
1532
for ( uint d in r. defs) {
@@ -1797,7 +1797,7 @@ fn incr_refcnt_of_boxed(@block_ctxt cx, ValueRef box_ptr) -> result {
1797
1797
fn make_drop_glue ( @block_ctxt cx , ValueRef v0, @ty. t t ) {
1798
1798
// NB: v0 is an *alias* of type t here, not a direct value.
1799
1799
auto rslt;
1800
- alt ( t . struct ) {
1800
+ alt ( ty . struct ( t ) ) {
1801
1801
case ( ty. ty_str ) {
1802
1802
auto v = cx. build . Load ( v0) ;
1803
1803
rslt = decr_refcnt_and_if_zero
@@ -2353,7 +2353,7 @@ fn iter_structural_ty_full(@block_ctxt cx,
2353
2353
ret res ( next_cx, r. val ) ;
2354
2354
}
2355
2355
2356
- alt ( t . struct ) {
2356
+ alt ( ty . struct ( t ) ) {
2357
2357
case ( ty. ty_tup ( ?args) ) {
2358
2358
let int i = 0 ;
2359
2359
for ( ty. mt arg in args) {
@@ -2427,7 +2427,7 @@ fn iter_structural_ty_full(@block_ctxt cx,
2427
2427
if ( _vec. len[ @ty. t] ( variant. args) > 0 u) {
2428
2428
// N-ary variant.
2429
2429
auto fn_ty = variant. ctor_ty;
2430
- alt ( fn_ty . struct ) {
2430
+ alt ( ty . struct ( fn_ty ) ) {
2431
2431
case ( ty. ty_fn( _, ?args, _) ) {
2432
2432
auto j = 0 ;
2433
2433
for ( ty. arg a in args) {
@@ -2623,7 +2623,7 @@ fn iter_sequence(@block_ctxt cx,
2623
2623
ret iter_sequence_inner( cx, p0, p1, elt_ty, f) ;
2624
2624
}
2625
2625
2626
- alt ( t . struct ) {
2626
+ alt ( ty . struct ( t ) ) {
2627
2627
case ( ty. ty_vec( ?elt) ) {
2628
2628
ret iter_sequence_body( cx, v, elt. ty, f, false) ;
2629
2629
}
@@ -2850,7 +2850,7 @@ fn trans_lit(@crate_ctxt cx, &ast.lit lit, &ast.ann ann) -> ValueRef {
2850
2850
}
2851
2851
2852
2852
fn target_type( @crate_ctxt cx, @ty. t t) -> @ty. t {
2853
- alt ( t . struct ) {
2853
+ alt ( ty . struct ( t ) ) {
2854
2854
case ( ty. ty_int) {
2855
2855
auto struct_ty = ty. mk_mach( cx. tystore,
2856
2856
cx. sess. get_targ_cfg( ) . int_type) ;
@@ -2914,7 +2914,7 @@ fn trans_unary(@block_ctxt cx, ast.unop op,
2914
2914
case ( ast. neg) {
2915
2915
sub = autoderef( sub. bcx, sub. val,
2916
2916
ty. expr_ty( cx. fcx. lcx. ccx. tystore, e) ) ;
2917
- if ( e_ty . struct == ty. ty_float) {
2917
+ if ( ty . struct ( e_ty ) == ty. ty_float) {
2918
2918
ret res( sub. bcx, sub. bcx. build. FNeg ( sub. val) ) ;
2919
2919
}
2920
2920
else {
@@ -3005,7 +3005,7 @@ fn trans_vec_append(@block_ctxt cx, @ty.t t,
3005
3005
auto elt_ty = ty. sequence_element_type( cx. fcx. lcx. ccx. tystore, t) ;
3006
3006
3007
3007
auto skip_null = C_bool ( false) ;
3008
- alt ( t . struct ) {
3008
+ alt ( ty . struct ( t ) ) {
3009
3009
case ( ty. ty_str) { skip_null = C_bool ( true) ; }
3010
3010
case ( _) { }
3011
3011
}
@@ -3045,7 +3045,7 @@ fn trans_eager_binop(@block_ctxt cx, ast.binop op, @ty.t intype,
3045
3045
ValueRef lhs, ValueRef rhs) -> result {
3046
3046
3047
3047
auto is_float = false;
3048
- alt ( intype . struct ) {
3048
+ alt ( ty . struct ( intype ) ) {
3049
3049
case ( ty. ty_float) {
3050
3050
is_float = true;
3051
3051
}
@@ -3123,7 +3123,7 @@ fn autoderef(@block_ctxt cx, ValueRef v, @ty.t t) -> result {
3123
3123
let @ty. t t1 = t;
3124
3124
3125
3125
while ( true) {
3126
- alt ( t1 . struct ) {
3126
+ alt ( ty . struct ( t1 ) ) {
3127
3127
case ( ty. ty_box( ?mt) ) {
3128
3128
auto body = cx. build. GEP ( v1,
3129
3129
vec( C_int ( 0 ) ,
@@ -3154,7 +3154,7 @@ fn autoderefed_ty(@ty.t t) -> @ty.t {
3154
3154
let @ty. t t1 = t;
3155
3155
3156
3156
while ( true) {
3157
- alt ( t1 . struct ) {
3157
+ alt ( ty . struct ( t1 ) ) {
3158
3158
case ( ty. ty_box( ?mt) ) {
3159
3159
t1 = mt. ty;
3160
3160
}
@@ -3990,7 +3990,7 @@ fn trans_path(@block_ctxt cx, &ast.path p, &option.t[ast.def] dopt,
3990
3990
auto v_tyt = ty. lookup_item_type( cx. fcx. lcx. ccx. sess,
3991
3991
cx. fcx. lcx. ccx. tystore,
3992
3992
cx. fcx. lcx. ccx. type_cache, vid) ;
3993
- alt ( v_tyt. _1. struct ) {
3993
+ alt ( ty . struct ( v_tyt. _1) ) {
3994
3994
case ( ty. ty_fn( _, _, _) ) {
3995
3995
// N-ary variant.
3996
3996
ret lval_generic_fn( cx, v_tyt, vid, ann) ;
@@ -4052,7 +4052,7 @@ fn trans_field(@block_ctxt cx, &ast.span sp, ValueRef v, @ty.t t0,
4052
4052
auto r = autoderef( cx, v, t0) ;
4053
4053
auto t = autoderefed_ty( t0) ;
4054
4054
4055
- alt ( t . struct ) {
4055
+ alt ( ty . struct ( t ) ) {
4056
4056
case ( ty. ty_tup( _) ) {
4057
4057
let uint ix = ty. field_num( cx. fcx. lcx. ccx. sess, sp, field) ;
4058
4058
auto v = GEP_tup_like ( r. bcx, t, r. val, vec( 0 , ix as int) ) ;
@@ -4820,7 +4820,7 @@ fn trans_vec(@block_ctxt cx, vec[@ast.expr] args,
4820
4820
& ast. ann ann) -> result {
4821
4821
auto t = node_ann_type( cx. fcx. lcx. ccx, ann) ;
4822
4822
auto unit_ty = t;
4823
- alt ( t . struct ) {
4823
+ alt ( ty . struct ( t ) ) {
4824
4824
case ( ty. ty_vec( ?mt) ) {
4825
4825
unit_ty = mt. ty;
4826
4826
}
@@ -4914,7 +4914,7 @@ fn trans_rec(@block_ctxt cx, vec[ast.field] fields,
4914
4914
}
4915
4915
4916
4916
let vec[ ty. field] ty_fields = vec( ) ;
4917
- alt ( t . struct ) {
4917
+ alt ( ty . struct ( t ) ) {
4918
4918
case ( ty. ty_rec( ?flds) ) { ty_fields = flds; }
4919
4919
}
4920
4920
@@ -5170,7 +5170,7 @@ fn trans_log(int lvl, @block_ctxt cx, @ast.expr e) -> result {
5170
5170
if ( ty. type_is_fp( e_ty) ) {
5171
5171
let TypeRef tr;
5172
5172
let bool is32bit = false ;
5173
- alt ( e_ty . struct ) {
5173
+ alt ( ty . struct ( e_ty ) ) {
5174
5174
case ( ty. ty_machine( util. common. ty_f32) ) {
5175
5175
tr = T_f32 ( ) ;
5176
5176
is32bit = true ;
@@ -5196,7 +5196,7 @@ fn trans_log(int lvl, @block_ctxt cx, @ast.expr e) -> result {
5196
5196
uval. bcx. build. Br ( after_cx. llbb) ;
5197
5197
}
5198
5198
} else {
5199
- alt ( e_ty . struct ) {
5199
+ alt ( ty . struct ( e_ty ) ) {
5200
5200
case ( ty. ty_str) {
5201
5201
auto v = vp2i( sub. bcx, sub. val) ;
5202
5202
trans_upcall( sub. bcx,
@@ -5382,7 +5382,7 @@ fn trans_port(@block_ctxt cx, ast.ann ann) -> result {
5382
5382
5383
5383
auto t = node_ann_type( cx. fcx. lcx. ccx, ann) ;
5384
5384
auto unit_ty;
5385
- alt ( t . struct ) {
5385
+ alt ( ty . struct ( t ) ) {
5386
5386
case ( ty. ty_port( ?t) ) {
5387
5387
unit_ty = t;
5388
5388
}
@@ -5437,7 +5437,7 @@ fn trans_send(@block_ctxt cx, @ast.expr lhs, @ast.expr rhs,
5437
5437
5438
5438
auto chan_ty = node_ann_type( cx. fcx. lcx. ccx, ann) ;
5439
5439
auto unit_ty;
5440
- alt ( chan_ty . struct ) {
5440
+ alt ( ty . struct ( chan_ty ) ) {
5441
5441
case ( ty. ty_chan( ?t) ) {
5442
5442
unit_ty = t;
5443
5443
}
@@ -5915,7 +5915,7 @@ fn is_terminated(@block_ctxt cx) -> bool {
5915
5915
}
5916
5916
5917
5917
fn arg_tys_of_fn( ast. ann ann) -> vec[ ty. arg] {
5918
- alt ( ty. ann_to_type( ann) . struct ) {
5918
+ alt ( ty. struct ( ty . ann_to_type( ann) ) ) {
5919
5919
case ( ty. ty_fn( _, ?arg_tys, _) ) {
5920
5920
ret arg_tys;
5921
5921
}
@@ -5924,7 +5924,7 @@ fn arg_tys_of_fn(ast.ann ann) -> vec[ty.arg] {
5924
5924
}
5925
5925
5926
5926
fn ret_ty_of_fn_ty( @ty. t t) -> @ty. t {
5927
- alt ( t . struct ) {
5927
+ alt ( ty . struct ( t ) ) {
5928
5928
case ( ty. ty_fn( _, _, ?ret_ty) ) {
5929
5929
ret ret_ty;
5930
5930
}
@@ -6060,7 +6060,7 @@ fn trans_vtbl(@local_ctxt cx,
6060
6060
for ( @ast. method m in meths) {
6061
6061
6062
6062
auto llfnty = T_nil ( ) ;
6063
- alt ( node_ann_type( cx. ccx, m. node. ann) . struct ) {
6063
+ alt ( ty . struct ( node_ann_type( cx. ccx, m. node. ann) ) ) {
6064
6064
case ( ty. ty_fn( ?proto, ?inputs, ?output) ) {
6065
6065
llfnty = type_of_fn_full( cx. ccx, proto,
6066
6066
some[ TypeRef ] ( llself_ty) ,
@@ -6099,7 +6099,7 @@ fn trans_dtor(@local_ctxt cx,
6099
6099
& @ast. method dtor) -> ValueRef {
6100
6100
6101
6101
auto llfnty = T_nil ( ) ;
6102
- alt ( node_ann_type( cx. ccx, dtor. node. ann) . struct ) {
6102
+ alt ( ty . struct ( node_ann_type( cx. ccx, dtor. node. ann) ) ) {
6103
6103
case ( ty. ty_fn( ?proto, ?inputs, ?output) ) {
6104
6104
llfnty = type_of_fn_full( cx. ccx, proto,
6105
6105
some[ TypeRef ] ( llself_ty) ,
@@ -6423,7 +6423,7 @@ fn decl_fn_and_pair(@crate_ctxt ccx,
6423
6423
6424
6424
auto llfty;
6425
6425
auto llpairty;
6426
- alt ( node_ann_type( ccx, ann) . struct ) {
6426
+ alt ( ty . struct ( node_ann_type( ccx, ann) ) ) {
6427
6427
case ( ty. ty_fn( ?proto, ?inputs, ?output) ) {
6428
6428
llfty = type_of_fn( ccx, proto, inputs, output,
6429
6429
_vec. len[ ast. ty_param] ( ty_params) ) ;
@@ -6482,7 +6482,7 @@ fn native_fn_ty_param_count(@crate_ctxt cx, &ast.def_id id) -> uint {
6482
6482
6483
6483
fn native_fn_wrapper_type( @crate_ctxt cx, uint ty_param_count, @ty. t x)
6484
6484
-> TypeRef {
6485
- alt ( x . struct ) {
6485
+ alt ( ty . struct ( x ) ) {
6486
6486
case ( ty. ty_native_fn( ?abi, ?args, ?out) ) {
6487
6487
ret type_of_fn( cx, ast. proto_fn, args, out, ty_param_count) ;
6488
6488
}
0 commit comments