Skip to content

Commit 564b95b

Browse files
committed
---
yaml --- r: 4801 b: refs/heads/master c: c2d2dad h: refs/heads/master i: 4799: f747cd9 v: v3
1 parent 25256a5 commit 564b95b

File tree

13 files changed

+6
-158
lines changed

13 files changed

+6
-158
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: ec898244f7b543dfe4c5a04fd42e638d7c521f7b
2+
refs/heads/master: c2d2dad093401ad97f19f96def0aa3f3f2a863bb

trunk/src/comp/metadata/tydecode.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
217217
'@' { ret ty::mk_box(st.tcx, parse_mt(st, sd)); }
218218
'~' { ret ty::mk_uniq(st.tcx, parse_ty(st, sd)); }
219219
'*' { ret ty::mk_ptr(st.tcx, parse_mt(st, sd)); }
220-
'V' { ret ty::mk_vec(st.tcx, parse_mt(st, sd)); }
221220
'I' { ret ty::mk_ivec(st.tcx, parse_mt(st, sd)); }
222221
'R' {
223222
assert (next(st) as char == '[');

trunk/src/comp/metadata/tyencode.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
128128
ty::ty_box(mt) { w.write_char('@'); enc_mt(w, cx, mt); }
129129
ty::ty_uniq(t) { w.write_char('~'); enc_ty(w, cx, t); }
130130
ty::ty_ptr(mt) { w.write_char('*'); enc_mt(w, cx, mt); }
131-
ty::ty_vec(mt) { w.write_char('V'); enc_mt(w, cx, mt); }
132131
ty::ty_ivec(mt) { w.write_char('I'); enc_mt(w, cx, mt); }
133132
ty::ty_rec(fields) {
134133
w.write_str("R[");

trunk/src/comp/middle/alias.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ fn check_for(cx: &ctx, local: &@ast::local, seq: &@ast::expr, blk: &ast::blk,
364364
// If this is a mutable vector, don't allow it to be touched.
365365
let seq_t = ty::expr_ty(cx.tcx, seq);
366366
alt ty::struct(cx.tcx, seq_t) {
367-
ty::ty_vec(mt) | ty::ty_ivec(mt) {
367+
ty::ty_ivec(mt) {
368368
if mt.mut != ast::imm { unsafe = ~[seq_t]; }
369369
}
370370
ty::ty_str. | ty::ty_istr. {/* no-op */ }
@@ -584,12 +584,6 @@ fn expr_root(cx: &ctx, ex: @ast::expr, autoderef: bool) ->
584584
ast::expr_index(base, _) {
585585
let auto_unbox = maybe_auto_unbox(cx, ty::expr_ty(cx.tcx, base));
586586
alt ty::struct(cx.tcx, auto_unbox.t) {
587-
ty::ty_vec(mt) {
588-
ds +=
589-
~[@{mut: mt.mut != ast::imm,
590-
kind: index,
591-
outer_t: auto_unbox.t}];
592-
}
593587
ty::ty_ivec(mt) {
594588
ds +=
595589
~[@{mut: mt.mut != ast::imm,
@@ -666,7 +660,7 @@ fn ty_can_unsafely_include(cx: &ctx, needle: ty::t, haystack: ty::t,
666660
}
667661
ret false;
668662
}
669-
ty::ty_box(mt) | ty::ty_vec(mt) | ty::ty_ptr(mt) {
663+
ty::ty_box(mt) | ty::ty_ptr(mt) {
670664
ret helper(tcx, needle, mt.ty, get_mut(mut, mt));
671665
}
672666
ty::ty_uniq(t) { ret helper(tcx, needle, t, false); }

trunk/src/comp/middle/gc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fn type_is_gc_relevant(cx: &ty::ctxt, ty: &ty::t) -> bool {
130130
ty::ty_ivec(tm) { ret type_is_gc_relevant(cx, tm.ty); }
131131
ty::ty_constr(sub, _) { ret type_is_gc_relevant(cx, sub); }
132132

133-
ty::ty_str. | ty::ty_box(_) | ty::ty_uniq(_) | ty::ty_vec(_) |
133+
ty::ty_str. | ty::ty_box(_) | ty::ty_uniq(_) |
134134
ty::ty_fn(_,_,_,_,_) | ty::ty_native_fn(_,_,_) | ty::ty_obj(_) |
135135
ty::ty_param(_,_) | ty::ty_res(_,_,_) { ret true; }
136136

trunk/src/comp/middle/shape.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,6 @@ fn shape_of(ccx : &@crate_ctxt, t : ty::t) -> [u8] {
343343
s += ~[shape_uniq];
344344
add_substr(s, shape_of(ccx, subt));
345345
}
346-
ty::ty_vec(mt) {
347-
s += ~[shape_evec];
348-
add_bool(s, ty::type_is_pod(ccx.tcx, mt.ty));
349-
add_substr(s, shape_of(ccx, mt.ty));
350-
}
351346
ty::ty_ivec(mt) {
352347
s += ~[shape_ivec];
353348
add_bool(s, ty::type_is_pod(ccx.tcx, mt.ty));

trunk/src/comp/middle/trans.rs

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ fn type_of_inner(cx: &@crate_ctxt, sp: &span, t: &ty::t) -> TypeRef {
214214
ty::ty_tag(did, _) { llty = type_of_tag(cx, sp, did, t); }
215215
ty::ty_box(mt) { llty = T_ptr(T_box(type_of_inner(cx, sp, mt.ty))); }
216216
ty::ty_uniq(t) { llty = T_ptr(type_of_inner(cx, sp, t)); }
217-
ty::ty_vec(mt) { llty = T_ptr(T_vec(type_of_inner(cx, sp, mt.ty))); }
218217
ty::ty_ivec(mt) {
219218
if ty::type_has_dynamic_size(cx.tcx, mt.ty) {
220219
llty = T_opaque_ivec();
@@ -501,7 +500,6 @@ fn simplify_type(ccx: &@crate_ctxt, typ: &ty::t) -> ty::t {
501500
alt ty::struct(ccx.tcx, typ) {
502501
ty::ty_box(_) { ret ty::mk_imm_box(ccx.tcx, ty::mk_nil(ccx.tcx)); }
503502
ty::ty_uniq(_) { ret ty::mk_uniq(ccx.tcx, ty::mk_nil(ccx.tcx)); }
504-
ty::ty_vec(_) { ret ty::mk_imm_vec(ccx.tcx, ty::mk_nil(ccx.tcx)); }
505503
ty::ty_fn(_, _, _, _, _) {
506504
ret ty::mk_tup(ccx.tcx,
507505
~[ty::mk_imm_box(ccx.tcx, ty::mk_nil(ccx.tcx)),
@@ -1318,15 +1316,6 @@ fn make_free_glue(cx: &@block_ctxt, v0: ValueRef, t: &ty::t) {
13181316
rslt(cx, C_nil())
13191317
}
13201318
}
1321-
ty::ty_vec(_) {
1322-
let v = cx.build.Load(v0);
1323-
let rs = iter_sequence(cx, v, t, bind drop_ty(_, _, _));
1324-
if !bcx_ccx(cx).sess.get_opts().do_gc {
1325-
trans_non_gc_free(rs.bcx, v)
1326-
} else {
1327-
rslt(cx, C_nil())
1328-
}
1329-
}
13301319
ty::ty_box(body_mt) {
13311320
let v = cx.build.Load(v0);
13321321
let body =
@@ -1430,7 +1419,6 @@ fn make_drop_glue(cx: &@block_ctxt, v0: ValueRef, t: &ty::t) {
14301419
let rs =
14311420
alt ty::struct(ccx.tcx, t) {
14321421
ty::ty_str. { decr_refcnt_maybe_free(cx, v0, v0, t) }
1433-
ty::ty_vec(_) { decr_refcnt_maybe_free(cx, v0, v0, t) }
14341422
ty::ty_ivec(tm) {
14351423
let v1;
14361424
if ty::type_has_dynamic_size(ccx.tcx, tm.ty) {
@@ -1981,9 +1969,6 @@ fn iter_sequence(cx: @block_ctxt, v: ValueRef, t: &ty::t, f: &val_and_ty_fn)
19811969

19821970

19831971
alt ty::struct(bcx_tcx(cx), t) {
1984-
ty::ty_vec(elt) {
1985-
ret iter_sequence_body(cx, v, elt.ty, f, false, false);
1986-
}
19871972
ty::ty_str. {
19881973
let et = ty::mk_mach(bcx_tcx(cx), ast::ty_u8);
19891974
ret iter_sequence_body(cx, v, et, f, true, false);
@@ -4776,65 +4761,6 @@ fn trans_tup(cx: &@block_ctxt, elts: &[@ast::expr], id: ast::node_id)
47764761
ret rslt(bcx, tup_val);
47774762
}
47784763

4779-
fn trans_vec(cx: &@block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
4780-
result {
4781-
let t = node_id_type(bcx_ccx(cx), id);
4782-
let unit_ty = t;
4783-
alt ty::struct(bcx_tcx(cx), t) {
4784-
ty::ty_vec(mt) { unit_ty = mt.ty; }
4785-
_ { bcx_ccx(cx).sess.bug("non-vec type in trans_vec"); }
4786-
}
4787-
let bcx = cx;
4788-
let unit_sz = size_of(bcx, unit_ty);
4789-
bcx = unit_sz.bcx;
4790-
let data_sz =
4791-
bcx.build.Mul(C_uint(std::vec::len::<@ast::expr>(args)), unit_sz.val);
4792-
// FIXME: pass tydesc properly.
4793-
4794-
let vec_val =
4795-
bcx.build.Call(bcx_ccx(bcx).upcalls.new_vec,
4796-
~[bcx.fcx.lltaskptr, data_sz,
4797-
C_null(T_ptr(bcx_ccx(bcx).tydesc_type))]);
4798-
let llty = type_of(bcx_ccx(bcx), bcx.sp, t);
4799-
vec_val = bcx.build.PointerCast(vec_val, llty);
4800-
add_clean_temp(bcx, vec_val, t);
4801-
let body = bcx.build.GEP(vec_val, ~[C_int(0), C_int(abi::vec_elt_data)]);
4802-
let pseudo_tup_ty =
4803-
ty::mk_tup(bcx_tcx(cx),
4804-
std::vec::init_elt::<ty::t>(unit_ty,
4805-
std::vec::len(args)));
4806-
let i: int = 0;
4807-
for e: @ast::expr in args {
4808-
let src = trans_lval(bcx, e);
4809-
bcx = src.res.bcx;
4810-
let dst_res = GEP_tup_like(bcx, pseudo_tup_ty, body, ~[0, i]);
4811-
bcx = dst_res.bcx;
4812-
// Cast the destination type to the source type. This is needed to
4813-
// make tags work, for a subtle combination of reasons:
4814-
//
4815-
// (1) "dst_res" above is derived from "body", which is in turn
4816-
// derived from "vec_val".
4817-
// (2) "vec_val" has the LLVM type "llty".
4818-
// (3) "llty" is the result of calling type_of() on a vector type.
4819-
// (4) For tags, type_of() returns a different type depending on
4820-
// on whether the tag is behind a box or not. Vector types are
4821-
// considered boxes.
4822-
// (5) "src_res" is derived from "unit_ty", which is not behind a box.
4823-
4824-
let dst_val;
4825-
if !ty::type_has_dynamic_size(bcx_tcx(cx), unit_ty) {
4826-
let llunit_ty = type_of(bcx_ccx(cx), bcx.sp, unit_ty);
4827-
dst_val = bcx.build.PointerCast(dst_res.val, T_ptr(llunit_ty));
4828-
} else { dst_val = dst_res.val; }
4829-
bcx = move_val_if_temp(bcx, INIT, dst_val, src, unit_ty).bcx;
4830-
i += 1;
4831-
}
4832-
let fill = bcx.build.GEP(vec_val, ~[C_int(0), C_int(abi::vec_elt_fill)]);
4833-
bcx.build.Store(data_sz, fill);
4834-
ret rslt(bcx, vec_val);
4835-
}
4836-
4837-
48384764
// TODO: Move me to ivec::
48394765
fn trans_ivec(bcx: @block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
48404766
result {

trunk/src/comp/middle/ty.rs

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export mk_type;
8989
export mk_uint;
9090
export mk_uniq;
9191
export mk_var;
92-
export mk_vec;
9392
export mk_iter_body_fn;
9493
export mode;
9594
export mo_val;
@@ -147,7 +146,6 @@ export ty_uint;
147146
export ty_uniq;
148147
export ty_var;
149148
export ty_var_id;
150-
export ty_vec;
151149
export ty_param_substs_opt_and_ty_to_monotype;
152150
export ty_fn_args;
153151
export type_constr;
@@ -263,7 +261,6 @@ tag sty {
263261
ty_tag(def_id, [t]);
264262
ty_box(mt);
265263
ty_uniq(t);
266-
ty_vec(mt);
267264
ty_ivec(mt);
268265
ty_ptr(mt);
269266
ty_rec([field]);
@@ -465,7 +462,6 @@ fn mk_raw_ty(cx: &ctxt, st: &sty, _in_cname: &option::t<str>) -> @raw_t {
465462
}
466463
ty_box(m) { derive_flags_mt(cx, has_params, has_vars, m); }
467464
ty_uniq(tt) { derive_flags_t(cx, has_params, has_vars, tt); }
468-
ty_vec(m) { derive_flags_mt(cx, has_params, has_vars, m); }
469465
ty_ivec(m) { derive_flags_mt(cx, has_params, has_vars, m); }
470466
ty_ptr(m) { derive_flags_mt(cx, has_params, has_vars, m); }
471467
ty_rec(flds) {
@@ -567,14 +563,8 @@ fn mk_mut_ptr(cx: &ctxt, ty: &t) -> t {
567563
ret mk_ptr(cx, {ty: ty, mut: ast::mut});
568564
}
569565

570-
fn mk_vec(cx: &ctxt, tm: &mt) -> t { ret gen_ty(cx, ty_vec(tm)); }
571-
572566
fn mk_ivec(cx: &ctxt, tm: &mt) -> t { ret gen_ty(cx, ty_ivec(tm)); }
573567

574-
fn mk_imm_vec(cx: &ctxt, typ: &t) -> t {
575-
ret gen_ty(cx, ty_vec({ty: typ, mut: ast::imm}));
576-
}
577-
578568
fn mk_rec(cx: &ctxt, fs: &[field]) -> t { ret gen_ty(cx, ty_rec(fs)); }
579569

580570
fn mk_constr(cx: &ctxt, t: &t, cs: &[@type_constr]) -> t {
@@ -644,7 +634,6 @@ fn walk_ty(cx: &ctxt, walker: ty_walk, ty: t) {
644634
ty_type. {/* no-op */ }
645635
ty_native(_) {/* no-op */ }
646636
ty_box(tm) { walk_ty(cx, walker, tm.ty); }
647-
ty_vec(tm) { walk_ty(cx, walker, tm.ty); }
648637
ty_ivec(tm) { walk_ty(cx, walker, tm.ty); }
649638
ty_ptr(tm) { walk_ty(cx, walker, tm.ty); }
650639
ty_tag(tid, subtys) {
@@ -719,9 +708,6 @@ fn fold_ty(cx: &ctxt, fld: fold_mode, ty_0: t) -> t {
719708
ty_ptr(tm) {
720709
ty = mk_ptr(cx, {ty: fold_ty(cx, fld, tm.ty), mut: tm.mut});
721710
}
722-
ty_vec(tm) {
723-
ty = mk_vec(cx, {ty: fold_ty(cx, fld, tm.ty), mut: tm.mut});
724-
}
725711
ty_ivec(tm) {
726712
ty = mk_ivec(cx, {ty: fold_ty(cx, fld, tm.ty), mut: tm.mut});
727713
}
@@ -860,7 +846,6 @@ fn type_is_sequence(cx: &ctxt, ty: &t) -> bool {
860846
alt struct(cx, ty) {
861847
ty_str. { ret true; }
862848
ty_istr. { ret true; }
863-
ty_vec(_) { ret true; }
864849
ty_ivec(_) { ret true; }
865850
_ { ret false; }
866851
}
@@ -877,10 +862,6 @@ fn type_is_str(cx: &ctxt, ty: &t) -> bool {
877862
fn sequence_is_interior(cx: &ctxt, ty: &t) -> bool {
878863
alt struct(cx, ty) {
879864

880-
// TODO: Or-patterns
881-
ty::ty_vec(_) {
882-
ret false;
883-
}
884865
ty::ty_str. { ret false; }
885866
ty::ty_ivec(_) { ret true; }
886867
ty::ty_istr. { ret true; }
@@ -892,7 +873,6 @@ fn sequence_element_type(cx: &ctxt, ty: &t) -> t {
892873
alt struct(cx, ty) {
893874
ty_str. { ret mk_mach(cx, ast::ty_u8); }
894875
ty_istr. { ret mk_mach(cx, ast::ty_u8); }
895-
ty_vec(mt) { ret mt.ty; }
896876
ty_ivec(mt) { ret mt.ty; }
897877
_ { cx.sess.bug("sequence_element_type called on non-sequence value"); }
898878
}
@@ -929,7 +909,6 @@ fn type_is_box(cx: &ctxt, ty: &t) -> bool {
929909
fn type_is_boxed(cx: &ctxt, ty: &t) -> bool {
930910
alt struct(cx, ty) {
931911
ty_str. { ret true; }
932-
ty_vec(_) { ret true; }
933912
ty_box(_) { ret true; }
934913
_ { ret false; }
935914
}
@@ -1068,7 +1047,7 @@ fn type_kind(cx: &ctxt, ty: &t) -> ast::kind {
10681047

10691048
// Those with refcounts-to-inner raise pinned to shared,
10701049
// lower unique to shared. Therefore just set result to shared.
1071-
ty_box(mt) | ty_vec(mt) {
1050+
ty_box(mt) {
10721051
result = ast::kind_shared;
10731052
}
10741053

@@ -1155,7 +1134,6 @@ fn type_has_dynamic_size(cx: &ctxt, ty: &t) -> bool {
11551134
ret false;
11561135
}
11571136
ty_box(_) { ret false; }
1158-
ty_vec(_) { ret false; }
11591137
ty_ivec(mt) { ret type_has_dynamic_size(cx, mt.ty); }
11601138
ty_ptr(_) { ret false; }
11611139
ty_rec(fields) {
@@ -1272,7 +1250,6 @@ fn type_owns_heap_mem(cx: &ctxt, ty: &t) -> bool {
12721250
result = false;
12731251
}
12741252
ty_box(_) { result = false; }
1275-
ty_vec(_) { result = false; }
12761253
ty_fn(_, _, _, _, _) { result = false; }
12771254
ty_native_fn(_, _, _) { result = false; }
12781255
ty_obj(_) { result = false; }
@@ -1326,7 +1303,7 @@ fn type_is_pod(cx : &ctxt, ty : &t) -> bool {
13261303
}
13271304

13281305
// Boxed types
1329-
ty_str. | ty_istr. | ty_box(_) | ty_vec(_) | ty_ivec(_) |
1306+
ty_str. | ty_istr. | ty_box(_) | ty_ivec(_) |
13301307
ty_fn(_,_,_,_,_) | ty_native_fn(_,_,_) | ty_obj(_) { result = false; }
13311308

13321309
// Structural types
@@ -1489,7 +1466,6 @@ fn hash_type_structure(st: &sty) -> uint {
14891466
ret h;
14901467
}
14911468
ty_box(mt) { ret hash_subty(19u, mt.ty); }
1492-
ty_vec(mt) { ret hash_subty(20u, mt.ty); }
14931469
ty_ivec(mt) { ret hash_subty(21u, mt.ty); }
14941470
ty_rec(fields) {
14951471
let h = 26u;
@@ -1651,9 +1627,6 @@ fn equal_type_structures(a: &sty, b: &sty) -> bool {
16511627
ty_box(mt_a) {
16521628
alt b { ty_box(mt_b) { ret equal_mt(mt_a, mt_b); } _ { ret false; } }
16531629
}
1654-
ty_vec(mt_a) {
1655-
alt b { ty_vec(mt_b) { ret equal_mt(mt_a, mt_b); } _ { ret false; } }
1656-
}
16571630
ty_ivec(mt_a) {
16581631
alt b { ty_ivec(mt_b) { ret equal_mt(mt_a, mt_b); } _ { ret false; } }
16591632
}
@@ -2502,26 +2475,6 @@ mod unify {
25022475
_ { ret ures_err(terr_mismatch); }
25032476
}
25042477
}
2505-
ty::ty_vec(expected_mt) {
2506-
alt struct(cx.tcx, actual) {
2507-
ty::ty_vec(actual_mt) {
2508-
let mut;
2509-
alt unify_mut(expected_mt.mut, actual_mt.mut) {
2510-
none. { ret ures_err(terr_vec_mutability); }
2511-
some(m) { mut = m; }
2512-
}
2513-
let result = unify_step(cx, expected_mt.ty, actual_mt.ty);
2514-
alt result {
2515-
ures_ok(result_sub) {
2516-
let mt = {ty: result_sub, mut: mut};
2517-
ret ures_ok(mk_vec(cx.tcx, mt));
2518-
}
2519-
_ { ret result; }
2520-
}
2521-
}
2522-
_ { ret ures_err(terr_mismatch); }
2523-
}
2524-
}
25252478
ty::ty_ivec(expected_mt) {
25262479
alt struct(cx.tcx, actual) {
25272480
ty::ty_ivec(actual_mt) {
@@ -3055,7 +3008,6 @@ fn is_binopable(cx: &ctxt, ty: t, op: ast::binop) -> bool {
30553008
ty_ptr(_) { tycat_int }
30563009
ty_str. { tycat_str }
30573010
ty_istr. { tycat_str }
3058-
ty_vec(_) { tycat_vec }
30593011
ty_ivec(_) { tycat_vec }
30603012
ty_rec(_) { tycat_struct }
30613013
ty_tup(_) { tycat_struct }

0 commit comments

Comments
 (0)