Skip to content

Commit 54fc65c

Browse files
committed
---
yaml --- r: 2200 b: refs/heads/master c: c133551 h: refs/heads/master v: v3
1 parent f6a7e92 commit 54fc65c

File tree

6 files changed

+119
-112
lines changed

6 files changed

+119
-112
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 9eb1479746224625f95b9b76379d18ac1cb72355
2+
refs/heads/master: c1335510d505ade8d1f2805ebf1a2beb5db8de07

trunk/src/comp/front/creader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ fn get_tag_variants(session.session sess,
546546
auto item = find_item(did._1, items);
547547
auto ctor_ty = item_type(item, external_crate_id, tystore);
548548
let vec[@ty.t] arg_tys = vec();
549-
alt (ctor_ty.struct) {
549+
alt (ty.struct(ctor_ty)) {
550550
case (ty.ty_fn(_, ?args, _)) {
551551
for (ty.arg a in args) {
552552
arg_tys += vec(a.ty);

trunk/src/comp/middle/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const uint tag_index_table = 0x15u;
5353
type def_str = fn(ast.def_id) -> str;
5454

5555
fn ty_str(@ty.t t, def_str ds) -> str {
56-
ret sty_str(t.struct, ds);
56+
ret sty_str(ty.struct(t), ds);
5757
}
5858

5959
fn mt_str(&ty.mt mt, def_str ds) -> str {

trunk/src/comp/middle/trans.rs

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ fn type_of_inner(@crate_ctxt cx, @ty.t t) -> TypeRef {
683683

684684
let TypeRef llty = 0 as TypeRef;
685685

686-
alt (t.struct) {
686+
alt (ty.struct(t)) {
687687
case (ty.ty_native) { llty = T_ptr(T_i8()); }
688688
case (ty.ty_nil) { llty = T_nil(); }
689689
case (ty.ty_bool) { llty = T_bool(); }
@@ -789,7 +789,7 @@ fn type_of_inner(@crate_ctxt cx, @ty.t t) -> TypeRef {
789789
}
790790

791791
fn type_of_arg(@local_ctxt cx, &ty.arg arg) -> TypeRef {
792-
alt (arg.ty.struct) {
792+
alt (ty.struct(arg.ty)) {
793793
case (ty.ty_param(_)) {
794794
if (arg.mode == ast.alias) {
795795
ret T_typaram_ptr(cx.ccx.tn);
@@ -811,7 +811,7 @@ fn type_of_arg(@local_ctxt cx, &ty.arg arg) -> TypeRef {
811811

812812
fn type_of_ty_param_count_and_ty(@local_ctxt lcx,
813813
ty.ty_param_count_and_ty tpt) -> TypeRef {
814-
alt (tpt._1.struct) {
814+
alt (ty.struct(tpt._1)) {
815815
case (ty.ty_fn(?proto, ?inputs, ?output)) {
816816
auto llfnty = type_of_fn(lcx.ccx, proto, inputs, output, tpt._0);
817817
ret T_fn_pair(lcx.ccx.tn, llfnty);
@@ -1148,7 +1148,7 @@ fn array_alloca(@block_ctxt cx, TypeRef t, ValueRef n) -> ValueRef {
11481148
// types.
11491149
fn simplify_type(@crate_ctxt ccx, @ty.t typ) -> @ty.t {
11501150
fn simplifier(@crate_ctxt ccx, @ty.t typ) -> @ty.t {
1151-
alt (typ.struct) {
1151+
alt (ty.struct(typ)) {
11521152
case (ty.ty_box(_)) {
11531153
ret ty.mk_imm_box(ccx.tystore, ty.mk_nil(ccx.tystore));
11541154
}
@@ -1172,7 +1172,7 @@ fn static_size_of_tag(@crate_ctxt cx, @ty.t t) -> uint {
11721172

11731173
auto tid;
11741174
let vec[@ty.t] subtys;
1175-
alt (t.struct) {
1175+
alt (ty.struct(t)) {
11761176
case (ty.ty_tag(?tid_, ?subtys_)) {
11771177
tid = tid_;
11781178
subtys = subtys_;
@@ -1232,7 +1232,7 @@ fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result {
12321232
ret res(bcx, off);
12331233
}
12341234

1235-
alt (t.struct) {
1235+
alt (ty.struct(t)) {
12361236
case (ty.ty_param(?p)) {
12371237
auto szptr = field_of_tydesc(cx, t, abi.tydesc_field_size);
12381238
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 {
12871287
}
12881288

12891289
fn dynamic_align_of(@block_ctxt cx, @ty.t t) -> result {
1290-
alt (t.struct) {
1290+
alt (ty.struct(t)) {
12911291
case (ty.ty_param(?p)) {
12921292
auto aptr = field_of_tydesc(cx, t, abi.tydesc_field_align);
12931293
ret res(aptr.bcx, aptr.bcx.build.Load(aptr.val));
@@ -1526,7 +1526,7 @@ fn linearize_ty_params(@block_ctxt cx, @ty.t t) ->
15261526
mutable vec[uint] defs);
15271527

15281528
fn linearizer(@rr r, @ty.t t) {
1529-
alt(t.struct) {
1529+
alt(ty.struct(t)) {
15301530
case (ty.ty_param(?pid)) {
15311531
let bool seen = false;
15321532
for (uint d in r.defs) {
@@ -1797,7 +1797,7 @@ fn incr_refcnt_of_boxed(@block_ctxt cx, ValueRef box_ptr) -> result {
17971797
fn make_drop_glue(@block_ctxt cx, ValueRef v0, @ty.t t) {
17981798
// NB: v0 is an *alias* of type t here, not a direct value.
17991799
auto rslt;
1800-
alt (t.struct) {
1800+
alt (ty.struct(t)) {
18011801
case (ty.ty_str) {
18021802
auto v = cx.build.Load(v0);
18031803
rslt = decr_refcnt_and_if_zero
@@ -2353,7 +2353,7 @@ fn iter_structural_ty_full(@block_ctxt cx,
23532353
ret res(next_cx, r.val);
23542354
}
23552355

2356-
alt (t.struct) {
2356+
alt (ty.struct(t)) {
23572357
case (ty.ty_tup(?args)) {
23582358
let int i = 0;
23592359
for (ty.mt arg in args) {
@@ -2427,7 +2427,7 @@ fn iter_structural_ty_full(@block_ctxt cx,
24272427
if (_vec.len[@ty.t](variant.args) > 0u) {
24282428
// N-ary variant.
24292429
auto fn_ty = variant.ctor_ty;
2430-
alt (fn_ty.struct) {
2430+
alt (ty.struct(fn_ty)) {
24312431
case (ty.ty_fn(_, ?args, _)) {
24322432
auto j = 0;
24332433
for (ty.arg a in args) {
@@ -2623,7 +2623,7 @@ fn iter_sequence(@block_ctxt cx,
26232623
ret iter_sequence_inner(cx, p0, p1, elt_ty, f);
26242624
}
26252625

2626-
alt (t.struct) {
2626+
alt (ty.struct(t)) {
26272627
case (ty.ty_vec(?elt)) {
26282628
ret iter_sequence_body(cx, v, elt.ty, f, false);
26292629
}
@@ -2850,7 +2850,7 @@ fn trans_lit(@crate_ctxt cx, &ast.lit lit, &ast.ann ann) -> ValueRef {
28502850
}
28512851

28522852
fn target_type(@crate_ctxt cx, @ty.t t) -> @ty.t {
2853-
alt (t.struct) {
2853+
alt (ty.struct(t)) {
28542854
case (ty.ty_int) {
28552855
auto struct_ty = ty.mk_mach(cx.tystore,
28562856
cx.sess.get_targ_cfg().int_type);
@@ -2914,7 +2914,7 @@ fn trans_unary(@block_ctxt cx, ast.unop op,
29142914
case (ast.neg) {
29152915
sub = autoderef(sub.bcx, sub.val,
29162916
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) {
29182918
ret res(sub.bcx, sub.bcx.build.FNeg(sub.val));
29192919
}
29202920
else {
@@ -3005,7 +3005,7 @@ fn trans_vec_append(@block_ctxt cx, @ty.t t,
30053005
auto elt_ty = ty.sequence_element_type(cx.fcx.lcx.ccx.tystore, t);
30063006

30073007
auto skip_null = C_bool(false);
3008-
alt (t.struct) {
3008+
alt (ty.struct(t)) {
30093009
case (ty.ty_str) { skip_null = C_bool(true); }
30103010
case (_) { }
30113011
}
@@ -3045,7 +3045,7 @@ fn trans_eager_binop(@block_ctxt cx, ast.binop op, @ty.t intype,
30453045
ValueRef lhs, ValueRef rhs) -> result {
30463046

30473047
auto is_float = false;
3048-
alt (intype.struct) {
3048+
alt (ty.struct(intype)) {
30493049
case (ty.ty_float) {
30503050
is_float = true;
30513051
}
@@ -3123,7 +3123,7 @@ fn autoderef(@block_ctxt cx, ValueRef v, @ty.t t) -> result {
31233123
let @ty.t t1 = t;
31243124

31253125
while (true) {
3126-
alt (t1.struct) {
3126+
alt (ty.struct(t1)) {
31273127
case (ty.ty_box(?mt)) {
31283128
auto body = cx.build.GEP(v1,
31293129
vec(C_int(0),
@@ -3154,7 +3154,7 @@ fn autoderefed_ty(@ty.t t) -> @ty.t {
31543154
let @ty.t t1 = t;
31553155

31563156
while (true) {
3157-
alt (t1.struct) {
3157+
alt (ty.struct(t1)) {
31583158
case (ty.ty_box(?mt)) {
31593159
t1 = mt.ty;
31603160
}
@@ -3990,7 +3990,7 @@ fn trans_path(@block_ctxt cx, &ast.path p, &option.t[ast.def] dopt,
39903990
auto v_tyt = ty.lookup_item_type(cx.fcx.lcx.ccx.sess,
39913991
cx.fcx.lcx.ccx.tystore,
39923992
cx.fcx.lcx.ccx.type_cache, vid);
3993-
alt (v_tyt._1.struct) {
3993+
alt (ty.struct(v_tyt._1)) {
39943994
case (ty.ty_fn(_, _, _)) {
39953995
// N-ary variant.
39963996
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,
40524052
auto r = autoderef(cx, v, t0);
40534053
auto t = autoderefed_ty(t0);
40544054

4055-
alt (t.struct) {
4055+
alt (ty.struct(t)) {
40564056
case (ty.ty_tup(_)) {
40574057
let uint ix = ty.field_num(cx.fcx.lcx.ccx.sess, sp, field);
40584058
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,
48204820
&ast.ann ann) -> result {
48214821
auto t = node_ann_type(cx.fcx.lcx.ccx, ann);
48224822
auto unit_ty = t;
4823-
alt (t.struct) {
4823+
alt (ty.struct(t)) {
48244824
case (ty.ty_vec(?mt)) {
48254825
unit_ty = mt.ty;
48264826
}
@@ -4914,7 +4914,7 @@ fn trans_rec(@block_ctxt cx, vec[ast.field] fields,
49144914
}
49154915

49164916
let vec[ty.field] ty_fields = vec();
4917-
alt (t.struct) {
4917+
alt (ty.struct(t)) {
49184918
case (ty.ty_rec(?flds)) { ty_fields = flds; }
49194919
}
49204920

@@ -5170,7 +5170,7 @@ fn trans_log(int lvl, @block_ctxt cx, @ast.expr e) -> result {
51705170
if (ty.type_is_fp(e_ty)) {
51715171
let TypeRef tr;
51725172
let bool is32bit = false;
5173-
alt (e_ty.struct) {
5173+
alt (ty.struct(e_ty)) {
51745174
case (ty.ty_machine(util.common.ty_f32)) {
51755175
tr = T_f32();
51765176
is32bit = true;
@@ -5196,7 +5196,7 @@ fn trans_log(int lvl, @block_ctxt cx, @ast.expr e) -> result {
51965196
uval.bcx.build.Br(after_cx.llbb);
51975197
}
51985198
} else {
5199-
alt (e_ty.struct) {
5199+
alt (ty.struct(e_ty)) {
52005200
case (ty.ty_str) {
52015201
auto v = vp2i(sub.bcx, sub.val);
52025202
trans_upcall(sub.bcx,
@@ -5382,7 +5382,7 @@ fn trans_port(@block_ctxt cx, ast.ann ann) -> result {
53825382

53835383
auto t = node_ann_type(cx.fcx.lcx.ccx, ann);
53845384
auto unit_ty;
5385-
alt (t.struct) {
5385+
alt (ty.struct(t)) {
53865386
case (ty.ty_port(?t)) {
53875387
unit_ty = t;
53885388
}
@@ -5437,7 +5437,7 @@ fn trans_send(@block_ctxt cx, @ast.expr lhs, @ast.expr rhs,
54375437

54385438
auto chan_ty = node_ann_type(cx.fcx.lcx.ccx, ann);
54395439
auto unit_ty;
5440-
alt (chan_ty.struct) {
5440+
alt (ty.struct(chan_ty)) {
54415441
case (ty.ty_chan(?t)) {
54425442
unit_ty = t;
54435443
}
@@ -5915,7 +5915,7 @@ fn is_terminated(@block_ctxt cx) -> bool {
59155915
}
59165916

59175917
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))) {
59195919
case (ty.ty_fn(_, ?arg_tys, _)) {
59205920
ret arg_tys;
59215921
}
@@ -5924,7 +5924,7 @@ fn arg_tys_of_fn(ast.ann ann) -> vec[ty.arg] {
59245924
}
59255925

59265926
fn ret_ty_of_fn_ty(@ty.t t) -> @ty.t {
5927-
alt (t.struct) {
5927+
alt (ty.struct(t)) {
59285928
case (ty.ty_fn(_, _, ?ret_ty)) {
59295929
ret ret_ty;
59305930
}
@@ -6060,7 +6060,7 @@ fn trans_vtbl(@local_ctxt cx,
60606060
for (@ast.method m in meths) {
60616061

60626062
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))) {
60646064
case (ty.ty_fn(?proto, ?inputs, ?output)) {
60656065
llfnty = type_of_fn_full(cx.ccx, proto,
60666066
some[TypeRef](llself_ty),
@@ -6099,7 +6099,7 @@ fn trans_dtor(@local_ctxt cx,
60996099
&@ast.method dtor) -> ValueRef {
61006100

61016101
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))) {
61036103
case (ty.ty_fn(?proto, ?inputs, ?output)) {
61046104
llfnty = type_of_fn_full(cx.ccx, proto,
61056105
some[TypeRef](llself_ty),
@@ -6423,7 +6423,7 @@ fn decl_fn_and_pair(@crate_ctxt ccx,
64236423

64246424
auto llfty;
64256425
auto llpairty;
6426-
alt (node_ann_type(ccx, ann).struct) {
6426+
alt (ty.struct(node_ann_type(ccx, ann))) {
64276427
case (ty.ty_fn(?proto, ?inputs, ?output)) {
64286428
llfty = type_of_fn(ccx, proto, inputs, output,
64296429
_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 {
64826482

64836483
fn native_fn_wrapper_type(@crate_ctxt cx, uint ty_param_count, @ty.t x)
64846484
-> TypeRef {
6485-
alt (x.struct) {
6485+
alt (ty.struct(x)) {
64866486
case (ty.ty_native_fn(?abi, ?args, ?out)) {
64876487
ret type_of_fn(cx, ast.proto_fn, args, out, ty_param_count);
64886488
}

0 commit comments

Comments
 (0)