summary refs log tree commit diff
path: root/src/librustc/dep_graph/dep_node.rs
AgeCommit message (Collapse)AuthorLines
2017-11-14Backported merge of #45785 - arielb1:unsafe-fixes, r=eddybbors-2/+2
fixes to MIR effectck r? @eddyb beta-nominating because regression (MIR effectck is new)
2017-10-08Auto merge of #45100 - kennytm:rollup, r=kennytmbors-3/+3
Rollup of 10 pull requests - Successful merges: #45018, #45042, #45052, #45053, #45058, #45060, #45081, #45083, #45090, #45094 - Failed merges:
2017-10-08Auto merge of #44983 - vitiral:dirty_clean_groups, r=michaelwoeristerbors-0/+19
groundwork for rustc_clean/dirty improvements This is a WIP PR that needs mentoring from @michaelwoerister. There are several TODOs but no outstanding questions (except for the main one -- **is this the right approach?**) This is the plumbing for supporing groups in `rustc_clean(labels="...")`, as well as supporting an `except="..."` which will remove the excepted labels in the "clean" check and then assert that they are dirty (this is still TODO). See the code TODO's and example comments for a rough design. I'd like to know if this is the design you would like to do, and then I can go about actually filling out the groups and implementing the remaining logic.
2017-10-05Fix infinite recursion in <DepNode as Debug>.Michael Woerister-3/+3
2017-10-04groundwork for #45009: rustc_dirty/clean enhancementsGarrett Berg-0/+19
2017-10-02incr.comp.: Add some logging to DepGraph::try_mark_green().Michael Woerister-4/+4
2017-10-02incr.comp.: Make some DepNodes non-anonymous.Michael Woerister-46/+8
2017-10-02incr.comp.: Re-execute queries during red/green marking in order to find out ↵Michael Woerister-14/+3
their color.
2017-09-24move unsafety checking to MIRAriel Ben-Yehuda-0/+1
No functional changes intended.
2017-09-23incr.comp.: Remove support for loading metadata fingerprints.Michael Woerister-2/+18
2017-09-22Auto merge of #44696 - michaelwoerister:fingerprints-in-dep-graph-3, ↵bors-19/+50
r=nikomatsakis incr.comp.: Move task result fingerprinting into DepGraph. This PR - makes the DepGraph store all `Fingerprints` of task results, - allows `DepNode` to be marked as input nodes, - makes HIR node hashing use the regular fingerprinting infrastructure, - removes the now unused `IncrementalHashesMap`, and - makes sure that `traits_in_scope_map` fingerprints are stable. r? @nikomatsakis cc @alexcrichton
2017-09-20Fix ICEscalexm-0/+2
2017-09-20incr.comp.: Store result fingerprints in DepGraph.Michael Woerister-3/+14
2017-09-20incr.comp.: Allow for marking DepKinds as inputs.Michael Woerister-17/+37
2017-09-18incr.comp.: Remove tcx from StableHashingContext.Michael Woerister-2/+2
2017-09-18Fix issues uncovered by rebasing:Michael Woerister-0/+12
- 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: Move codegen to a queryAlex Crichton-0/+4
This commit moves the actual code generation in the compiler behind a query keyed by a codegen unit's name. This ended up entailing quite a few internal refactorings to enable this, along with a few cut corners: * The `OutputFilenames` structure is now tracked in the `TyCtxt` as it affects a whole bunch of trans and such. This is now behind a query and threaded into the construction of the `TyCtxt`. * The `TyCtxt` now has a channel "out the back" intended to send data to worker threads in rustc_trans. This is used as a sort of side effect of the codegen query but morally what's happening here is the return value of the query (currently unit but morally a path) is only valid once the background threads have all finished. * Dispatching work items to the codegen threads was refactored to only rely on data in `TyCtxt`, which mostly just involved refactoring where data was stored, moving it from the translation thread to the controller thread's `CodegenContext` or the like. * A new thread locals was introduced in trans to work around the query system. This is used in the implementation of `assert_module_sources` which looks like an artifact of the old query system and will presumably go away once red/green is up and running.
2017-09-17rustc: Remove another global map from transAlex Crichton-0/+1
This commit removes the `crate_trans_items` field from the `CrateContext` of trans. This field, a big map, was calculated during partioning and was a set of all translation items. This isn't quite incremental-friendly because the map may change a lot but not have much effect on downstream consumers. Instead a new query was added for the one location this map was needed, along with a new comment explaining what the location is doing!
2017-09-17rustc: Mostly remove `ExportedSymbols`Alex Crichton-1/+1
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: Move some attr methods to queriesAlex Crichton-0/+2
Otherwise we may emit double errors related to the `#[export_name]` attribute, for example, and using a query should ensure that it's only emitted at most once.
2017-09-17rustc: Make trans collect/partition a queryAlex Crichton-0/+1
This commit moves the `collect_and_partition_translation_items` function into a query on `TyCtxt` instead of a free function in trans, allowing us to track dependencies and such of the function.
2017-09-17rustc: Calculate `ExportedSymbols` in a queryAlex Crichton-1/+2
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-11rustc: Remove HirId from queriesAlex Crichton-9/+9
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-09Auto merge of #44335 - arielb1:node-hashing, r=alexcrichtonbors-1/+20
Avoid hashing when creating a DepNode from a HirId Instead, combine the already-present DefPathHash with the 32-bit ItemLocalIndex. Should fix #44323. r? @alexcrichton
2017-09-07rustc: Remove `CrateStore::crates` as a methodAlex Crichton-0/+1
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-05rustc: Move stability functionality into queriesAlex Crichton-2/+3
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-1/+1
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: Hide `maybe_unused_*` fields in queriesAlex Crichton-0/+2
This commit makes the `maybe_unused_extern_crates` and `maybe_unused_trait_imports` fields of `TyCtxt` private and ensures that they're accessed with queries so the values and results can be tracked.
2017-09-05rustc: Convert `freevars` to a queryAlex Crichton-0/+2
This removes a public mutable (but not actually used mutably) field from the `TyCtxt`, moving it over to a query to ensure that it's tracked over time.
2017-09-05rustc: Remove `CrateStore::used_crate*`Alex Crichton-0/+2
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: Migrate `visible_parent_map` to a queryAlex Crichton-0/+3
Turns out it was basically already a query if you squinted hard enough!
2017-09-05rustc: Migrate `CrateStore::item_body` to a queryAlex Crichton-0/+1
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-0/+2
Given the previous commit, these are now trivially representable as queries!
2017-09-05rustc: Migrate lang items to a queryAlex Crichton-0/+1
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-0/+6
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: Hide the `named_region_map` behind queriesAlex Crichton-0/+4
This commit makes the `named_region_map` field of `GlobalCtxt` private by encapsulating the fields behind new queries, and the new queries are also targeted at particular `HirId` nodes instead of accessing the entire map.
2017-09-05rustc: Remove a number of mutable fields in cstoreAlex Crichton-0/+5
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-0/+3
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-0/+1
2017-09-05rustc: Move crate_hash to a queryAlex Crichton-0/+1
2017-09-05rustc: Move crate_disambiguator to queriesAlex Crichton-0/+1
2017-09-05rustc: Move {plugin,derive}_registrar_fn to queriesAlex Crichton-0/+2
2017-09-05rustc: Migrate `CStore::native_libraries` to a queryAlex Crichton-0/+1
2017-09-05rustc: Migrate `CStore::expored_symbols` to a queryAlex Crichton-0/+1
2017-09-05rustc: Move `impl_defaultness` to a queryAlex Crichton-0/+1
2017-09-05rustc: Move a few more cstore methods to queriesAlex Crichton-5/+8
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-05Avoid hashing when creating a DepNode from a HirIdAriel Ben-Yehuda-1/+20
Instead, combine the already-present DefPathHash with the 32-bit ItemLocalIndex. Should fix #44323.
2017-09-01rustc: rename CodeExtent to Scope and RegionMaps to ScopeTree.Eduard-Mihai Burtescu-1/+1
2017-08-30Merge branch 'hide-trait-map' into rollupAlex Crichton-0/+3
2017-08-29rustc: Make the `export_map` of TyCtxt privateAlex Crichton-0/+1
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.