提交 4fc36182 编写于 作者: B Brian Anderson

Change ast::ty_ivec, ty::ty_ivec to ty_vec

上级 504ec8b0
......@@ -224,7 +224,7 @@ fn mk_test_desc_ivec_ty(cx: &test_ctxt) -> @ast::ty {
let ivec_mt: ast::mt = {ty: @test_desc_ty, mut: ast::imm};
ret @nospan(ast::ty_ivec(ivec_mt));
ret @nospan(ast::ty_vec(ivec_mt));
}
fn mk_test_desc_vec(cx: &test_ctxt) -> @ast::expr {
......@@ -286,7 +286,7 @@ fn mk_test_desc_rec(cx: &test_ctxt, test: test) -> @ast::expr {
fn mk_main(cx: &test_ctxt) -> @ast::item {
let args_mt: ast::mt = {ty: @nospan(ast::ty_str), mut: ast::imm};
let args_ty: ast::ty = nospan(ast::ty_ivec(args_mt));
let args_ty: ast::ty = nospan(ast::ty_vec(args_mt));
let args_arg: ast::arg =
{mode: ast::val, ty: @args_ty, ident: "args", id: cx.next_node_id()};
......
......@@ -128,7 +128,7 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
ty::ty_box(mt) { w.write_char('@'); enc_mt(w, cx, mt); }
ty::ty_uniq(t) { w.write_char('~'); enc_ty(w, cx, t); }
ty::ty_ptr(mt) { w.write_char('*'); enc_mt(w, cx, mt); }
ty::ty_ivec(mt) { w.write_char('I'); enc_mt(w, cx, mt); }
ty::ty_vec(mt) { w.write_char('I'); enc_mt(w, cx, mt); }
ty::ty_rec(fields) {
w.write_str("R[");
for field: ty::field in fields {
......
......@@ -364,7 +364,7 @@ fn check_for(cx: &ctx, local: &@ast::local, seq: &@ast::expr, blk: &ast::blk,
// If this is a mutable vector, don't allow it to be touched.
let seq_t = ty::expr_ty(cx.tcx, seq);
alt ty::struct(cx.tcx, seq_t) {
ty::ty_ivec(mt) {
ty::ty_vec(mt) {
if mt.mut != ast::imm { unsafe = ~[seq_t]; }
}
ty::ty_str. | ty::ty_istr. {/* no-op */ }
......@@ -584,7 +584,7 @@ fn maybe_auto_unbox(cx: &ctx, t: ty::t) -> {t: ty::t, ds: [deref]} {
ast::expr_index(base, _) {
let auto_unbox = maybe_auto_unbox(cx, ty::expr_ty(cx.tcx, base));
alt ty::struct(cx.tcx, auto_unbox.t) {
ty::ty_ivec(mt) {
ty::ty_vec(mt) {
ds +=
~[@{mut: mt.mut != ast::imm,
kind: index,
......
......@@ -127,7 +127,7 @@ fn type_is_gc_relevant(cx: &ty::ctxt, ty: &ty::t) -> bool {
ret false;
}
ty::ty_ivec(tm) { ret type_is_gc_relevant(cx, tm.ty); }
ty::ty_vec(tm) { ret type_is_gc_relevant(cx, tm.ty); }
ty::ty_constr(sub, _) { ret type_is_gc_relevant(cx, sub); }
ty::ty_str. | ty::ty_box(_) | ty::ty_uniq(_) |
......
......@@ -343,7 +343,7 @@ fn shape_of(ccx : &@crate_ctxt, t : ty::t) -> [u8] {
s += ~[shape_uniq];
add_substr(s, shape_of(ccx, subt));
}
ty::ty_ivec(mt) {
ty::ty_vec(mt) {
s += ~[shape_ivec];
add_bool(s, ty::type_is_pod(ccx.tcx, mt.ty));
add_size_hint(ccx, s, mt.ty);
......
......@@ -214,7 +214,7 @@ fn type_of_inner(cx: &@crate_ctxt, sp: &span, t: &ty::t) -> TypeRef {
ty::ty_tag(did, _) { llty = type_of_tag(cx, sp, did, t); }
ty::ty_box(mt) { llty = T_ptr(T_box(type_of_inner(cx, sp, mt.ty))); }
ty::ty_uniq(t) { llty = T_ptr(type_of_inner(cx, sp, t)); }
ty::ty_ivec(mt) {
ty::ty_vec(mt) {
if ty::type_has_dynamic_size(cx.tcx, mt.ty) {
llty = T_opaque_ivec();
} else { llty = T_ivec(type_of_inner(cx, sp, mt.ty)); }
......@@ -629,7 +629,7 @@ fn align_elements(cx: &@block_ctxt, elts: &[ty::t]) -> result {
} else { max_size_val };
ret rslt(bcx, total_size);
}
ty::ty_ivec(mt) {
ty::ty_vec(mt) {
let rs = size_of(cx, mt.ty);
let bcx = rs.bcx;
let llunitsz = rs.val;
......@@ -661,7 +661,7 @@ fn dynamic_align_of(cx: &@block_ctxt, t: &ty::t) -> result {
ty::ty_tag(_, _) {
ret rslt(cx, C_int(1)); // FIXME: stub
}
ty::ty_ivec(tm) {
ty::ty_vec(tm) {
let rs = align_of(cx, tm.ty);
let bcx = rs.bcx;
let llunitalign = rs.val;
......@@ -1419,7 +1419,7 @@ fn make_drop_glue(cx: &@block_ctxt, v0: ValueRef, t: &ty::t) {
let rs =
alt ty::struct(ccx.tcx, t) {
ty::ty_str. { decr_refcnt_maybe_free(cx, v0, v0, t) }
ty::ty_ivec(tm) {
ty::ty_vec(tm) {
let v1;
if ty::type_has_dynamic_size(ccx.tcx, tm.ty) {
v1 = cx.build.PointerCast(v0, T_ptr(T_opaque_ivec()));
......@@ -1866,7 +1866,7 @@ fn iter_variant(cx: @block_ctxt, a_tup: ValueRef,
cx.build.GEP(av, ~[C_int(0), C_int(abi::obj_field_box)]);
ret iter_boxpp(cx, box_cell_a, f);
}
ty::ty_ivec(unit_tm) { ret iter_ivec(cx, av, unit_tm.ty, f); }
ty::ty_vec(unit_tm) { ret iter_ivec(cx, av, unit_tm.ty, f); }
ty::ty_istr. {
let unit_ty = ty::mk_mach(bcx_tcx(cx), ast::ty_u8);
ret iter_ivec(cx, av, unit_ty, f);
......@@ -1973,7 +1973,7 @@ fn iter_sequence_body(cx: @block_ctxt, v: ValueRef, elt_ty: &ty::t,
let et = ty::mk_mach(bcx_tcx(cx), ast::ty_u8);
ret iter_sequence_body(cx, v, et, f, true, false);
}
ty::ty_ivec(elt) {
ty::ty_vec(elt) {
ret iter_sequence_body(cx, v, elt.ty, f, false, true);
}
ty::ty_istr. {
......@@ -2257,7 +2257,7 @@ fn memmove_ty(cx: &@block_ctxt, dst: ValueRef, src: ValueRef, t: &ty::t) ->
fn duplicate_heap_parts_if_necessary(cx: &@block_ctxt, vptr: ValueRef,
typ: ty::t) -> result {
alt ty::struct(bcx_tcx(cx), typ) {
ty::ty_ivec(tm) { ret ivec::duplicate_heap_part(cx, vptr, tm.ty); }
ty::ty_vec(tm) { ret ivec::duplicate_heap_part(cx, vptr, tm.ty); }
ty::ty_istr. {
ret ivec::duplicate_heap_part(cx, vptr,
ty::mk_mach(bcx_tcx(cx), ast::ty_u8));
......@@ -2798,7 +2798,7 @@ fn trans_append(cx: &@block_ctxt, t: &ty::t, orig_lhs: ValueRef,
let llunitty = type_of_or_i8(cx, unit_ty);
alt ty::struct(bcx_tcx(cx), t) {
ty::ty_istr. { }
ty::ty_ivec(_) { }
ty::ty_vec(_) { }
_ { bcx_tcx(cx).sess.bug("non-istr/ivec in trans_append"); }
}
......@@ -4769,7 +4769,7 @@ fn trans_ivec(bcx: @block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
let typ = node_id_type(bcx_ccx(bcx), id);
let unit_ty;
alt ty::struct(bcx_tcx(bcx), typ) {
ty::ty_ivec(mt) { unit_ty = mt.ty; }
ty::ty_vec(mt) { unit_ty = mt.ty; }
_ { bcx_ccx(bcx).sess.bug("non-ivec type in trans_ivec"); }
}
let llunitty = type_of_or_i8(bcx, unit_ty);
......
......@@ -129,7 +129,7 @@
export ty_fn_ret;
export ty_int;
export ty_istr;
export ty_ivec;
export ty_vec;
export ty_machine;
export ty_native;
export ty_nil;
......@@ -261,7 +261,7 @@ fn method_ty_to_fn_ty(cx: &ctxt, m: method) -> t {
ty_tag(def_id, [t]);
ty_box(mt);
ty_uniq(t);
ty_ivec(mt);
ty_vec(mt);
ty_ptr(mt);
ty_rec([field]);
ty_fn(ast::proto, [arg], t, controlflow, [@constr]);
......@@ -462,7 +462,7 @@ fn derive_flags_sig(cx: &ctxt, has_params: &mutable bool,
}
ty_box(m) { derive_flags_mt(cx, has_params, has_vars, m); }
ty_uniq(tt) { derive_flags_t(cx, has_params, has_vars, tt); }
ty_ivec(m) { derive_flags_mt(cx, has_params, has_vars, m); }
ty_vec(m) { derive_flags_mt(cx, has_params, has_vars, m); }
ty_ptr(m) { derive_flags_mt(cx, has_params, has_vars, m); }
ty_rec(flds) {
for f: field in flds {
......@@ -563,7 +563,7 @@ fn mk_mut_ptr(cx: &ctxt, ty: &t) -> t {
ret mk_ptr(cx, {ty: ty, mut: ast::mut});
}
fn mk_ivec(cx: &ctxt, tm: &mt) -> t { ret gen_ty(cx, ty_ivec(tm)); }
fn mk_ivec(cx: &ctxt, tm: &mt) -> t { ret gen_ty(cx, ty_vec(tm)); }
fn mk_rec(cx: &ctxt, fs: &[field]) -> t { ret gen_ty(cx, ty_rec(fs)); }
......@@ -634,7 +634,7 @@ fn walk_ty(cx: &ctxt, walker: ty_walk, ty: t) {
ty_type. {/* no-op */ }
ty_native(_) {/* no-op */ }
ty_box(tm) { walk_ty(cx, walker, tm.ty); }
ty_ivec(tm) { walk_ty(cx, walker, tm.ty); }
ty_vec(tm) { walk_ty(cx, walker, tm.ty); }
ty_ptr(tm) { walk_ty(cx, walker, tm.ty); }
ty_tag(tid, subtys) {
for subty: t in subtys { walk_ty(cx, walker, subty); }
......@@ -708,7 +708,7 @@ fn fold_ty(cx: &ctxt, fld: fold_mode, ty_0: t) -> t {
ty_ptr(tm) {
ty = mk_ptr(cx, {ty: fold_ty(cx, fld, tm.ty), mut: tm.mut});
}
ty_ivec(tm) {
ty_vec(tm) {
ty = mk_ivec(cx, {ty: fold_ty(cx, fld, tm.ty), mut: tm.mut});
}
ty_tag(tid, subtys) {
......@@ -828,7 +828,7 @@ fn type_is_structural(cx: &ctxt, ty: &t) -> bool {
ty_fn(_, _, _, _, _) { ret true; }
ty_obj(_) { ret true; }
ty_res(_, _, _) { ret true; }
ty_ivec(_) { ret true; }
ty_vec(_) { ret true; }
ty_istr. { ret true; }
_ { ret false; }
}
......@@ -846,7 +846,7 @@ fn type_is_sequence(cx: &ctxt, ty: &t) -> bool {
alt struct(cx, ty) {
ty_str. { ret true; }
ty_istr. { ret true; }
ty_ivec(_) { ret true; }
ty_vec(_) { ret true; }
_ { ret false; }
}
}
......@@ -863,7 +863,7 @@ fn sequence_is_interior(cx: &ctxt, ty: &t) -> bool {
alt struct(cx, ty) {
ty::ty_str. { ret false; }
ty::ty_ivec(_) { ret true; }
ty::ty_vec(_) { ret true; }
ty::ty_istr. { ret true; }
_ { cx.sess.bug("sequence_is_interior called on non-sequence type"); }
}
......@@ -873,7 +873,7 @@ fn sequence_element_type(cx: &ctxt, ty: &t) -> t {
alt struct(cx, ty) {
ty_str. { ret mk_mach(cx, ast::ty_u8); }
ty_istr. { ret mk_mach(cx, ast::ty_u8); }
ty_ivec(mt) { ret mt.ty; }
ty_vec(mt) { ret mt.ty; }
_ { cx.sess.bug("sequence_element_type called on non-sequence value"); }
}
}
......@@ -1053,7 +1053,7 @@ fn type_kind(cx: &ctxt, ty: &t) -> ast::kind {
// Pointers and unique boxes / vecs raise pinned to shared,
// otherwise pass through their pointee kind.
ty_ptr(tm) | ty_ivec(tm) {
ty_ptr(tm) | ty_vec(tm) {
let k = type_kind(cx, tm.ty);
if k == ast::kind_pinned { k = ast::kind_shared }
result = kind::lower_kind(result, k);
......@@ -1134,7 +1134,7 @@ fn type_has_dynamic_size(cx: &ctxt, ty: &t) -> bool {
ret false;
}
ty_box(_) { ret false; }
ty_ivec(mt) { ret type_has_dynamic_size(cx, mt.ty); }
ty_vec(mt) { ret type_has_dynamic_size(cx, mt.ty); }
ty_ptr(_) { ret false; }
ty_rec(fields) {
let i = 0u;
......@@ -1226,7 +1226,7 @@ fn type_owns_heap_mem(cx: &ctxt, ty: &t) -> bool {
let result = false;
alt struct(cx, ty) {
ty_ivec(_) { result = true; }
ty_vec(_) { result = true; }
ty_istr. { result = true; }
......@@ -1303,7 +1303,7 @@ fn type_is_pod(cx : &ctxt, ty : &t) -> bool {
}
// Boxed types
ty_str. | ty_istr. | ty_box(_) | ty_ivec(_) |
ty_str. | ty_istr. | ty_box(_) | ty_vec(_) |
ty_fn(_,_,_,_,_) | ty_native_fn(_,_,_) | ty_obj(_) { result = false; }
// Structural types
......@@ -1466,7 +1466,7 @@ fn hash_fn(id: uint, args: &[arg], rty: &t) -> uint {
ret h;
}
ty_box(mt) { ret hash_subty(19u, mt.ty); }
ty_ivec(mt) { ret hash_subty(21u, mt.ty); }
ty_vec(mt) { ret hash_subty(21u, mt.ty); }
ty_rec(fields) {
let h = 26u;
for f: field in fields { h += h << 5u + hash_ty(f.mt.ty); }
......@@ -1627,8 +1627,8 @@ fn equal_def(did_a: &ast::def_id, did_b: &ast::def_id) -> bool {
ty_box(mt_a) {
alt b { ty_box(mt_b) { ret equal_mt(mt_a, mt_b); } _ { ret false; } }
}
ty_ivec(mt_a) {
alt b { ty_ivec(mt_b) { ret equal_mt(mt_a, mt_b); } _ { ret false; } }
ty_vec(mt_a) {
alt b { ty_vec(mt_b) { ret equal_mt(mt_a, mt_b); } _ { ret false; } }
}
ty_ptr(mt_a) {
alt b { ty_ptr(mt_b) { ret equal_mt(mt_a, mt_b); } _ { ret false; } }
......@@ -2475,9 +2475,9 @@ fn unify_step(cx: &@ctxt, expected: &t, actual: &t) -> result {
_ { ret ures_err(terr_mismatch); }
}
}
ty::ty_ivec(expected_mt) {
ty::ty_vec(expected_mt) {
alt struct(cx.tcx, actual) {
ty::ty_ivec(actual_mt) {
ty::ty_vec(actual_mt) {
let mut;
alt unify_mut(expected_mt.mut, actual_mt.mut) {
none. { ret ures_err(terr_vec_mutability); }
......@@ -3008,7 +3008,7 @@ fn tycat(cx: &ctxt, ty: t) -> int {
ty_ptr(_) { tycat_int }
ty_str. { tycat_str }
ty_istr. { tycat_str }
ty_ivec(_) { tycat_vec }
ty_vec(_) { tycat_vec }
ty_rec(_) { tycat_struct }
ty_tup(_) { tycat_struct }
ty_tag(_, _) { tycat_struct }
......
......@@ -324,7 +324,7 @@ fn instantiate(tcx: &ty::ctxt, sp: &span, getter: &ty_getter,
ast::ty_box(mt) {
typ = ty::mk_box(tcx, ast_mt_to_mt(tcx, getter, mt));
}
ast::ty_ivec(mt) {
ast::ty_vec(mt) {
typ = ty::mk_ivec(tcx, ast_mt_to_mt(tcx, getter, mt));
}
ast::ty_ptr(mt) {
......@@ -1987,7 +1987,7 @@ fn check_binop_type_compat(fcx: &@fn_ctxt, span: span, ty: ty::t,
let ety = expr_ty(tcx, seq);
alt structure_of(fcx, expr.span, ety) {
ty::ty_str. { elt_ty = ty::mk_mach(tcx, ast::ty_u8); }
ty::ty_ivec(vec_elt_ty) { elt_ty = vec_elt_ty.ty; }
ty::ty_vec(vec_elt_ty) { elt_ty = vec_elt_ty.ty; }
ty::ty_istr. { elt_ty = ty::mk_mach(tcx, ast::ty_u8); }
_ {
tcx.sess.span_fatal
......@@ -2291,7 +2291,7 @@ fn get_node(f: &spanned<field>) -> field { f.node }
+ ty_to_str(tcx, idx_t));
}
alt structure_of(fcx, expr.span, base_t) {
ty::ty_ivec(mt) { write::ty_only_fixup(fcx, id, mt.ty); }
ty::ty_vec(mt) { write::ty_only_fixup(fcx, id, mt.ty); }
ty::ty_str. {
let typ = ty::mk_mach(tcx, ast::ty_u8);
write::ty_only_fixup(fcx, id, typ);
......@@ -2653,7 +2653,7 @@ fn check_item(ccx: @crate_ctxt, it: &@ast::item) {
fn arg_is_argv_ty(tcx: &ty::ctxt, a: &ty::arg) -> bool {
alt ty::struct(tcx, a.ty) {
ty::ty_ivec(mt) {
ty::ty_vec(mt) {
if mt.mut != ast::imm { ret false; }
alt ty::struct(tcx, mt.ty) {
ty::ty_str. { ret true; }
......
......@@ -439,7 +439,7 @@ fn ty_mach_to_str(tm: ty_mach) -> str {
ty_str;
ty_istr; // interior string
ty_box(mt);
ty_ivec(mt); // interior vector
ty_vec(mt); // interior vector
ty_ptr(mt);
ty_task;
ty_port(@ty);
......
......@@ -570,7 +570,7 @@ fn parse_ty(p: &parser, colons_before_params: bool) -> @ast::ty {
}
} else if (p.peek() == token::LBRACKET) {
expect(p, token::LBRACKET);
t = ast::ty_ivec(parse_mt(p));
t = ast::ty_vec(parse_mt(p));
hi = p.get_hi_pos();
expect(p, token::RBRACKET);
} else if (eat_word(p, "fn")) {
......
......@@ -284,7 +284,7 @@ fn print_type(s: &ps, ty: &@ast::ty) {
ast::ty_str. { word(s.s, "str"); }
ast::ty_istr. { word(s.s, "istr"); }
ast::ty_box(mt) { word(s.s, "@"); print_mt(s, mt); }
ast::ty_ivec(mt) {
ast::ty_vec(mt) {
word(s.s, "[");
alt mt.mut {
ast::mut. { word_space(s, "mutable"); }
......
......@@ -174,7 +174,7 @@
n_ty_istr;
n_ty_box;
n_ty_vec;
n_ty_ivec;
n_ty_vec;
n_ty_ptr;
n_ty_task;
n_ty_port;
......@@ -620,7 +620,7 @@ fn cv_ty(ctx: &ctx, ut: &@ast_node) -> @ty {
[ty_istr, n_ty_istr, []],
[ty_box, n_ty_box, [cv_mt]],
[ty_vec, n_ty_vec, [cv_mt]],
[ty_ivec, n_ty_ivec, [cv_mt]],
[ty_vec, n_ty_vec, [cv_mt]],
[ty_ptr, n_ty_ptr, [cv_mt]],
[ty_task, n_ty_task, []],
[ty_port, n_ty_port, [cv_ty]],
......
......@@ -124,7 +124,7 @@ fn visit_ty<E>(t: &@ty, e: &E, v: &vt<E>) {
ty_str. {/* no-op */ }
ty_istr. {/* no-op */ }
ty_box(mt) { v.visit_ty(mt.ty, e, v); }
ty_ivec(mt) { v.visit_ty(mt.ty, e, v); }
ty_vec(mt) { v.visit_ty(mt.ty, e, v); }
ty_ptr(mt) { v.visit_ty(mt.ty, e, v); }
ty_port(t) { v.visit_ty(t, e, v); }
ty_chan(t) { v.visit_ty(t, e, v); }
......
......@@ -92,7 +92,7 @@ fn mt_to_str(cx: &ctxt, m: &mt) -> str {
ty_istr. { s += "istr"; }
ty_box(tm) { s += "@" + mt_to_str(cx, tm); }
ty_uniq(t) { s += "~" + ty_to_str(cx, t); }
ty_ivec(tm) { s += "[" + mt_to_str(cx, tm) + "]"; }
ty_vec(tm) { s += "[" + mt_to_str(cx, tm) + "]"; }
ty_type. { s += "type"; }
ty_rec(elems) {
let strs: [str] = ~[];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册