Rename ty_istr to ty_str. Issue #855

This commit is contained in:
Brian Anderson 2011-09-02 16:45:00 -07:00
parent 6217ce958e
commit f1555e2ca8
14 changed files with 35 additions and 35 deletions

View file

@ -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_istr), mut: ast::imm};
let args_mt: ast::mt = {ty: @nospan(ast::ty_str), mut: ast::imm};
let args_ty: ast::ty = nospan(ast::ty_vec(args_mt));
let args_arg: ast::arg =

View file

@ -113,7 +113,7 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
}
}
ty::ty_char. { w.write_char('c'); }
ty::ty_istr. { w.write_char('S'); }
ty::ty_str. { w.write_char('S'); }
ty::ty_tag(def, tys) {
w.write_str("t[");
w.write_str(cx.ds(def));

View file

@ -294,7 +294,7 @@ fn check_for(cx: &ctx, local: &@ast::local, seq: &@ast::expr, blk: &ast::blk,
let seq_t = ty::expr_ty(cx.tcx, seq);
alt ty::struct(cx.tcx, seq_t) {
ty::ty_vec(mt) { if mt.mut != ast::imm { unsafe = some(seq_t); } }
ty::ty_istr. {/* no-op */ }
ty::ty_str. {/* no-op */ }
_ {
cx.tcx.sess.span_unimpl(seq.span,
"unknown seq type " +

View file

@ -105,7 +105,7 @@ fn add_gc_root(cx: &@block_ctxt, llval: ValueRef, ty: ty::t) -> @block_ctxt {
fn type_is_gc_relevant(cx: &ty::ctxt, ty: ty::t) -> bool {
alt ty::struct(cx, ty) {
ty::ty_nil. | ty::ty_bot. | ty::ty_bool. | ty::ty_int. | ty::ty_float. |
ty::ty_uint. | ty::ty_machine(_) | ty::ty_char. | ty::ty_istr. |
ty::ty_uint. | ty::ty_machine(_) | ty::ty_char. | ty::ty_str. |
ty::ty_type. | ty::ty_native(_) | ty::ty_ptr(_) | ty::ty_type. |
ty::ty_native(_) {
ret false;

View file

@ -324,7 +324,7 @@ fn shape_of(ccx: &@crate_ctxt, t: ty::t, ty_param_map: &[uint]) -> [u8] {
ty::ty_istr. {
ty::ty_str. {
s += [shape_vec];
add_bool(s, true); // type is POD
let unit_ty = ty::mk_mach(ccx.tcx, ast::ty_u8);

View file

@ -196,7 +196,7 @@ fn type_of_inner(cx: &@crate_ctxt, sp: &span, t: ty::t) -> TypeRef {
}
}
ty::ty_char. { llty = T_char(); }
ty::ty_istr. { llty = T_ptr(T_vec(T_i8())); }
ty::ty_str. { llty = T_ptr(T_vec(T_i8())); }
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)); }
@ -1393,7 +1393,7 @@ fn make_drop_glue(bcx: &@block_ctxt, v0: ValueRef, t: ty::t) {
let ccx = bcx_ccx(bcx);
let bcx = alt ty::struct(ccx.tcx, t) {
ty::ty_vec(_) { tvec::make_drop_glue(bcx, v0, t) }
ty::ty_istr. { tvec::make_drop_glue(bcx, v0, t) }
ty::ty_str. { tvec::make_drop_glue(bcx, v0, t) }
ty::ty_box(_) { decr_refcnt_maybe_free(bcx, v0, v0, t) }
ty::ty_uniq(_) {
let vptr = Load(bcx, v0);
@ -1823,7 +1823,7 @@ fn iter_sequence(cx: @block_ctxt, v: ValueRef, t: ty::t, f: &val_and_ty_fn) ->
alt ty::struct(bcx_tcx(cx), t) {
ty::ty_vec(elt) { ret iter_sequence_body(cx, v, elt.ty, f, false); }
ty::ty_istr. {
ty::ty_str. {
let et = ty::mk_mach(bcx_tcx(cx), ast::ty_u8);
ret iter_sequence_body(cx, v, et, f, true);
}

View file

@ -145,7 +145,7 @@ fn trans_append(cx: &@block_ctxt, vec_ty: ty::t, lhsptr: ValueRef,
}
let strings =
alt ty::struct(bcx_tcx(cx), vec_ty) {
ty::ty_istr. { true }
ty::ty_str. { true }
ty::ty_vec(_) { false }
};
@ -215,7 +215,7 @@ fn trans_add(bcx: &@block_ctxt, vec_ty: ty::t, lhs: ValueRef, rhs: ValueRef)
-> result {
let strings =
alt ty::struct(bcx_tcx(bcx), vec_ty) {
ty::ty_istr. { true }
ty::ty_str. { true }
ty::ty_vec(_) { false }
};
let unit_ty = ty::sequence_element_type(bcx_tcx(bcx), vec_ty);

View file

@ -121,7 +121,7 @@ export ty_fn_abi;
export ty_fn_proto;
export ty_fn_ret;
export ty_int;
export ty_istr;
export ty_str;
export ty_vec;
export ty_machine;
export ty_native;
@ -249,7 +249,7 @@ tag sty {
ty_uint;
ty_machine(ast::ty_mach);
ty_char;
ty_istr;
ty_str;
ty_tag(def_id, [t]);
ty_box(mt);
ty_uniq(t);
@ -363,7 +363,7 @@ fn populate_type_store(cx: &ctxt) {
intern(cx, ty_machine(ast::ty_f32), none);
intern(cx, ty_machine(ast::ty_f64), none);
intern(cx, ty_char, none);
intern(cx, ty_istr, none);
intern(cx, ty_str, none);
intern(cx, ty_type, none);
intern(cx, ty_bot, none);
assert (vec::len(cx.ts.vect) == idx_first_others);
@ -442,7 +442,7 @@ fn mk_raw_ty(cx: &ctxt, st: &sty, _in_cname: &option::t<str>) -> @raw_t {
ty_uint. {/* no-op */ }
ty_machine(_) {/* no-op */ }
ty_char. {/* no-op */ }
ty_istr. {/* no-op */ }
ty_str. {/* no-op */ }
ty_type. {/* no-op */ }
ty_native(_) {/* no-op */ }
ty_param(_, _) { has_params = true; }
@ -612,7 +612,7 @@ fn walk_ty(cx: &ctxt, walker: ty_walk, ty: t) {
ty_float. {/* no-op */ }
ty_machine(_) {/* no-op */ }
ty_char. {/* no-op */ }
ty_istr. {/* no-op */ }
ty_str. {/* no-op */ }
ty_type. {/* no-op */ }
ty_native(_) {/* no-op */ }
ty_box(tm) { walk_ty(cx, walker, tm.ty); }
@ -675,7 +675,7 @@ fn fold_ty(cx: &ctxt, fld: fold_mode, ty_0: t) -> t {
ty_float. {/* no-op */ }
ty_machine(_) {/* no-op */ }
ty_char. {/* no-op */ }
ty_istr. {/* no-op */ }
ty_str. {/* no-op */ }
ty_type. {/* no-op */ }
ty_native(_) {/* no-op */ }
ty_box(tm) {
@ -817,19 +817,19 @@ fn type_is_copyable(cx: &ctxt, ty: t) -> bool {
fn type_is_sequence(cx: &ctxt, ty: t) -> bool {
alt struct(cx, ty) {
ty_istr. { ret true; }
ty_str. { ret true; }
ty_vec(_) { ret true; }
_ { ret false; }
}
}
fn type_is_str(cx: &ctxt, ty: t) -> bool {
alt struct(cx, ty) { ty_istr. { ret true; } _ { ret false; } }
alt struct(cx, ty) { ty_str. { ret true; } _ { ret false; } }
}
fn sequence_element_type(cx: &ctxt, ty: t) -> t {
alt struct(cx, ty) {
ty_istr. { ret mk_mach(cx, ast::ty_u8); }
ty_str. { ret mk_mach(cx, ast::ty_u8); }
ty_vec(mt) { ret mt.ty; }
_ { cx.sess.bug("sequence_element_type called on non-sequence value"); }
}
@ -870,7 +870,7 @@ fn type_is_boxed(cx: &ctxt, ty: t) -> bool {
fn type_is_vec(cx: &ctxt, ty: t) -> bool {
ret alt struct(cx, ty) {
ty_vec(_) { true }
ty_istr. { true }
ty_str. { true }
_ { false }
};
}
@ -879,7 +879,7 @@ fn type_is_unique(cx: &ctxt, ty: t) -> bool {
alt struct(cx, ty) {
ty_uniq(_) { ret true; }
ty_vec(_) { true }
ty_istr. { true }
ty_str. { true }
_ { ret false; }
}
}
@ -985,7 +985,7 @@ fn type_kind(cx: &ctxt, ty: t) -> ast::kind {
// A handful of other built-in are unique too.
ty_type. | ty_istr. | ty_native_fn(_, _, _) {
ty_type. | ty_str. | ty_native_fn(_, _, _) {
// no-op
}
@ -1228,7 +1228,7 @@ fn type_is_pod(cx: &ctxt, ty: t) -> bool {
// Boxed types
ty_istr. | ty_box(_) | ty_vec(_) | ty_fn(_, _, _, _, _) |
ty_str. | ty_box(_) | ty_vec(_) | ty_fn(_, _, _, _, _) |
ty_native_fn(_, _, _) | ty_obj(_) {
result = false;
}
@ -1382,7 +1382,7 @@ fn hash_type_structure(st: &sty) -> uint {
}
}
ty_char. { ret 15u; }
ty_istr. { ret 17u; }
ty_str. { ret 17u; }
ty_tag(did, tys) {
let h = hash_def(18u, did);
for typ: t in tys { h += h << 5u + hash_ty(typ); }
@ -2141,7 +2141,7 @@ mod unify {
ty::ty_machine(_) { ret struct_cmp(cx, expected, actual); }
ty::ty_float. { ret struct_cmp(cx, expected, actual); }
ty::ty_char. { ret struct_cmp(cx, expected, actual); }
ty::ty_istr. { ret struct_cmp(cx, expected, actual); }
ty::ty_str. { ret struct_cmp(cx, expected, actual); }
ty::ty_type. { ret struct_cmp(cx, expected, actual); }
ty::ty_native(ex_id) {
alt struct(cx.tcx, actual) {
@ -2740,7 +2740,7 @@ fn is_binopable(cx: &ctxt, ty: t, op: ast::binop) -> bool {
ty_machine(ast::ty_f64.) { tycat_float }
ty_char. { tycat_int }
ty_ptr(_) { tycat_int }
ty_istr. { tycat_str }
ty_str. { tycat_str }
ty_vec(_) { tycat_vec }
ty_rec(_) { tycat_struct }
ty_tup(_) { tycat_struct }

View file

@ -326,7 +326,7 @@ fn ast_ty_to_ty(tcx: &ty::ctxt, getter: &ty_getter, ast_ty: &@ast::ty) ->
ast::ty_float. { typ = ty::mk_float(tcx); }
ast::ty_machine(tm) { typ = ty::mk_mach(tcx, tm); }
ast::ty_char. { typ = ty::mk_char(tcx); }
ast::ty_istr. { typ = ty::mk_istr(tcx); }
ast::ty_str. { typ = ty::mk_istr(tcx); }
ast::ty_box(mt) {
typ = ty::mk_box(tcx, ast_mt_to_mt(tcx, getter, mt));
}
@ -1952,7 +1952,7 @@ fn check_expr_with_unifier(fcx: &@fn_ctxt, expr: &@ast::expr, unify: &unifier,
let ety = expr_ty(tcx, seq);
alt structure_of(fcx, expr.span, ety) {
ty::ty_vec(vec_elt_ty) { elt_ty = vec_elt_ty.ty; }
ty::ty_istr. { elt_ty = ty::mk_mach(tcx, ast::ty_u8); }
ty::ty_str. { elt_ty = ty::mk_mach(tcx, ast::ty_u8); }
_ {
tcx.sess.span_fatal(
expr.span,
@ -2267,7 +2267,7 @@ fn check_expr_with_unifier(fcx: &@fn_ctxt, expr: &@ast::expr, unify: &unifier,
}
alt structure_of(fcx, expr.span, base_t) {
ty::ty_vec(mt) { write::ty_only_fixup(fcx, id, mt.ty); }
ty::ty_istr. {
ty::ty_str. {
let typ = ty::mk_mach(tcx, ast::ty_u8);
write::ty_only_fixup(fcx, id, typ);
}
@ -2731,7 +2731,7 @@ fn arg_is_argv_ty(tcx: &ty::ctxt, a: &ty::arg) -> bool {
ty::ty_vec(mt) {
if mt.mut != ast::imm { ret false; }
alt ty::struct(tcx, mt.ty) {
ty::ty_istr. { ret true; }
ty::ty_str. { ret true; }
_ { ret false; }
}
}

View file

@ -302,7 +302,7 @@ tag ty_ {
ty_float;
ty_machine(ty_mach);
ty_char;
ty_istr;
ty_str;
ty_box(mt);
ty_vec(mt);
ty_ptr(mt);

View file

@ -486,7 +486,7 @@ fn parse_ty(p: &parser, colons_before_params: bool) -> @ast::ty {
} else if eat_word(p, "float") {
t = ast::ty_float;
} else if eat_word(p, "str") {
t = ast::ty_istr;
t = ast::ty_str;
} else if eat_word(p, "char") {
t = ast::ty_char;
/*

View file

@ -275,7 +275,7 @@ fn print_type(s: &ps, ty: &@ast::ty) {
ast::ty_float. { word(s.s, "float"); }
ast::ty_machine(tm) { word(s.s, ast_util::ty_mach_to_str(tm)); }
ast::ty_char. { word(s.s, "char"); }
ast::ty_istr. { word(s.s, "str"); }
ast::ty_str. { word(s.s, "str"); }
ast::ty_box(mt) { word(s.s, "@"); print_mt(s, mt); }
ast::ty_vec(mt) {
word(s.s, "[");

View file

@ -120,7 +120,7 @@ fn visit_ty<E>(t: &@ty, e: &E, v: &vt<E>) {
ty_uint. {/* no-op */ }
ty_machine(_) {/* no-op */ }
ty_char. {/* no-op */ }
ty_istr. {/* no-op */ }
ty_str. {/* no-op */ }
ty_box(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); }

View file

@ -107,7 +107,7 @@ fn ty_to_str(cx: &ctxt, typ: &t) -> str {
ty_uint. { "uint" }
ty_machine(tm) { ty_mach_to_str(tm) }
ty_char. { "char" }
ty_istr. { "str" }
ty_str. { "str" }
ty_box(tm) { "@" + mt_to_str(cx, tm) }
ty_uniq(t) { "~" + ty_to_str(cx, t) }
ty_vec(tm) { "[" + mt_to_str(cx, tm) + "]" }