提交 a1d71995 编写于 作者: B Brian Anderson

Rename istr-stuff to str in rustc. Issue #855

上级 f1555e2c
......@@ -193,7 +193,7 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
}
}
'c' { ret ty::mk_char(st.tcx); }
'S' { ret ty::mk_istr(st.tcx); }
'S' { ret ty::mk_str(st.tcx); }
't' {
assert (next(st) as char == '[');
let def = parse_def(st, sd);
......
......@@ -2244,7 +2244,7 @@ fn trans_crate_lit(cx: &@crate_ctxt, lit: &ast::lit) -> ValueRef {
fn trans_lit(cx: &@block_ctxt, lit: &ast::lit) -> result {
alt lit.node {
ast::lit_str(s) { ret tvec::trans_istr(cx, s); }
ast::lit_str(s) { ret tvec::trans_str(cx, s); }
_ { ret rslt(cx, trans_crate_lit(bcx_ccx(cx), lit)); }
}
}
......@@ -5465,7 +5465,7 @@ fn create_main_wrapper(ccx: &@crate_ctxt, sp: &span, main_llfn: ValueRef,
fn create_main(ccx: &@crate_ctxt, sp: &span, main_llfn: ValueRef,
takes_argv: bool) -> ValueRef {
let unit_ty = ty::mk_istr(ccx.tcx);
let unit_ty = ty::mk_str(ccx.tcx);
let vecarg_ty: ty::arg =
{mode: ty::mo_val,
ty: ty::mk_vec(ccx.tcx, {ty: unit_ty, mut: ast::imm})};
......
......@@ -121,10 +121,10 @@ fn trans_vec(bcx: &@block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
}
ret rslt(bcx, vptr);
}
fn trans_istr(bcx: &@block_ctxt, s: str) -> result {
fn trans_str(bcx: &@block_ctxt, s: str) -> result {
let veclen = std::str::byte_len(s) + 1u; // +1 for \0
let {bcx: bcx, val: sptr, _} =
alloc(bcx, ty::mk_istr(bcx_tcx(bcx)), veclen);
alloc(bcx, ty::mk_str(bcx_tcx(bcx)), veclen);
let llcstr = C_cstr(bcx_ccx(bcx), s);
let bcx =
......
......@@ -67,7 +67,7 @@
export mk_imm_box;
export mk_mut_ptr;
export mk_int;
export mk_istr;
export mk_str;
export mk_vec;
export mk_mach;
export mk_native;
......@@ -331,7 +331,7 @@ fn method_ty_to_fn_ty(cx: &ctxt, m: method) -> t {
const idx_char: uint = 15u;
const idx_istr: uint = 16u;
const idx_str: uint = 16u;
const idx_type: uint = 17u;
......@@ -529,7 +529,7 @@ fn mk_mach(_cx: &ctxt, tm: &ast::ty_mach) -> t {
fn mk_char(_cx: &ctxt) -> t { ret idx_char; }
fn mk_istr(_cx: &ctxt) -> t { ret idx_istr; }
fn mk_str(_cx: &ctxt) -> t { ret idx_str; }
fn mk_tag(cx: &ctxt, did: &ast::def_id, tys: &[t]) -> t {
ret gen_ty(cx, ty_tag(did, tys));
......
......@@ -326,7 +326,7 @@ fn instantiate(tcx: &ty::ctxt, sp: &span, getter: &ty_getter,
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_str. { typ = ty::mk_istr(tcx); }
ast::ty_str. { typ = ty::mk_str(tcx); }
ast::ty_box(mt) {
typ = ty::mk_box(tcx, ast_mt_to_mt(tcx, getter, mt));
}
......@@ -1298,7 +1298,7 @@ fn visit_item<E>(_i: &@ast::item, _e: &E, _v: &visit::vt<E>) { }
// AST fragment checking
fn check_lit(ccx: @crate_ctxt, lit: &@ast::lit) -> ty::t {
alt lit.node {
ast::lit_str(_) { ret ty::mk_istr(ccx.tcx); }
ast::lit_str(_) { ret ty::mk_str(ccx.tcx); }
ast::lit_char(_) { ret ty::mk_char(ccx.tcx); }
ast::lit_int(_) { ret ty::mk_int(ccx.tcx); }
ast::lit_float(_) { ret ty::mk_float(ccx.tcx); }
......@@ -1853,7 +1853,7 @@ fn check_binop_type_compat(fcx: &@fn_ctxt, span: span, ty: ty::t,
bot = true;
alt expr_opt {
none. {/* do nothing */ }
some(e) { check_expr_with(fcx, e, ty::mk_istr(tcx)); }
some(e) { check_expr_with(fcx, e, ty::mk_str(tcx)); }
}
write::bot_ty(tcx, id);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册