Introduce metadata::cstore
I intend for this to be the location for storing all the data retrieved by creader, most of which is currently in the session.
This commit is contained in:
parent
c7bfef43c8
commit
b23ecd47ce
4 changed files with 43 additions and 1 deletions
|
|
@ -352,8 +352,9 @@ 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 cstore = metadata::cstore::mk_cstore();
|
||||
auto crate_cache = std::map::new_int_hash[session::crate_metadata]();
|
||||
ret session::session(target_cfg, sopts, crate_cache, [],
|
||||
ret session::session(target_cfg, sopts, cstore, crate_cache, [],
|
||||
[], [], codemap::new_codemap(), 0u);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ type crate_metadata = rec(str name, vec[u8] data);
|
|||
|
||||
obj session(@config targ_cfg,
|
||||
@options opts,
|
||||
metadata::cstore::cstore cstore,
|
||||
map::hashmap[int, crate_metadata] crates,
|
||||
mutable vec[str] used_crate_files,
|
||||
mutable vec[str] used_libraries,
|
||||
|
|
@ -53,6 +54,7 @@ obj session(@config targ_cfg,
|
|||
mutable uint err_count) {
|
||||
fn get_targ_cfg() -> @config { ret targ_cfg; }
|
||||
fn get_opts() -> @options { ret opts; }
|
||||
fn get_cstore() -> metadata::cstore::cstore { cstore }
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue