Convert crate_ctxt to istrs. Issue #855
This commit is contained in:
parent
32b4524806
commit
afe27d461c
4 changed files with 12 additions and 12 deletions
|
@ -213,14 +213,14 @@ fn encode_type(ecx: &@encode_ctxt, ebml_w: &ebml::writer, typ: ty::t) {
|
|||
|
||||
fn encode_symbol(ecx: &@encode_ctxt, ebml_w: &ebml::writer, id: node_id) {
|
||||
ebml::start_tag(ebml_w, tag_items_data_item_symbol);
|
||||
ebml_w.writer.write(str::bytes(ecx.ccx.item_symbols.get(id)));
|
||||
ebml_w.writer.write(istr::bytes(ecx.ccx.item_symbols.get(id)));
|
||||
ebml::end_tag(ebml_w);
|
||||
}
|
||||
|
||||
fn encode_discriminant(ecx: &@encode_ctxt, ebml_w: &ebml::writer,
|
||||
id: node_id) {
|
||||
ebml::start_tag(ebml_w, tag_items_data_item_symbol);
|
||||
ebml_w.writer.write(str::bytes(ecx.ccx.discrim_symbols.get(id)));
|
||||
ebml_w.writer.write(istr::bytes(ecx.ccx.discrim_symbols.get(id)));
|
||||
ebml::end_tag(ebml_w);
|
||||
}
|
||||
|
||||
|
|
|
@ -5858,7 +5858,7 @@ fn register_fn_pair(cx: &@crate_ctxt, ps: str, llfnty: TypeRef,
|
|||
let gvar =
|
||||
create_fn_pair(cx, ps, llfnty, llfn, cx.sess.get_opts().library);
|
||||
cx.item_ids.insert(id, llfn);
|
||||
cx.item_symbols.insert(id, ps);
|
||||
cx.item_symbols.insert(id, istr::from_estr(ps));
|
||||
cx.fn_pairs.insert(id, gvar);
|
||||
}
|
||||
|
||||
|
@ -6101,7 +6101,7 @@ fn collect_item_1(ccx: @crate_ctxt, i: &@ast::item, pt: &[str],
|
|||
let g = istr::as_buf(s, { |buf|
|
||||
llvm::LLVMAddGlobal(ccx.llmod, type_of(ccx, i.span, typ), buf)
|
||||
});
|
||||
ccx.item_symbols.insert(i.id, istr::to_estr(s));
|
||||
ccx.item_symbols.insert(i.id, s);
|
||||
ccx.consts.insert(i.id, g);
|
||||
}
|
||||
_ { }
|
||||
|
@ -6198,7 +6198,7 @@ fn trans_constant(ccx: @crate_ctxt, it: &@ast::item, pt: &[str],
|
|||
llvm::LLVMSetGlobalConstant(discrim_gvar, True);
|
||||
}
|
||||
ccx.discrims.insert(variant.node.id, discrim_gvar);
|
||||
ccx.discrim_symbols.insert(variant.node.id, istr::to_estr(s));
|
||||
ccx.discrim_symbols.insert(variant.node.id, s);
|
||||
i += 1u;
|
||||
}
|
||||
}
|
||||
|
@ -6428,7 +6428,7 @@ fn trans_crate(sess: &session::session, crate: &@ast::crate, tcx: &ty::ctxt,
|
|||
let tydescs = map::mk_hashmap::<ty::t, @tydesc_info>(hasher, eqer);
|
||||
let lltypes = map::mk_hashmap::<ty::t, TypeRef>(hasher, eqer);
|
||||
let sha1s = map::mk_hashmap::<ty::t, istr>(hasher, eqer);
|
||||
let short_names = map::mk_hashmap::<ty::t, str>(hasher, eqer);
|
||||
let short_names = map::mk_hashmap::<ty::t, istr>(hasher, eqer);
|
||||
let sha = std::sha1::mk_sha1();
|
||||
let ccx =
|
||||
@{sess: sess,
|
||||
|
@ -6439,13 +6439,13 @@ fn trans_crate(sess: &session::session, crate: &@ast::crate, tcx: &ty::ctxt,
|
|||
intrinsics: intrinsics,
|
||||
item_ids: new_int_hash::<ValueRef>(),
|
||||
ast_map: amap,
|
||||
item_symbols: new_int_hash::<str>(),
|
||||
item_symbols: new_int_hash::<istr>(),
|
||||
mutable main_fn: none::<ValueRef>,
|
||||
link_meta: link::build_link_meta(sess, *crate,
|
||||
istr::from_estr(output), sha),
|
||||
tag_sizes: tag_sizes,
|
||||
discrims: new_int_hash::<ValueRef>(),
|
||||
discrim_symbols: new_int_hash::<str>(),
|
||||
discrim_symbols: new_int_hash::<istr>(),
|
||||
fn_pairs: new_int_hash::<ValueRef>(),
|
||||
consts: new_int_hash::<ValueRef>(),
|
||||
obj_methods: new_int_hash::<()>(),
|
||||
|
|
|
@ -131,12 +131,12 @@ type crate_ctxt =
|
|||
intrinsics: hashmap<istr, ValueRef>,
|
||||
item_ids: hashmap<ast::node_id, ValueRef>,
|
||||
ast_map: ast_map::map,
|
||||
item_symbols: hashmap<ast::node_id, str>,
|
||||
item_symbols: hashmap<ast::node_id, istr>,
|
||||
mutable main_fn: option::t<ValueRef>,
|
||||
link_meta: link::link_meta,
|
||||
tag_sizes: hashmap<ty::t, uint>,
|
||||
discrims: hashmap<ast::node_id, ValueRef>,
|
||||
discrim_symbols: hashmap<ast::node_id, str>,
|
||||
discrim_symbols: hashmap<ast::node_id, istr>,
|
||||
fn_pairs: hashmap<ast::node_id, ValueRef>,
|
||||
consts: hashmap<ast::node_id, ValueRef>,
|
||||
obj_methods: hashmap<ast::node_id, ()>,
|
||||
|
@ -147,7 +147,7 @@ type crate_ctxt =
|
|||
names: namegen,
|
||||
sha: std::sha1::sha1,
|
||||
type_sha1s: hashmap<ty::t, istr>,
|
||||
type_short_names: hashmap<ty::t, str>,
|
||||
type_short_names: hashmap<ty::t, istr>,
|
||||
tcx: ty::ctxt,
|
||||
mut_map: alias::mut_map,
|
||||
stats: stats,
|
||||
|
|
|
@ -936,7 +936,7 @@ fn process_normal_mthd(cx: @local_ctxt, m: @ast::method, self_ty: ty::t,
|
|||
// item_ids map, together with the ValueRef that points to where that
|
||||
// method's definition will be in the executable.
|
||||
cx.ccx.item_ids.insert(m.node.id, llfn);
|
||||
cx.ccx.item_symbols.insert(m.node.id, istr::to_estr(s));
|
||||
cx.ccx.item_symbols.insert(m.node.id, s);
|
||||
trans_fn(mcx, m.span, m.node.meth, llfn, some(self_ty), ty_params,
|
||||
m.node.id);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue