]> git.lizzy.rs Git - rust.git/commit
rustc: Never register syntax crates in CStore
authorAlex Crichton <alex@alexcrichton.com>
Mon, 7 Apr 2014 19:16:43 +0000 (12:16 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 8 Apr 2014 07:03:11 +0000 (00:03 -0700)
commit5367c32c7ddb873babec89f739a936409d45476a
tree4982c94e31e8a77123c9f9de26aefb86c372ef3a
parent31755e2452b280fe4038140012dcd19560b6f03d
rustc: Never register syntax crates in CStore

When linking, all crates in the local CStore are used to link the final product.
With #[phase(syntax)], crates want to be omitted from this linkage phase, and
this was achieved by dumping the entire CStore after loading crates. This causes
crates like the standard library to get loaded twice. This loading process is a
fairly expensive operation when dealing with decompressing metadata.

This commit alters the loading process to never register syntax crates in
CStore. Instead, only phase(link) crates ever make their way into the map of
crates. The CrateLoader trait was altered to return everything in one method
instead of having separate methods for finding information.
src/librustc/driver/driver.rs
src/librustc/metadata/creader.rs
src/libsyntax/ext/base.rs
src/libsyntax/ext/expand.rs