rustc: Remove a number of mutable fields in cstore

This commit started by moving methods from `CrateStore` to queries, but it ended
up necessitating some deeper refactorings to move more items in general to
queries.

Before this commit the *resolver* would walk over the AST and process foreign
modules (`extern { .. }` blocks) and collect `#[link]` annotations. It would
then also process the command line `-l` directives and such. This information
was then stored as precalculated lists in the `CrateStore` object for iterating
over later.

After this, commit, however, this pass no longer happens during resolution but
now instead happens through queries. A query for the linked libraries of a crate
will crawl the crate for `extern` blocks and then process the linkage
annotations at that time.
This commit is contained in:
Alex Crichton 2017-08-30 14:48:57 -07:00
parent 87ea0a19bf
commit 64a70342e6
19 changed files with 366 additions and 309 deletions

View file

@ -694,7 +694,6 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
// this back at some point.
let _ignore = sess.dep_graph.in_ignore();
let mut crate_loader = CrateLoader::new(sess, &cstore, crate_name);
crate_loader.preprocess(&krate);
let resolver_arenas = Resolver::arenas();
let mut resolver = Resolver::new(sess,
&krate,