summary refs log tree commit diff
path: root/src/librustc_metadata
AgeCommit message (Collapse)AuthorLines
2017-09-23incr.comp.: Remove support for loading metadata fingerprints.Michael Woerister-3/+18
2017-09-20Fix ICEscalexm-0/+13
2017-09-18incr.comp.: Remove tcx from StableHashingContext.Michael Woerister-14/+14
2017-09-18incr.comp.: Already hash HIR bodies during metadata export so they don't ↵Michael Woerister-11/+51
have to be hashed in downstream crates.
2017-09-18Fix issues uncovered by rebasing:Michael Woerister-4/+8
- Don't hash traits in scope as part of HIR hashing any more. - Some queries returned DefIndexes from other crates. - Provide a generic way of stably hashing maps (not used everywhere yet).
2017-09-17rustc: Mostly remove `ExportedSymbols`Alex Crichton-1/+2
This is a big map that ends up inside of a `CrateContext` during translation for all codegen units. This means that any change to the map may end up causing an incremental recompilation of a codegen unit! In order to reduce the amount of dependencies here between codegen units and the actual input crate this commit refactors dealing with exported symbols and such into various queries. The new queries are largely based on existing queries with filled out implementations for the local crate in addition to external crates, but the main idea is that while translating codegen untis no unit needs the entire set of exported symbols, instead they only need queries about particulare `DefId` instances every now and then. The linking stage, however, still generates a full list of all exported symbols from all crates, but that's going to always happen unconditionally anyway, so no news there!
2017-09-17rustc: Calculate `ExportedSymbols` in a queryAlex Crichton-1/+1
This commit moves the definition of the `ExportedSymbols` structure to the `rustc` crate and then creates a query that'll be used to construct the `ExportedSymbols` set. This in turn uses the reachablity query exposed in the previous commit.
2017-09-14bring TyCtxt into scopeDouglas Campos-2/+2
2017-09-13Auto merge of #44420 - alexcrichton:private-cstore, r=michaelwoeristerbors-15/+1
rustc: Make `CrateStore` private to `TyCtxt` This commit makes the `CrateStore` object private to the `ty/context.rs` module and also absent on the `Session` itself. cc #44390 cc #44341 (initial commit pulled and rebased from here)
2017-09-12rustc: Make `CrateStore` private to `TyCtxt`Alex Crichton-15/+1
This commit removes the `cstore_untracked` method, making the `CrateStore` trait object entirely private to the `ty/context.rs` module.
2017-09-12Auto merge of #44133 - vorner:allocator-kind-autodetect, r=alexcrichtonbors-36/+63
Autodetect the type of allocator crate used Annotate the allocator crates (allocator_system, allocator_jemalloc) by the type of allocator they are. If one is requested as an exe allocator, detect its type by the flags. This has the effect that using this (de jure wrong) configuration in the target spec works instead of producing a really unhelpful and arcane linker error: "exe-allocation-crate": "alloc_system" Fixes #43524. There are two yet unsolved FIXME's, I'll be glad for some advice on what to do with them.
2017-09-12Remove the `cstore` reference from Session in order to prepare encapsulating ↵Michael Woerister-4/+4
CrateStore access in tcx.
2017-09-12Auto merge of #44275 - eddyb:deferred-ctfe, r=nikomatsakisbors-3/+25
Evaluate fixed-length array length expressions lazily. This is in preparation for polymorphic array lengths (aka `[T; T::A]`) and const generics. We need deferred const-evaluation to break cycles when array types show up in positions which require knowing the array type to typeck the array length, e.g. the array type is in a `where` clause. The final step - actually passing bounds in scope to array length expressions from the parent - is not done because it still produces cycles when *normalizing* `ParamEnv`s, and @nikomatsakis' in-progress lazy normalization work is needed to deal with that uniformly. However, the changes here are still useful to unlock work on const generics, which @EpicatSupercell manifested interest in, and I might be mentoring them for that, but we need this baseline first. r? @nikomatsakis cc @oli-obk
2017-09-11Auto merge of #44435 - alexcrichton:in-scope, r=michaelwoeristerbors-3/+2
rustc: Remove HirId from queries This'll allow us to reconstruct query parameters purely from the `DepNode` they're associated with. Closes #44414
2017-09-11rustc: Remove HirId from queriesAlex Crichton-3/+2
This'll allow us to reconstruct query parameters purely from the `DepNode` they're associated with. Some queries could move straight to `HirId` but others that don't always have a correspondance between `HirId` and `DefId` moved to two-level maps where the query operates over a `DefIndex`, returning a map, which is then keyed off `ItemLocalId`. Closes #44414
2017-09-11rustc: evaluate fixed-length array length expressions lazily.Eduard-Mihai Burtescu-3/+10
2017-09-11rustc: introduce ty::Const { ConstVal, Ty }.Eduard-Mihai Burtescu-3/+3
2017-09-11rustc: intern ConstVal's in TyCtxt.Eduard-Mihai Burtescu-0/+15
2017-09-10Autodetect the type of allocator crate usedMichal 'vorner' Vaner-36/+63
Annotate the allocator crates (allocator_system, allocator_jemalloc) by the type of allocator they are. If one is requested as an exe allocator, detect its type by the flags. This has the effect that using this (de jure wrong) configuration in the target spec works instead of producing a really unhelpful and arcane linker error: "exe-allocation-crate": "alloc_system" Fixes #43524.
2017-09-09rustc: Remove `DepGraph` handling from rustc_metadataAlex Crichton-238/+95
This should now be entirely tracked through queries, so no need to have a `DepGraph` in the `CStore` object any more!
2017-09-07rustc: Remove `CrateStore::crates` as a methodAlex Crichton-3/+8
This commit moves the `crates` method to a query and then migrates all callers to use a query instead of the now-renamed `crates_untracked` method where possible. Closes #41417
2017-09-05Clarify failure condition on testsAlex Crichton-3/+3
2017-09-05rustc: Store InternedString in `DefPathData`Alex Crichton-10/+10
Previously a `Symbol` was stored there, but this ended up causing hash collisions in situations that otherwise shouldn't have a hash collision. Only the symbol's string value was hashed, but it was possible for distinct symbols to have the same string value, fooling various calcuations into thinking that these paths *didn't* need disambiguating data when in fact they did! By storing `InternedString` instead we're hopefully triggering all the exising logic to disambiguate paths with same-name `Symbol` but actually distinct locations.
2017-09-05rustc: Move stability functionality into queriesAlex Crichton-2/+10
This commit primarily removes the `stability` field from `TyCtxt` as well as its internal mutable state, instead using a query to build the stability index as well as primarily using queries for other related lookups. Like previous commits the calculation of the stability index is wrapped in a `with_ignore` node to avoid regressing the current tests, and otherwise this commit also introduces #44232 but somewhat intentionally so.
2017-09-05rustc: Rename item_body query to extern_const_bodyAlex Crichton-9/+6
Should hopefully more accurately reflect what's happening! This commit also removes the cache in the cstore implementation as it's already cached through the query infrastructure.
2017-09-05rustc: Remove `CrateStore::used_crate*`Alex Crichton-56/+17
This commit removes the `use_crates` and `used_crate_source` methods in favor of a mix of queries and helper methods being used now instead.
2017-09-05rustc: Classify two more CrateStore methods untrackedAlex Crichton-2/+2
These are only called pre-TyCtxt (e.g. lowering/resolve), so make it explicit in the name that they're untracked and therefore unsuitable to called elsewhere.
2017-09-05rustc: Migrate `visible_parent_map` to a queryAlex Crichton-66/+66
Turns out it was basically already a query if you squinted hard enough!
2017-09-05rustc: Migrate `CrateStore::item_body` to a queryAlex Crichton-15/+8
This commit migrates the `item_body` method on `CrateStore` to a query instead to enable better tracking of dependencies and whatnot.
2017-09-05rustc: Remove lang item methods from CrateStoreAlex Crichton-13/+3
Given the previous commit, these are now trivially representable as queries!
2017-09-05rustc: Migrate lang items to a queryAlex Crichton-3/+4
This commit moves the calculation of the `LanguageItems` structure into a query rather than being calculated before the `TyCtxt` exists, with the eventual end goal of removing some `CrateStore` methods.
2017-09-05rustc: Flag some CrateStore methods as "untracked"Alex Crichton-13/+24
The main use of `CrateStore` *before* the `TyCtxt` is created is during resolution, but we want to be sure that any methods used before resolution are not used after the `TyCtxt` is created. This commit starts moving the methods used by resolve to all be named `{name}_untracked` where the rest of the compiler uses just `{name}` as a query. During this transition a number of new queries were added to account for post-resolve usage of these methods.
2017-09-05rustc: Remove a number of mutable fields in cstoreAlex Crichton-288/+325
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.
2017-09-05rustc: Move implementations_of_trait to a queryAlex Crichton-20/+31
While we're at it, make it two separate queries so one's for rustdoc and one's for the compiler, hopefully being a bit more targeted.
2017-09-05rustc: Move original_crate_name to a queryAlex Crichton-6/+2
2017-09-05rustc: Move crate_hash to a queryAlex Crichton-11/+1
2017-09-05rustc: Move crate_disambiguator to queriesAlex Crichton-5/+3
2017-09-05rustc: Move {plugin,derive}_registrar_fn to queriesAlex Crichton-16/+10
2017-09-05rustc: Migrate `CStore::native_libraries` to a queryAlex Crichton-5/+1
2017-09-05rustc: Migrate `CStore::expored_symbols` to a queryAlex Crichton-5/+1
2017-09-05rustc: Move `impl_defaultness` to a queryAlex Crichton-6/+1
2017-09-05rustc: Move a few more cstore methods to queriesAlex Crichton-23/+21
This comit applies the following changes: * Deletes the `is_allocator` query as it's no longer used * Moves the `is_sanitizer_runtime` method to a query * Moves the `is_profiler_runtime` method to a query * Moves the `panic_strategy` method to a query * Moves the `is_no_builtins` method to a query * Deletes the cstore method of `is_compiler_builtins`. The query was added in #42588 but the `CrateStore` method was not deleted A good bit of these methods were used late in linking during trans so a new dedicated structure was created to ship a calculated form of this information over to the linker rather than having to ship the whole of `TyCtxt` over to linking.
2017-09-03Auto merge of #44263 - durka:stabilize-discriminant, r=dtolnaybors-1/+0
stabilize mem::discriminant (closes #24263)
2017-09-02stabilize mem::discriminant (closes #24263)Alex Burka-1/+0
2017-09-02rustc_mir: actually "promote" constants' MIR to 'static by removing ↵Eduard-Mihai Burtescu-4/+7
StorageDead's.
2017-08-30Merge branch 'hide-trait-map' into rollupAlex Crichton-2/+3
2017-08-29rustc: Make the `export_map` of TyCtxt privateAlex Crichton-2/+3
This map, like `trait_map`, is calculated in resolve, but we want to be sure to track it for incremental compliation. Hide it behind a query to get more refactorings later.
2017-08-30Make fields of `Span` privateVadim Petrochenkov-3/+3
2017-08-28Merge branch 'master' of https://github.com/rust-lang/rust into genJohn Kåre Alsaker-5/+2
2017-08-27Move unused-extern-crate to late passTatsuyuki Ishi-2/+2