]> git.lizzy.rs Git - rust.git/commit
rustc: Remove a number of mutable fields in cstore
authorAlex Crichton <alex@alexcrichton.com>
Wed, 30 Aug 2017 21:48:57 +0000 (14:48 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 5 Sep 2017 14:37:28 +0000 (07:37 -0700)
commit64a70342e67f09b5326538b08990d1b0d2900a5b
tree0fef98b42f025e8f13769e92b353e14e994f6ba1
parent87ea0a19bf3a4dccac890b33646fa3460dff5a8b
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.
19 files changed:
src/librustc/dep_graph/dep_node.rs
src/librustc/middle/cstore.rs
src/librustc/ty/maps.rs
src/librustc_driver/driver.rs
src/librustc_metadata/creader.rs
src/librustc_metadata/cstore.rs
src/librustc_metadata/cstore_impl.rs
src/librustc_metadata/diagnostics.rs
src/librustc_metadata/encoder.rs
src/librustc_metadata/lib.rs
src/librustc_metadata/link_args.rs [new file with mode: 0644]
src/librustc_metadata/native_libs.rs [new file with mode: 0644]
src/librustc_trans/back/link.rs
src/librustc_trans/base.rs
src/librustc_trans/callee.rs
src/librustc_trans/consts.rs
src/librustc_trans/lib.rs
src/test/compile-fail/empty-linkname.rs
src/test/compile-fail/feature-gate-static-nobundle.rs