Don't thread the local crate number through the session

It's a constant, anyway.
This commit is contained in:
Marijn Haverbeke 2011-07-05 16:09:32 +02:00
parent 6fd6fdea93
commit 4349eaed84
5 changed files with 7 additions and 13 deletions

View file

@ -344,11 +344,8 @@ fn build_session_options(str binary, getopts::match match, str binary_dir) ->
fn build_session(@session::options sopts) -> session::session {
auto target_cfg = build_target_config();
auto crate_cache = syntax::_std::new_int_hash[session::crate_metadata]();
auto target_crate_num = 0;
auto sess =
session::session(target_crate_num, target_cfg, sopts, crate_cache, [],
ret session::session(target_cfg, sopts, crate_cache, [],
[], [], codemap::new_codemap(), 0u);
ret sess;
}
fn parse_pretty(session::session sess, &str name) -> pp_mode {

View file

@ -41,8 +41,7 @@ type options =
type crate_metadata = rec(str name, vec[u8] data);
obj session(ast::crate_num cnum,
@config targ_cfg,
obj session(@config targ_cfg,
@options opts,
map::hashmap[int, crate_metadata] crates,
mutable vec[str] used_crate_files,
@ -52,7 +51,6 @@ obj session(ast::crate_num cnum,
mutable uint err_count) {
fn get_targ_cfg() -> @config { ret targ_cfg; }
fn get_opts() -> @options { ret opts; }
fn get_targ_crate_num() -> ast::crate_num { ret cnum; }
fn span_fatal(span sp, str msg) -> ! {
// FIXME: Use constants, but rustboot doesn't know how to export them.
codemap::emit_error(some(sp), msg, cm);