rustc: Break some of metadata's dependencies on session

This commit is contained in:
Brian Anderson 2012-05-14 20:41:33 -07:00
parent 0f49928c2d
commit 452fc46ffc
7 changed files with 30 additions and 17 deletions

View file

@ -681,7 +681,8 @@ impl helpers for ebml::ebml_deserializer {
impl helpers for @e::encode_ctxt {
fn ty_str_ctxt() -> @tyencode::ctxt {
@{ds: e::def_to_str,
@{diag: self.tcx.sess.diagnostic(),
ds: e::def_to_str,
tcx: self.tcx,
reachable: encoder::reachable(self, _),
abbrevs: tyencode::ac_use_abbrevs(self.type_abbrevs)}

View file

@ -4998,6 +4998,7 @@ fn crate_ctxt_to_encode_parms(cx: @crate_ctxt)
bind astencode::encode_inlined_item(_, _, _, _, cx.maps);
{
diag: cx.sess.diagnostic(),
tcx: cx.tcx,
reachable: cx.reachable,
exp_map: cx.exp_map,

View file

@ -200,7 +200,8 @@ enum ast_ty_to_ty_cache_entry {
}
type ctxt =
@{interner: hashmap<intern_key, t_box>,
@{diag: syntax::diagnostic::span_handler,
interner: hashmap<intern_key, t_box>,
mut next_id: uint,
sess: session::session,
def_map: resolve::def_map,
@ -462,7 +463,8 @@ fn mk_ctxt(s: session::session, dm: resolve::def_map, amap: ast_map::map,
hash_type_structure(k.struct) +
option::map_default(k.o_def_id, 0u, ast_util::hash_def_id)
}, {|&&a, &&b| a == b});
@{interner: interner,
@{diag: s.diagnostic(),
interner: interner,
mut next_id: 0u,
sess: s,
def_map: dm,