Remove lots of estr code from rustc. Issue #855
This commit is contained in:
parent
1d3eb4911a
commit
9c173f17c0
26 changed files with 35 additions and 140 deletions
|
@ -84,7 +84,7 @@ fn get_meta_item_value_str(meta: &@ast::meta_item) -> option::t<istr> {
|
||||||
alt meta.node {
|
alt meta.node {
|
||||||
ast::meta_name_value(_, v) {
|
ast::meta_name_value(_, v) {
|
||||||
alt v.node {
|
alt v.node {
|
||||||
ast::lit_str(s, _) { option::some(s) }
|
ast::lit_str(s) { option::some(s) }
|
||||||
_ { option::none }
|
_ { option::none }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ fn span<@T>(item: &T) -> ast::spanned<T> {
|
||||||
|
|
||||||
fn mk_name_value_item_str(name: ast::ident,
|
fn mk_name_value_item_str(name: ast::ident,
|
||||||
value: &istr) -> @ast::meta_item {
|
value: &istr) -> @ast::meta_item {
|
||||||
let value_lit = span(ast::lit_str(value, ast::sk_unique));
|
let value_lit = span(ast::lit_str(value));
|
||||||
ret mk_name_value_item(name, value_lit);
|
ret mk_name_value_item(name, value_lit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -253,7 +253,7 @@ fn mk_test_desc_rec(cx: &test_ctxt, test: test) -> @ast::expr {
|
||||||
ast_util::path_name_i(path)];
|
ast_util::path_name_i(path)];
|
||||||
|
|
||||||
let name_lit: ast::lit =
|
let name_lit: ast::lit =
|
||||||
nospan(ast::lit_str(ast_util::path_name_i(path), ast::sk_unique));
|
nospan(ast::lit_str(ast_util::path_name_i(path)));
|
||||||
let name_expr: ast::expr =
|
let name_expr: ast::expr =
|
||||||
{id: cx.next_node_id(),
|
{id: cx.next_node_id(),
|
||||||
node: ast::expr_lit(@name_lit),
|
node: ast::expr_lit(@name_lit),
|
||||||
|
|
|
@ -460,7 +460,7 @@ fn encode_meta_item(ebml_w: &ebml::writer, mi: &meta_item) {
|
||||||
}
|
}
|
||||||
meta_name_value(name, value) {
|
meta_name_value(name, value) {
|
||||||
alt value.node {
|
alt value.node {
|
||||||
lit_str(value, _) {
|
lit_str(value) {
|
||||||
ebml::start_tag(ebml_w, tag_meta_item_name_value);
|
ebml::start_tag(ebml_w, tag_meta_item_name_value);
|
||||||
ebml::start_tag(ebml_w, tag_meta_item_name);
|
ebml::start_tag(ebml_w, tag_meta_item_name);
|
||||||
ebml_w.writer.write(str::bytes(name));
|
ebml_w.writer.write(str::bytes(name));
|
||||||
|
|
|
@ -193,7 +193,6 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'c' { ret ty::mk_char(st.tcx); }
|
'c' { ret ty::mk_char(st.tcx); }
|
||||||
's' { ret ty::mk_str(st.tcx); }
|
|
||||||
'S' { ret ty::mk_istr(st.tcx); }
|
'S' { ret ty::mk_istr(st.tcx); }
|
||||||
't' {
|
't' {
|
||||||
assert (next(st) as char == '[');
|
assert (next(st) as char == '[');
|
||||||
|
|
|
@ -113,7 +113,6 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ty::ty_char. { w.write_char('c'); }
|
ty::ty_char. { w.write_char('c'); }
|
||||||
ty::ty_str. { w.write_char('s'); }
|
|
||||||
ty::ty_istr. { w.write_char('S'); }
|
ty::ty_istr. { w.write_char('S'); }
|
||||||
ty::ty_tag(def, tys) {
|
ty::ty_tag(def, tys) {
|
||||||
w.write_str(~"t[");
|
w.write_str(~"t[");
|
||||||
|
|
|
@ -282,7 +282,7 @@ fn check_for(cx: &ctx, local: &@ast::local, seq: &@ast::expr, blk: &ast::blk,
|
||||||
let seq_t = ty::expr_ty(cx.tcx, seq);
|
let seq_t = ty::expr_ty(cx.tcx, seq);
|
||||||
alt ty::struct(cx.tcx, seq_t) {
|
alt ty::struct(cx.tcx, seq_t) {
|
||||||
ty::ty_vec(mt) { if mt.mut != ast::imm { unsafe = some(seq_t); } }
|
ty::ty_vec(mt) { if mt.mut != ast::imm { unsafe = some(seq_t); } }
|
||||||
ty::ty_str. | ty::ty_istr. {/* no-op */ }
|
ty::ty_istr. {/* no-op */ }
|
||||||
_ {
|
_ {
|
||||||
cx.tcx.sess.span_unimpl(seq.span, ~"unknown seq type " +
|
cx.tcx.sess.span_unimpl(seq.span, ~"unknown seq type " +
|
||||||
util::ppaux::ty_to_str(cx.tcx, seq_t));
|
util::ppaux::ty_to_str(cx.tcx, seq_t));
|
||||||
|
|
|
@ -137,7 +137,7 @@ fn type_is_gc_relevant(cx: &ty::ctxt, ty: ty::t) -> bool {
|
||||||
ty::ty_constr(sub, _) { ret type_is_gc_relevant(cx, sub); }
|
ty::ty_constr(sub, _) { ret type_is_gc_relevant(cx, sub); }
|
||||||
|
|
||||||
|
|
||||||
ty::ty_str. | ty::ty_box(_) | ty::ty_uniq(_) | ty::ty_fn(_, _, _, _, _)
|
ty::ty_box(_) | ty::ty_uniq(_) | ty::ty_fn(_, _, _, _, _)
|
||||||
| ty::ty_native_fn(_, _, _) | ty::ty_obj(_) | ty::ty_param(_, _) |
|
| ty::ty_native_fn(_, _, _) | ty::ty_obj(_) | ty::ty_param(_, _) |
|
||||||
ty::ty_res(_, _, _) {
|
ty::ty_res(_, _, _) {
|
||||||
ret true;
|
ret true;
|
||||||
|
|
|
@ -305,9 +305,6 @@ fn shape_of(ccx: &@crate_ctxt, t: ty::t) -> [u8] {
|
||||||
ty::ty_machine(ast::ty_i64.) { s += [shape_i64]; }
|
ty::ty_machine(ast::ty_i64.) { s += [shape_i64]; }
|
||||||
|
|
||||||
|
|
||||||
ty::ty_str. {
|
|
||||||
s += [shape_evec, 1u8, 1u8, 0u8, shape_u8];
|
|
||||||
}
|
|
||||||
ty::ty_istr. {
|
ty::ty_istr. {
|
||||||
s += [shape_ivec];
|
s += [shape_ivec];
|
||||||
add_bool(s, true); // type is POD
|
add_bool(s, true); // type is POD
|
||||||
|
|
|
@ -202,7 +202,6 @@ fn type_of_inner(cx: &@crate_ctxt, sp: &span, t: ty::t) -> TypeRef {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ty::ty_char. { llty = T_char(); }
|
ty::ty_char. { llty = T_char(); }
|
||||||
ty::ty_str. { llty = T_ptr(T_str()); }
|
|
||||||
ty::ty_istr. { llty = T_ptr(T_ivec(T_i8())); }
|
ty::ty_istr. { llty = T_ptr(T_ivec(T_i8())); }
|
||||||
ty::ty_tag(did, _) { llty = type_of_tag(cx, sp, did, t); }
|
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_box(mt) { llty = T_ptr(T_box(type_of_inner(cx, sp, mt.ty))); }
|
||||||
|
@ -1334,12 +1333,6 @@ fn incr_refcnt_of_boxed(cx: &@block_ctxt, box_ptr: ValueRef) -> @block_ctxt {
|
||||||
fn make_free_glue(bcx: &@block_ctxt, v0: ValueRef, t: ty::t) {
|
fn make_free_glue(bcx: &@block_ctxt, v0: ValueRef, t: ty::t) {
|
||||||
// NB: v is an *alias* of type t here, not a direct value.
|
// NB: v is an *alias* of type t here, not a direct value.
|
||||||
let bcx = alt ty::struct(bcx_tcx(bcx), t) {
|
let bcx = alt ty::struct(bcx_tcx(bcx), t) {
|
||||||
ty::ty_str. {
|
|
||||||
let v = Load(bcx, v0);
|
|
||||||
if !bcx_ccx(bcx).sess.get_opts().do_gc {
|
|
||||||
trans_non_gc_free(bcx, v)
|
|
||||||
} else { bcx }
|
|
||||||
}
|
|
||||||
ty::ty_box(body_mt) {
|
ty::ty_box(body_mt) {
|
||||||
let v = Load(bcx, v0);
|
let v = Load(bcx, v0);
|
||||||
let body = GEP(bcx, v, [C_int(0), C_int(abi::box_rc_field_body)]);
|
let body = GEP(bcx, v, [C_int(0), C_int(abi::box_rc_field_body)]);
|
||||||
|
@ -1397,7 +1390,6 @@ fn make_drop_glue(bcx: &@block_ctxt, v0: ValueRef, t: ty::t) {
|
||||||
// NB: v0 is an *alias* of type t here, not a direct value.
|
// NB: v0 is an *alias* of type t here, not a direct value.
|
||||||
let ccx = bcx_ccx(bcx);
|
let ccx = bcx_ccx(bcx);
|
||||||
let bcx = alt ty::struct(ccx.tcx, t) {
|
let bcx = alt ty::struct(ccx.tcx, t) {
|
||||||
ty::ty_str. { decr_refcnt_maybe_free(bcx, v0, v0, t) }
|
|
||||||
ty::ty_vec(_) { ivec::make_drop_glue(bcx, v0, t) }
|
ty::ty_vec(_) { ivec::make_drop_glue(bcx, v0, t) }
|
||||||
ty::ty_istr. { ivec::make_drop_glue(bcx, v0, t) }
|
ty::ty_istr. { ivec::make_drop_glue(bcx, v0, t) }
|
||||||
ty::ty_box(_) { decr_refcnt_maybe_free(bcx, v0, v0, t) }
|
ty::ty_box(_) { decr_refcnt_maybe_free(bcx, v0, v0, t) }
|
||||||
|
@ -1843,10 +1835,6 @@ fn iter_sequence(cx: @block_ctxt, v: ValueRef, t: ty::t, f: &val_and_ty_fn)
|
||||||
|
|
||||||
|
|
||||||
alt ty::struct(bcx_tcx(cx), t) {
|
alt ty::struct(bcx_tcx(cx), t) {
|
||||||
ty::ty_str. {
|
|
||||||
let et = ty::mk_mach(bcx_tcx(cx), ast::ty_u8);
|
|
||||||
ret iter_sequence_body(cx, v, et, f, true, false);
|
|
||||||
}
|
|
||||||
ty::ty_vec(elt) {
|
ty::ty_vec(elt) {
|
||||||
ret iter_sequence_body(cx, v, elt.ty, f, false, true);
|
ret iter_sequence_body(cx, v, elt.ty, f, false, true);
|
||||||
}
|
}
|
||||||
|
@ -2263,8 +2251,7 @@ fn trans_crate_lit(cx: &@crate_ctxt, lit: &ast::lit) -> ValueRef {
|
||||||
ast::lit_char(c) { ret C_integral(T_char(), c as uint, False); }
|
ast::lit_char(c) { ret C_integral(T_char(), c as uint, False); }
|
||||||
ast::lit_bool(b) { ret C_bool(b); }
|
ast::lit_bool(b) { ret C_bool(b); }
|
||||||
ast::lit_nil. { ret C_nil(); }
|
ast::lit_nil. { ret C_nil(); }
|
||||||
ast::lit_str(s, ast::sk_rc.) { ret C_str(cx, s); }
|
ast::lit_str(s) {
|
||||||
ast::lit_str(s, ast::sk_unique.) {
|
|
||||||
cx.sess.span_unimpl(lit.span, ~"unique string in this context");
|
cx.sess.span_unimpl(lit.span, ~"unique string in this context");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2272,7 +2259,7 @@ fn trans_crate_lit(cx: &@crate_ctxt, lit: &ast::lit) -> ValueRef {
|
||||||
|
|
||||||
fn trans_lit(cx: &@block_ctxt, lit: &ast::lit) -> result {
|
fn trans_lit(cx: &@block_ctxt, lit: &ast::lit) -> result {
|
||||||
alt lit.node {
|
alt lit.node {
|
||||||
ast::lit_str(s, ast::sk_unique.) { ret ivec::trans_istr(cx, s); }
|
ast::lit_str(s) { ret ivec::trans_istr(cx, s); }
|
||||||
_ { ret rslt(cx, trans_crate_lit(bcx_ccx(cx), lit)); }
|
_ { ret rslt(cx, trans_crate_lit(bcx_ccx(cx), lit)); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2351,10 +2338,6 @@ fn trans_evec_append(cx: &@block_ctxt, t: ty::t, lhs: ValueRef,
|
||||||
rhs: ValueRef) -> result {
|
rhs: ValueRef) -> result {
|
||||||
let elt_ty = ty::sequence_element_type(bcx_tcx(cx), t);
|
let elt_ty = ty::sequence_element_type(bcx_tcx(cx), t);
|
||||||
let skip_null = C_bool(false);
|
let skip_null = C_bool(false);
|
||||||
alt ty::struct(bcx_tcx(cx), t) {
|
|
||||||
ty::ty_str. { skip_null = C_bool(true); }
|
|
||||||
_ { }
|
|
||||||
}
|
|
||||||
let bcx = cx;
|
let bcx = cx;
|
||||||
let ti = none::<@tydesc_info>;
|
let ti = none::<@tydesc_info>;
|
||||||
let llvec_tydesc = get_tydesc(bcx, t, false, tps_normal, ti).result;
|
let llvec_tydesc = get_tydesc(bcx, t, false, tps_normal, ti).result;
|
||||||
|
@ -5529,45 +5512,20 @@ fn create_main_wrapper(ccx: &@crate_ctxt, sp: &span, main_llfn: ValueRef,
|
||||||
ccx.sess.span_fatal(sp, ~"multiple 'main' functions");
|
ccx.sess.span_fatal(sp, ~"multiple 'main' functions");
|
||||||
}
|
}
|
||||||
|
|
||||||
let (main_takes_argv, main_takes_istr) =
|
let main_takes_argv =
|
||||||
alt ty::struct(ccx.tcx, main_node_type) {
|
alt ty::struct(ccx.tcx, main_node_type) {
|
||||||
ty::ty_fn(_, args, _, _, _) {
|
ty::ty_fn(_, args, _, _, _) {
|
||||||
if std::vec::len(args) == 0u {
|
std::vec::len(args) != 0u
|
||||||
(false, false)
|
|
||||||
} else {
|
|
||||||
alt ty::struct(ccx.tcx, args[0].ty) {
|
|
||||||
ty::ty_vec({ty: t, _}) {
|
|
||||||
alt ty::struct(ccx.tcx, t) {
|
|
||||||
ty::ty_str. { (true, false) }
|
|
||||||
ty::ty_istr. { (true, true) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let llfn = create_main(ccx, sp, main_llfn,
|
let llfn = create_main(ccx, sp, main_llfn,
|
||||||
main_takes_argv, main_takes_istr);
|
main_takes_argv);
|
||||||
ccx.main_fn = some(llfn);
|
ccx.main_fn = some(llfn);
|
||||||
|
|
||||||
// FIXME: This is a transitional way to let the runtime know
|
|
||||||
// it needs to feed us istrs
|
|
||||||
let lltakesistr = str::as_buf(~"_rust_main_takes_istr", { |buf|
|
|
||||||
llvm::LLVMAddGlobal(ccx.llmod, T_int(), buf)
|
|
||||||
});
|
|
||||||
llvm::LLVMSetInitializer(lltakesistr, C_uint(main_takes_istr as uint));
|
|
||||||
llvm::LLVMSetGlobalConstant(lltakesistr, True);
|
|
||||||
llvm::LLVMSetLinkage(lltakesistr,
|
|
||||||
lib::llvm::LLVMExternalLinkage as llvm::Linkage);
|
|
||||||
|
|
||||||
fn create_main(ccx: &@crate_ctxt, sp: &span, main_llfn: ValueRef,
|
fn create_main(ccx: &@crate_ctxt, sp: &span, main_llfn: ValueRef,
|
||||||
takes_argv: bool, takes_istr: bool) -> ValueRef {
|
takes_argv: bool) -> ValueRef {
|
||||||
let unit_ty = if takes_istr {
|
let unit_ty = ty::mk_istr(ccx.tcx);
|
||||||
ty::mk_istr(ccx.tcx)
|
|
||||||
} else {
|
|
||||||
ty::mk_str(ccx.tcx)
|
|
||||||
};
|
|
||||||
let ivecarg_ty: ty::arg =
|
let ivecarg_ty: ty::arg =
|
||||||
{mode: ty::mo_val,
|
{mode: ty::mo_val,
|
||||||
ty:
|
ty:
|
||||||
|
|
|
@ -408,7 +408,7 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
|
||||||
}
|
}
|
||||||
lit(l) {
|
lit(l) {
|
||||||
test_val = Load(bcx, val);
|
test_val = Load(bcx, val);
|
||||||
kind = alt l.node { ast::lit_str(_, _) { compare } _ { switch } };
|
kind = alt l.node { ast::lit_str(_) { compare } _ { switch } };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,6 @@ export mk_res;
|
||||||
export mk_param;
|
export mk_param;
|
||||||
export mk_ptr;
|
export mk_ptr;
|
||||||
export mk_rec;
|
export mk_rec;
|
||||||
export mk_str;
|
|
||||||
export mk_tag;
|
export mk_tag;
|
||||||
export mk_tup;
|
export mk_tup;
|
||||||
export mk_type;
|
export mk_type;
|
||||||
|
@ -133,7 +132,6 @@ export ty_res;
|
||||||
export ty_param;
|
export ty_param;
|
||||||
export ty_ptr;
|
export ty_ptr;
|
||||||
export ty_rec;
|
export ty_rec;
|
||||||
export ty_str;
|
|
||||||
export ty_tag;
|
export ty_tag;
|
||||||
export ty_tup;
|
export ty_tup;
|
||||||
export ty_type;
|
export ty_type;
|
||||||
|
@ -252,7 +250,6 @@ tag sty {
|
||||||
ty_uint;
|
ty_uint;
|
||||||
ty_machine(ast::ty_mach);
|
ty_machine(ast::ty_mach);
|
||||||
ty_char;
|
ty_char;
|
||||||
ty_str;
|
|
||||||
ty_istr;
|
ty_istr;
|
||||||
ty_tag(def_id, [t]);
|
ty_tag(def_id, [t]);
|
||||||
ty_box(mt);
|
ty_box(mt);
|
||||||
|
@ -335,15 +332,13 @@ const idx_f64: uint = 14u;
|
||||||
|
|
||||||
const idx_char: uint = 15u;
|
const idx_char: uint = 15u;
|
||||||
|
|
||||||
const idx_str: uint = 16u;
|
const idx_istr: uint = 16u;
|
||||||
|
|
||||||
const idx_istr: uint = 17u;
|
const idx_type: uint = 17u;
|
||||||
|
|
||||||
const idx_type: uint = 18u;
|
const idx_bot: uint = 18u;
|
||||||
|
|
||||||
const idx_bot: uint = 19u;
|
const idx_first_others: uint = 19u;
|
||||||
|
|
||||||
const idx_first_others: uint = 20u;
|
|
||||||
|
|
||||||
type type_store = interner::interner<@raw_t>;
|
type type_store = interner::interner<@raw_t>;
|
||||||
|
|
||||||
|
@ -369,7 +364,6 @@ fn populate_type_store(cx: &ctxt) {
|
||||||
intern(cx, ty_machine(ast::ty_f32), none);
|
intern(cx, ty_machine(ast::ty_f32), none);
|
||||||
intern(cx, ty_machine(ast::ty_f64), none);
|
intern(cx, ty_machine(ast::ty_f64), none);
|
||||||
intern(cx, ty_char, none);
|
intern(cx, ty_char, none);
|
||||||
intern(cx, ty_str, none);
|
|
||||||
intern(cx, ty_istr, none);
|
intern(cx, ty_istr, none);
|
||||||
intern(cx, ty_type, none);
|
intern(cx, ty_type, none);
|
||||||
intern(cx, ty_bot, none);
|
intern(cx, ty_bot, none);
|
||||||
|
@ -449,7 +443,6 @@ fn mk_raw_ty(cx: &ctxt, st: &sty, _in_cname: &option::t<istr>) -> @raw_t {
|
||||||
ty_uint. {/* no-op */ }
|
ty_uint. {/* no-op */ }
|
||||||
ty_machine(_) {/* no-op */ }
|
ty_machine(_) {/* no-op */ }
|
||||||
ty_char. {/* no-op */ }
|
ty_char. {/* no-op */ }
|
||||||
ty_str. {/* no-op */ }
|
|
||||||
ty_istr. {/* no-op */ }
|
ty_istr. {/* no-op */ }
|
||||||
ty_type. {/* no-op */ }
|
ty_type. {/* no-op */ }
|
||||||
ty_native(_) {/* no-op */ }
|
ty_native(_) {/* no-op */ }
|
||||||
|
@ -537,8 +530,6 @@ fn mk_mach(_cx: &ctxt, tm: &ast::ty_mach) -> t {
|
||||||
|
|
||||||
fn mk_char(_cx: &ctxt) -> t { ret idx_char; }
|
fn mk_char(_cx: &ctxt) -> t { ret idx_char; }
|
||||||
|
|
||||||
fn mk_str(_cx: &ctxt) -> t { ret idx_str; }
|
|
||||||
|
|
||||||
fn mk_istr(_cx: &ctxt) -> t { ret idx_istr; }
|
fn mk_istr(_cx: &ctxt) -> t { ret idx_istr; }
|
||||||
|
|
||||||
fn mk_tag(cx: &ctxt, did: &ast::def_id, tys: &[t]) -> t {
|
fn mk_tag(cx: &ctxt, did: &ast::def_id, tys: &[t]) -> t {
|
||||||
|
@ -624,7 +615,6 @@ fn walk_ty(cx: &ctxt, walker: ty_walk, ty: t) {
|
||||||
ty_float. {/* no-op */ }
|
ty_float. {/* no-op */ }
|
||||||
ty_machine(_) {/* no-op */ }
|
ty_machine(_) {/* no-op */ }
|
||||||
ty_char. {/* no-op */ }
|
ty_char. {/* no-op */ }
|
||||||
ty_str. {/* no-op */ }
|
|
||||||
ty_istr. {/* no-op */ }
|
ty_istr. {/* no-op */ }
|
||||||
ty_type. {/* no-op */ }
|
ty_type. {/* no-op */ }
|
||||||
ty_native(_) {/* no-op */ }
|
ty_native(_) {/* no-op */ }
|
||||||
|
@ -688,7 +678,6 @@ fn fold_ty(cx: &ctxt, fld: fold_mode, ty_0: t) -> t {
|
||||||
ty_float. {/* no-op */ }
|
ty_float. {/* no-op */ }
|
||||||
ty_machine(_) {/* no-op */ }
|
ty_machine(_) {/* no-op */ }
|
||||||
ty_char. {/* no-op */ }
|
ty_char. {/* no-op */ }
|
||||||
ty_str. {/* no-op */ }
|
|
||||||
ty_istr. {/* no-op */ }
|
ty_istr. {/* no-op */ }
|
||||||
ty_type. {/* no-op */ }
|
ty_type. {/* no-op */ }
|
||||||
ty_native(_) {/* no-op */ }
|
ty_native(_) {/* no-op */ }
|
||||||
|
@ -831,7 +820,6 @@ fn type_is_copyable(cx: &ctxt, ty: t) -> bool {
|
||||||
|
|
||||||
fn type_is_sequence(cx: &ctxt, ty: t) -> bool {
|
fn type_is_sequence(cx: &ctxt, ty: t) -> bool {
|
||||||
alt struct(cx, ty) {
|
alt struct(cx, ty) {
|
||||||
ty_str. { ret true; }
|
|
||||||
ty_istr. { ret true; }
|
ty_istr. { ret true; }
|
||||||
ty_vec(_) { ret true; }
|
ty_vec(_) { ret true; }
|
||||||
_ { ret false; }
|
_ { ret false; }
|
||||||
|
@ -840,7 +828,6 @@ fn type_is_sequence(cx: &ctxt, ty: t) -> bool {
|
||||||
|
|
||||||
fn type_is_str(cx: &ctxt, ty: t) -> bool {
|
fn type_is_str(cx: &ctxt, ty: t) -> bool {
|
||||||
alt struct(cx, ty) {
|
alt struct(cx, ty) {
|
||||||
ty_str. { ret true; }
|
|
||||||
ty_istr. { ret true; }
|
ty_istr. { ret true; }
|
||||||
_ { ret false; }
|
_ { ret false; }
|
||||||
}
|
}
|
||||||
|
@ -848,9 +835,6 @@ fn type_is_str(cx: &ctxt, ty: t) -> bool {
|
||||||
|
|
||||||
fn sequence_is_interior(cx: &ctxt, ty: t) -> bool {
|
fn sequence_is_interior(cx: &ctxt, ty: t) -> bool {
|
||||||
alt struct(cx, ty) {
|
alt struct(cx, ty) {
|
||||||
ty::ty_str. {
|
|
||||||
ret false;
|
|
||||||
}
|
|
||||||
ty::ty_vec(_) { ret true; }
|
ty::ty_vec(_) { ret true; }
|
||||||
ty::ty_istr. { ret true; }
|
ty::ty_istr. { ret true; }
|
||||||
_ { cx.sess.bug(~"sequence_is_interior called on non-sequence type"); }
|
_ { cx.sess.bug(~"sequence_is_interior called on non-sequence type"); }
|
||||||
|
@ -859,7 +843,6 @@ fn sequence_is_interior(cx: &ctxt, ty: t) -> bool {
|
||||||
|
|
||||||
fn sequence_element_type(cx: &ctxt, ty: t) -> t {
|
fn sequence_element_type(cx: &ctxt, ty: t) -> t {
|
||||||
alt struct(cx, ty) {
|
alt struct(cx, ty) {
|
||||||
ty_str. { ret mk_mach(cx, ast::ty_u8); }
|
|
||||||
ty_istr. { ret mk_mach(cx, ast::ty_u8); }
|
ty_istr. { ret mk_mach(cx, ast::ty_u8); }
|
||||||
ty_vec(mt) { ret mt.ty; }
|
ty_vec(mt) { ret mt.ty; }
|
||||||
_ { cx.sess.bug(
|
_ { cx.sess.bug(
|
||||||
|
@ -898,7 +881,6 @@ fn type_is_box(cx: &ctxt, ty: t) -> bool {
|
||||||
|
|
||||||
fn type_is_boxed(cx: &ctxt, ty: t) -> bool {
|
fn type_is_boxed(cx: &ctxt, ty: t) -> bool {
|
||||||
alt struct(cx, ty) {
|
alt struct(cx, ty) {
|
||||||
ty_str. { ret true; }
|
|
||||||
ty_box(_) { ret true; }
|
ty_box(_) { ret true; }
|
||||||
_ { ret false; }
|
_ { ret false; }
|
||||||
}
|
}
|
||||||
|
@ -1020,12 +1002,6 @@ fn type_kind(cx: &ctxt, ty: t) -> ast::kind {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Those things with refcounts-to-interior are just shared.
|
|
||||||
ty_str. {
|
|
||||||
result = kind_shared;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// FIXME: obj is broken for now, since we aren't asserting
|
// FIXME: obj is broken for now, since we aren't asserting
|
||||||
// anything about its fields.
|
// anything about its fields.
|
||||||
ty_obj(_) {
|
ty_obj(_) {
|
||||||
|
@ -1240,7 +1216,7 @@ fn type_is_pod(cx: &ctxt, ty: t) -> bool {
|
||||||
|
|
||||||
|
|
||||||
// Boxed types
|
// Boxed types
|
||||||
ty_str. | ty_istr. | ty_box(_) | ty_vec(_) | ty_fn(_, _, _, _, _) |
|
ty_istr. | ty_box(_) | ty_vec(_) | ty_fn(_, _, _, _, _) |
|
||||||
ty_native_fn(_, _, _) | ty_obj(_) {
|
ty_native_fn(_, _, _) | ty_obj(_) {
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
|
@ -1392,7 +1368,6 @@ fn hash_type_structure(st: &sty) -> uint {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ty_char. { ret 15u; }
|
ty_char. { ret 15u; }
|
||||||
ty_str. { ret 16u; }
|
|
||||||
ty_istr. { ret 17u; }
|
ty_istr. { ret 17u; }
|
||||||
ty_tag(did, tys) {
|
ty_tag(did, tys) {
|
||||||
let h = hash_def(18u, did);
|
let h = hash_def(18u, did);
|
||||||
|
@ -2151,7 +2126,6 @@ mod unify {
|
||||||
ty::ty_machine(_) { ret struct_cmp(cx, expected, actual); }
|
ty::ty_machine(_) { ret struct_cmp(cx, expected, actual); }
|
||||||
ty::ty_float. { 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_char. { ret struct_cmp(cx, expected, actual); }
|
||||||
ty::ty_str. { ret struct_cmp(cx, expected, actual); }
|
|
||||||
ty::ty_istr. { ret struct_cmp(cx, expected, actual); }
|
ty::ty_istr. { ret struct_cmp(cx, expected, actual); }
|
||||||
ty::ty_type. { ret struct_cmp(cx, expected, actual); }
|
ty::ty_type. { ret struct_cmp(cx, expected, actual); }
|
||||||
ty::ty_native(ex_id) {
|
ty::ty_native(ex_id) {
|
||||||
|
@ -2759,7 +2733,6 @@ fn is_binopable(cx: &ctxt, ty: t, op: ast::binop) -> bool {
|
||||||
ty_machine(ast::ty_f64.) { tycat_float }
|
ty_machine(ast::ty_f64.) { tycat_float }
|
||||||
ty_char. { tycat_int }
|
ty_char. { tycat_int }
|
||||||
ty_ptr(_) { tycat_int }
|
ty_ptr(_) { tycat_int }
|
||||||
ty_str. { tycat_str }
|
|
||||||
ty_istr. { tycat_str }
|
ty_istr. { tycat_str }
|
||||||
ty_vec(_) { tycat_vec }
|
ty_vec(_) { tycat_vec }
|
||||||
ty_rec(_) { tycat_struct }
|
ty_rec(_) { tycat_struct }
|
||||||
|
|
|
@ -326,7 +326,6 @@ 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_float. { typ = ty::mk_float(tcx); }
|
||||||
ast::ty_machine(tm) { typ = ty::mk_mach(tcx, tm); }
|
ast::ty_machine(tm) { typ = ty::mk_mach(tcx, tm); }
|
||||||
ast::ty_char. { typ = ty::mk_char(tcx); }
|
ast::ty_char. { typ = ty::mk_char(tcx); }
|
||||||
ast::ty_str. { typ = ty::mk_str(tcx); }
|
|
||||||
ast::ty_istr. { typ = ty::mk_istr(tcx); }
|
ast::ty_istr. { typ = ty::mk_istr(tcx); }
|
||||||
ast::ty_box(mt) {
|
ast::ty_box(mt) {
|
||||||
typ = ty::mk_box(tcx, ast_mt_to_mt(tcx, getter, mt));
|
typ = ty::mk_box(tcx, ast_mt_to_mt(tcx, getter, mt));
|
||||||
|
@ -1308,8 +1307,7 @@ fn gather_locals(ccx: &@crate_ctxt, f: &ast::_fn, id: &ast::node_id,
|
||||||
// AST fragment checking
|
// AST fragment checking
|
||||||
fn check_lit(ccx: @crate_ctxt, lit: &@ast::lit) -> ty::t {
|
fn check_lit(ccx: @crate_ctxt, lit: &@ast::lit) -> ty::t {
|
||||||
alt lit.node {
|
alt lit.node {
|
||||||
ast::lit_str(_, ast::sk_rc.) { ret ty::mk_str(ccx.tcx); }
|
ast::lit_str(_) { ret ty::mk_istr(ccx.tcx); }
|
||||||
ast::lit_str(_, ast::sk_unique.) { ret ty::mk_istr(ccx.tcx); }
|
|
||||||
ast::lit_char(_) { ret ty::mk_char(ccx.tcx); }
|
ast::lit_char(_) { ret ty::mk_char(ccx.tcx); }
|
||||||
ast::lit_int(_) { ret ty::mk_int(ccx.tcx); }
|
ast::lit_int(_) { ret ty::mk_int(ccx.tcx); }
|
||||||
ast::lit_float(_) { ret ty::mk_float(ccx.tcx); }
|
ast::lit_float(_) { ret ty::mk_float(ccx.tcx); }
|
||||||
|
@ -1869,13 +1867,7 @@ fn check_expr_with_unifier(fcx: &@fn_ctxt, expr: &@ast::expr, unify: &unifier,
|
||||||
alt expr_opt {
|
alt expr_opt {
|
||||||
none. {/* do nothing */ }
|
none. {/* do nothing */ }
|
||||||
some(e) {
|
some(e) {
|
||||||
// FIXME: istr transitional. Should be:
|
check_expr_with(fcx, e, ty::mk_istr(tcx));
|
||||||
// check_expr_with(fcx, e, ty::mk_str(tcx));
|
|
||||||
check_expr(fcx, e);
|
|
||||||
if !are_compatible(fcx, expr_ty(tcx, e), ty::mk_str(tcx))
|
|
||||||
&& !are_compatible(fcx, expr_ty(tcx, e), ty::mk_istr(tcx)) {
|
|
||||||
check_expr_with(fcx, e, ty::mk_str(tcx));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
write::bot_ty(tcx, id);
|
write::bot_ty(tcx, id);
|
||||||
|
@ -1974,7 +1966,6 @@ fn check_expr_with_unifier(fcx: &@fn_ctxt, expr: &@ast::expr, unify: &unifier,
|
||||||
let elt_ty;
|
let elt_ty;
|
||||||
let ety = expr_ty(tcx, seq);
|
let ety = expr_ty(tcx, seq);
|
||||||
alt structure_of(fcx, expr.span, ety) {
|
alt structure_of(fcx, expr.span, ety) {
|
||||||
ty::ty_str. { elt_ty = ty::mk_mach(tcx, ast::ty_u8); }
|
|
||||||
ty::ty_vec(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); }
|
ty::ty_istr. { elt_ty = ty::mk_mach(tcx, ast::ty_u8); }
|
||||||
_ {
|
_ {
|
||||||
|
@ -2294,10 +2285,6 @@ fn check_expr_with_unifier(fcx: &@fn_ctxt, expr: &@ast::expr, unify: &unifier,
|
||||||
}
|
}
|
||||||
alt structure_of(fcx, expr.span, base_t) {
|
alt structure_of(fcx, expr.span, base_t) {
|
||||||
ty::ty_vec(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);
|
|
||||||
}
|
|
||||||
ty::ty_istr. {
|
ty::ty_istr. {
|
||||||
let typ = ty::mk_mach(tcx, ast::ty_u8);
|
let typ = ty::mk_mach(tcx, ast::ty_u8);
|
||||||
write::ty_only_fixup(fcx, id, typ);
|
write::ty_only_fixup(fcx, id, typ);
|
||||||
|
@ -2755,7 +2742,6 @@ fn arg_is_argv_ty(tcx: &ty::ctxt, a: &ty::arg) -> bool {
|
||||||
ty::ty_vec(mt) {
|
ty::ty_vec(mt) {
|
||||||
if mt.mut != ast::imm { ret false; }
|
if mt.mut != ast::imm { ret false; }
|
||||||
alt ty::struct(tcx, mt.ty) {
|
alt ty::struct(tcx, mt.ty) {
|
||||||
ty::ty_str. { ret true; }
|
|
||||||
ty::ty_istr. { ret true; }
|
ty::ty_istr. { ret true; }
|
||||||
_ { ret false; }
|
_ { ret false; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,9 +160,6 @@ type field = spanned<field_>;
|
||||||
|
|
||||||
tag check_mode { checked; unchecked; }
|
tag check_mode { checked; unchecked; }
|
||||||
|
|
||||||
// FIXME: temporary
|
|
||||||
tag seq_kind { sk_unique; sk_rc; }
|
|
||||||
|
|
||||||
type expr = {id: node_id, node: expr_, span: span};
|
type expr = {id: node_id, node: expr_, span: span};
|
||||||
|
|
||||||
tag expr_ {
|
tag expr_ {
|
||||||
|
@ -241,7 +238,7 @@ tag mac_ {
|
||||||
type lit = spanned<lit_>;
|
type lit = spanned<lit_>;
|
||||||
|
|
||||||
tag lit_ {
|
tag lit_ {
|
||||||
lit_str(istr, seq_kind);
|
lit_str(istr);
|
||||||
lit_char(char);
|
lit_char(char);
|
||||||
lit_int(int);
|
lit_int(int);
|
||||||
lit_uint(uint);
|
lit_uint(uint);
|
||||||
|
@ -304,7 +301,6 @@ tag ty_ {
|
||||||
ty_float;
|
ty_float;
|
||||||
ty_machine(ty_mach);
|
ty_machine(ty_mach);
|
||||||
ty_char;
|
ty_char;
|
||||||
ty_str;
|
|
||||||
ty_istr; // interior string
|
ty_istr; // interior string
|
||||||
ty_box(mt);
|
ty_box(mt);
|
||||||
ty_vec(mt); // interior vector
|
ty_vec(mt); // interior vector
|
||||||
|
|
|
@ -104,7 +104,7 @@ fn expr_to_str(cx: &ext_ctxt, expr: @ast::expr, error: &istr) -> istr {
|
||||||
alt expr.node {
|
alt expr.node {
|
||||||
ast::expr_lit(l) {
|
ast::expr_lit(l) {
|
||||||
alt l.node {
|
alt l.node {
|
||||||
ast::lit_str(s, _) { ret s; }
|
ast::lit_str(s) { ret s; }
|
||||||
_ { cx.span_fatal(l.span, error); }
|
_ { cx.span_fatal(l.span, error); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ fn expand_syntax_ext(cx: &ext_ctxt, sp: codemap::span, arg: @ast::expr,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_new_str(cx: &ext_ctxt, sp: codemap::span, s: &istr) -> @ast::expr {
|
fn make_new_str(cx: &ext_ctxt, sp: codemap::span, s: &istr) -> @ast::expr {
|
||||||
ret make_new_lit(cx, sp, ast::lit_str(s, ast::sk_unique));
|
ret make_new_lit(cx, sp, ast::lit_str(s));
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Local Variables:
|
// Local Variables:
|
||||||
|
|
|
@ -53,7 +53,7 @@ fn pieces_to_expr(cx: &ext_ctxt, sp: span, pieces: &[piece],
|
||||||
ret @{id: cx.next_id(), node: ast::expr_lit(sp_lit), span: sp};
|
ret @{id: cx.next_id(), node: ast::expr_lit(sp_lit), span: sp};
|
||||||
}
|
}
|
||||||
fn make_new_str(cx: &ext_ctxt, sp: span, s: &istr) -> @ast::expr {
|
fn make_new_str(cx: &ext_ctxt, sp: span, s: &istr) -> @ast::expr {
|
||||||
let lit = ast::lit_str(s, ast::sk_unique);
|
let lit = ast::lit_str(s);
|
||||||
ret make_new_lit(cx, sp, lit);
|
ret make_new_lit(cx, sp, lit);
|
||||||
}
|
}
|
||||||
fn make_new_int(cx: &ext_ctxt, sp: span, i: int) -> @ast::expr {
|
fn make_new_int(cx: &ext_ctxt, sp: span, i: int) -> @ast::expr {
|
||||||
|
|
|
@ -19,7 +19,6 @@ fn expand_syntax_ext(cx: &ext_ctxt, sp: codemap::span, arg: @ast::expr,
|
||||||
|
|
||||||
ret make_new_lit(cx, sp,
|
ret make_new_lit(cx, sp,
|
||||||
ast::lit_str(expr_to_ident(cx, args[0u],
|
ast::lit_str(expr_to_ident(cx, args[0u],
|
||||||
~"expected an ident"),
|
~"expected an ident")));
|
||||||
ast::sk_unique));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -708,7 +708,7 @@ fn parse_lit(p: &parser) -> ast::lit {
|
||||||
token::LIT_CHAR(c) { p.bump(); lit = ast::lit_char(c); }
|
token::LIT_CHAR(c) { p.bump(); lit = ast::lit_char(c); }
|
||||||
token::LIT_STR(s) {
|
token::LIT_STR(s) {
|
||||||
p.bump();
|
p.bump();
|
||||||
lit = ast::lit_str(p.get_str(s), ast::sk_unique);
|
lit = ast::lit_str(p.get_str(s));
|
||||||
}
|
}
|
||||||
token::LPAREN. {
|
token::LPAREN. {
|
||||||
p.bump();
|
p.bump();
|
||||||
|
@ -895,8 +895,7 @@ fn parse_bottom_expr(p: &parser) -> @ast::expr {
|
||||||
let sp = p.get_span();
|
let sp = p.get_span();
|
||||||
p.bump();
|
p.bump();
|
||||||
let lit =
|
let lit =
|
||||||
@{node: ast::lit_str(p.get_str(s),
|
@{node: ast::lit_str(p.get_str(s)),
|
||||||
ast::sk_unique),
|
|
||||||
span: sp};
|
span: sp};
|
||||||
ex = ast::expr_lit(lit);
|
ex = ast::expr_lit(lit);
|
||||||
}
|
}
|
||||||
|
@ -1503,8 +1502,7 @@ fn parse_pat(p: &parser) -> @ast::pat {
|
||||||
let sp = p.get_span();
|
let sp = p.get_span();
|
||||||
p.bump();
|
p.bump();
|
||||||
let lit =
|
let lit =
|
||||||
@{node: ast::lit_str(p.get_str(s),
|
@{node: ast::lit_str(p.get_str(s)),
|
||||||
ast::sk_unique),
|
|
||||||
span: sp};
|
span: sp};
|
||||||
hi = lit.span.hi;
|
hi = lit.span.hi;
|
||||||
pat = ast::pat_lit(lit);
|
pat = ast::pat_lit(lit);
|
||||||
|
|
|
@ -278,7 +278,6 @@ fn print_type(s: &ps, ty: &@ast::ty) {
|
||||||
word(s.s, ast_util::ty_mach_to_str(tm));
|
word(s.s, ast_util::ty_mach_to_str(tm));
|
||||||
}
|
}
|
||||||
ast::ty_char. { word(s.s, ~"char"); }
|
ast::ty_char. { word(s.s, ~"char"); }
|
||||||
ast::ty_str. { word(s.s, ~"str"); }
|
|
||||||
ast::ty_istr. { word(s.s, ~"str"); }
|
ast::ty_istr. { word(s.s, ~"str"); }
|
||||||
ast::ty_box(mt) { word(s.s, ~"@"); print_mt(s, mt); }
|
ast::ty_box(mt) { word(s.s, ~"@"); print_mt(s, mt); }
|
||||||
ast::ty_vec(mt) {
|
ast::ty_vec(mt) {
|
||||||
|
@ -1505,7 +1504,7 @@ fn print_literal(s: &ps, lit: &@ast::lit) {
|
||||||
_ { }
|
_ { }
|
||||||
}
|
}
|
||||||
alt lit.node {
|
alt lit.node {
|
||||||
ast::lit_str(st, kind) {
|
ast::lit_str(st) {
|
||||||
print_string(s, st);
|
print_string(s, st);
|
||||||
}
|
}
|
||||||
ast::lit_char(ch) {
|
ast::lit_char(ch) {
|
||||||
|
|
|
@ -120,7 +120,6 @@ fn visit_ty<E>(t: &@ty, e: &E, v: &vt<E>) {
|
||||||
ty_uint. {/* no-op */ }
|
ty_uint. {/* no-op */ }
|
||||||
ty_machine(_) {/* no-op */ }
|
ty_machine(_) {/* no-op */ }
|
||||||
ty_char. {/* no-op */ }
|
ty_char. {/* no-op */ }
|
||||||
ty_str. {/* no-op */ }
|
|
||||||
ty_istr. {/* no-op */ }
|
ty_istr. {/* no-op */ }
|
||||||
ty_box(mt) { v.visit_ty(mt.ty, e, v); }
|
ty_box(mt) { v.visit_ty(mt.ty, e, v); }
|
||||||
ty_vec(mt) { v.visit_ty(mt.ty, e, v); }
|
ty_vec(mt) { v.visit_ty(mt.ty, e, v); }
|
||||||
|
|
|
@ -103,9 +103,9 @@ fn local_rhs_span(l: &@ast::local, def: &span) -> span {
|
||||||
|
|
||||||
fn lit_eq(l: &@ast::lit, m: &@ast::lit) -> bool {
|
fn lit_eq(l: &@ast::lit, m: &@ast::lit) -> bool {
|
||||||
alt l.node {
|
alt l.node {
|
||||||
ast::lit_str(s, kind_s) {
|
ast::lit_str(s) {
|
||||||
alt m.node {
|
alt m.node {
|
||||||
ast::lit_str(t, kind_t) { ret s == t && kind_s == kind_t; }
|
ast::lit_str(t) { ret s == t }
|
||||||
_ { ret false; }
|
_ { ret false; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,6 @@ fn ty_to_str(cx: &ctxt, typ: &t) -> istr {
|
||||||
ty_uint. { ~"uint" }
|
ty_uint. { ~"uint" }
|
||||||
ty_machine(tm) { ty_mach_to_str(tm) }
|
ty_machine(tm) { ty_mach_to_str(tm) }
|
||||||
ty_char. { ~"char" }
|
ty_char. { ~"char" }
|
||||||
ty_str. { ~"str" }
|
|
||||||
ty_istr. { ~"istr" }
|
ty_istr. { ~"istr" }
|
||||||
ty_box(tm) { ~"@" + mt_to_str(cx, tm) }
|
ty_box(tm) { ~"@" + mt_to_str(cx, tm) }
|
||||||
ty_uniq(t) { ~"~" + ty_to_str(cx, t) }
|
ty_uniq(t) { ~"~" + ty_to_str(cx, t) }
|
||||||
|
|
|
@ -58,7 +58,7 @@ fn safe_to_steal(e: ast::expr_) -> bool {
|
||||||
}
|
}
|
||||||
ast::expr_lit(lit) {
|
ast::expr_lit(lit) {
|
||||||
alt lit.node {
|
alt lit.node {
|
||||||
ast::lit_str(_, _) { true }
|
ast::lit_str(_) { true }
|
||||||
ast::lit_char(_) { true }
|
ast::lit_char(_) { true }
|
||||||
ast::lit_int(_) { false }
|
ast::lit_int(_) { false }
|
||||||
ast::lit_uint(_) { false }
|
ast::lit_uint(_) { false }
|
||||||
|
|
|
@ -24,13 +24,7 @@ define void @_rust_main_wrap(i1* nocapture, %task *, %2* nocapture, %vec *)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
; FIXME: Transitional. Please remove
|
|
||||||
@_rust_main_takes_istr = external global i32
|
|
||||||
declare void @set_main_takes_istr(i32)
|
|
||||||
|
|
||||||
define i32 @"MAIN"(i32, i32) {
|
define i32 @"MAIN"(i32, i32) {
|
||||||
%i = load i32* @_rust_main_takes_istr
|
|
||||||
call void @set_main_takes_istr(i32 %i)
|
|
||||||
%3 = tail call i32 @rust_start(i32 ptrtoint (void (i1*, %task*, %2*, %vec*)* @_rust_main_wrap to i32), i32 %0, i32 %1, i32 ptrtoint (%0* @_rust_crate_map_toplevel to i32))
|
%3 = tail call i32 @rust_start(i32 ptrtoint (void (i1*, %task*, %2*, %vec*)* @_rust_main_wrap to i32), i32 %0, i32 %1, i32 ptrtoint (%0* @_rust_crate_map_toplevel to i32))
|
||||||
ret i32 %3
|
ret i32 %3
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,8 +97,7 @@ command_line_args : public kernel_owned<command_line_args>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// FIXME: Transitional. Please remove.
|
bool main_takes_istr = true;
|
||||||
bool main_takes_istr = false;
|
|
||||||
|
|
||||||
extern "C" CDECL void
|
extern "C" CDECL void
|
||||||
set_main_takes_istr(uintptr_t flag) {
|
set_main_takes_istr(uintptr_t flag) {
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
// error-pattern:expected str but found [int]
|
// error-pattern:expected istr but found [int]
|
||||||
fn main() { fail [0]; }
|
fn main() { fail [0]; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue