summary refs log tree commit diff
path: root/src/librustc_incremental
AgeCommit message (Collapse)AuthorLines
2017-04-16rustc: use monomorphic const_eval for cross-crate enum discriminants.Eduard-Mihai Burtescu-0/+11
2017-04-12ICH: Replace old, transitive metadata hashing with direct hashing approach.Michael Woerister-106/+81
Instead of collecting all potential inputs to some metadata entry and hashing those, we directly hash the values we are storing in metadata. This is more accurate and doesn't suffer from quadratic blow-up when many entries have the same dependencies.
2017-04-07SVH: Don't hash the HIR twice when once is enough.Michael Woerister-1/+9
The SVH (Strict Version Hash) of a crate is currently computed by hashing the ICHes (Incremental Computation Hashes) of the crate's HIR. This is fine, expect that for incr. comp. we compute two ICH values for each HIR item, one for the complete item and one that just includes the item's interface. The two hashes are are needed for dependency tracking but if we are compiling non-incrementally and just need the ICH values for the SVH, one of them is enough, giving us the opportunity to save some work in this case.
2017-04-07ICH: Centrally compute and cache DefPath hashes as part of DefPathTable.Michael Woerister-16/+1
2017-04-06Introduce HashStable trait and base ICH implementations on it.Michael Woerister-1216/+93
This initial commit provides implementations for HIR, MIR, and everything that also needs to be supported for those two.
2017-03-30Auto merge of #40524 - alexcrichton:update-bootstrap, r=alexcrichtonbors-1/+0
rustbuild: Update bootstrap compiler Now that we've also updated cargo's release process this commit also changes the download location of Cargo from Cargos archives back to the static.r-l.o archives. This should ensure that the Cargo download is the exact Cargo paired with the rustc that we release.
2017-03-29rustbuild: Update bootstrap compilerAlex Crichton-1/+0
Now that we've also updated cargo's release process this commit also changes the download location of Cargo from Cargos archives back to the static.r-l.o archives. This should ensure that the Cargo download is the exact Cargo paired with the rustc that we release.
2017-03-29Merge `ExpnId` and `SyntaxContext`.Jeffrey Seyfried-9/+8
2017-03-27Fix various useless derefs and slicingsOliver Schneider-2/+2
2017-03-23Remove internal liblogAlex Crichton-1/+1
This commit deletes the internal liblog in favor of the implementation that lives on crates.io. Similarly it's also setting a convention for adding crates to the compiler. The main restriction right now is that we want compiler implementation details to be unreachable from normal Rust code (e.g. requires a feature), and by default everything in the sysroot is reachable via `extern crate`. The proposal here is to require that crates pulled in have these lines in their `src/lib.rs`: #![cfg_attr(rustbuild, feature(staged_api, rustc_private))] #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))] This'll mean that by default they're not using these attributes but when compiled as part of the compiler they do a few things: * Mark themselves as entirely unstable via the `staged_api` feature and the `#![unstable]` attribute. * Allow usage of other unstable crates via `feature(rustc_private)` which is required if the crate relies on any other crates to compile (other than std).
2017-03-22Move some constants to rustc::ich.Michael Woerister-22/+4
2017-03-22Move CachingCodemapView to rustc::ich.Michael Woerister-120/+2
2017-03-22Move DefPathHashes to rustc::ichMichael Woerister-40/+2
2017-03-22Move Fingerprint to rustc::ich::Fingerprint.Michael Woerister-117/+7
2017-03-20Rollup merge of #40556 - cramertj:stabilize-pub-restricted, r=petrochenkovCorey Farwell-1/+1
Stabilize pub(restricted) Fix https://github.com/rust-lang/rust/issues/32409
2017-03-19Auto merge of #39799 - dpc:create_dir_all, r=alexcrichtonbors-1/+1
Fix race condition in fs::create_dir_all The code would crash if the directory was created after create_dir_all checked whether the directory already existed. This was contrary to the documentation which claimed to create the directory if it doesn't exist, implying (but not stating) that there would not be a failure due to the directory existing.
2017-03-17Fix race condition in fs::create_dir_allDavid Roundy-1/+1
It is more robust to not fail if any directory in a path was created concurrently. This change lifts rustc internal `create_dir_racy` that was created to handle such conditions to be new `create_dir_all` implementation.
2017-03-15Stabilize pub(restricted)Taylor Cramer-1/+1
2017-03-14Refactor `Attribute` to use `Path` and `TokenStream` instead of `MetaItem`.Jeffrey Seyfried-45/+18
2017-03-10isolate dep-graph tasksNiko Matsakis-1/+5
A task function is now given as a `fn` pointer to ensure that it carries no state. Each fn can take two arguments, because that worked out to be convenient -- these two arguments must be of some type that is `DepGraphSafe`, a new trait that is intended to prevent "leaking" information into the task that was derived from tracked state. This intentionally leaves `DepGraph::in_task()`, the more common form, alone. Eventually all uses of `DepGraph::in_task()` should be ported to `with_task()`, but I wanted to start with a smaller subset. Originally I wanted to use closures bound by an auto trait, but that approach has some limitations: - the trait cannot have a `read()` method; since the current method is unused, that may not be a problem. - more importantly, we would want the auto trait to be "undefined" for all types *by default* -- that is, this use case doesn't really fit the typical auto trait scenario. For example, imagine that there is a `u32` loaded out of a `hir::Node` -- we don't really want to be passing that `u32` into the task!
2017-03-04Auto merge of #40202 - jseyfried:integrate_tokenstream, r=nrcbors-11/+5
syntax: integrate `TokenStream` Use `TokenStream` instead of `Vec<TokenTree>` in `TokenTree::Delimited` and elsewhere. r? @nrc
2017-03-03Integrate `TokenStream`.Jeffrey Seyfried-11/+5
2017-03-03Auto merge of #39927 - nikomatsakis:incr-comp-skip-borrowck-2, r=eddybbors-1/+1
transition borrowck to visit all **bodies** and not item-likes This is a better structure for incremental compilation and also more compatible with the eventual borrowck mir. It also fixes #38520 as a drive-by fix. r? @eddyb
2017-02-28Remove `Token::MatchNt`.Jeffrey Seyfried-4/+0
2017-02-28Add `syntax::ext::tt::quoted::{TokenTree, ..}` and remove ↵Jeffrey Seyfried-20/+0
`tokenstream::TokenTree::Sequence`.
2017-02-28store the visit order in the CrateNiko Matsakis-1/+1
2017-02-25rustc_typeck: rework coherence to be almost completely on-demand.Eduard-Mihai Burtescu-0/+3
2017-02-25rustc_typeck: hook up collect and item/body check to on-demand.Eduard-Mihai Burtescu-0/+6
2017-02-25Rollup merge of #40038 - nikomatsakis:issue-39828, r=michaelwoeristerEduard-Mihai Burtescu-3/+42
detect "bootstrap outputs" when serializing the dep-graph Fixes #39828. r? @michaelwoerister
2017-02-25Rollup merge of #40037 - froydnj:overflow-checks, r=alexcrichtonEduard-Mihai Burtescu-2/+1
add `-C overflow-checks` option In addition to defining and handling the new option, we also add a method on librustc::Session for determining the necessity of overflow checks. This method provides a single point to sort out the three (!) different ways for turning on overflow checks: -C debug-assertions, -C overflow-checks, and -Z force-overflow-checks. I was seeing a [run-pass/issue-28950.rs](https://github.com/rust-lang/rust/blob/b1363a73ede57ae595f3a1be2bb75d308ba4f7f6/src/test/run-pass/issue-28950.rs) failure on my machine with these patches, but I was also seeing the failure without the changes to the core compiler. We'll see what travis says. Fixes #33134. r? @alexcrichton
2017-02-25Rollup merge of #39864 - cramertj:normalize-breaks, r=nikomatsakisEduard-Mihai Burtescu-2/+4
Normalize labeled and unlabeled breaks Part of #39849.
2017-02-22detect "bootstrap outputs" when serializing the dep-graphNiko Matsakis-3/+42
Fixes #39828.
2017-02-22add `-C overflow-checks` optionNathan Froyd-2/+1
In addition to defining and handling the new option, we also add a method on librustc::Session for determining the necessity of overflow checks. This method provides a single point to sort out the three (!) different ways for turning on overflow checks: -C debug-assertions, -C overflow-checks, and -Z force-overflow-checks. Fixes #33134.
2017-02-17Normalize labeled and unlabeled breaksTaylor Cramer-2/+4
2017-02-15Stabilize field init shorthandest31-1/+1
Closes #37340.
2017-02-08Rollup merge of #39582 - nikomatsakis:incr-comp-issue-39569, r=michaelwoeristerCorey Farwell-35/+84
Handle the case where an intermediate node can't be recreated This solution grows the graph, but this is quite the corner case. r? @michaelwoerister
2017-02-06fix case where some edges can't be recreated by expanding the graphNiko Matsakis-35/+84
cc #39569 -- almost certainly a fix for that
2017-02-06Auto merge of #39500 - michaelwoerister:fix-ich-testing, r=nikomatsakisbors-31/+122
Let the dep-tracking test framework check that all #[rustc_dirty] attrs have been actually checked r? @nikomatsakis
2017-02-06Add comment about why the regular unused-attributes infrastructureMichael Woerister-0/+6
is not used for #[rustc_dirty]/#[rustc_clean].
2017-02-04pacify the mercilous tidy, improve cycle unit testNiko Matsakis-8/+76
2017-02-03Let the ICH testing framework check that all #[rustc_dirty] attrs have been ↵Michael Woerister-31/+116
actually checked.
2017-02-03add a comment about optimality that somehow got removedNiko Matsakis-58/+76
2017-02-03s/in_index/input_index/Niko Matsakis-7/+7
2017-02-03make dirty process O(dirty)Niko Matsakis-50/+66
The old algorithm was O(graph)
2017-01-31rewrite the predecessors code to create a reduced graphNiko Matsakis-467/+1095
The old code created a flat listing of "HIR -> WorkProduct" edges. While perfectly general, this could lead to a lot of repetition if the same HIR nodes affect many work-products. This is set to be a problem when we start to skip typeck, since we will be adding a lot more "work-product"-like nodes. The newer code uses an alternative strategy: it "reduces" the graph instead. Basically we walk the dep-graph and convert it to a DAG, where we only keep intermediate nodes if they are used by multiple work-products. This DAG does not contain the same set of nodes as the original graph, but it is guaranteed that (a) every output node is included in the graph and (b) the set of input nodes that can reach each output node is unchanged. (Input nodes are basically HIR nodes and foreign metadata; output nodes are nodes that have assocaited state which we will persist to disk in some way. These are assumed to be disjoint sets.)
2017-01-28rustc: always keep an explicit lifetime in trait objects.Eduard-Mihai Burtescu-1/+1
2017-01-27Auto merge of #39281 - michaelwoerister:make-cc-incr-comp-opt-in, r=nikomatsakisbors-13/+21
incr.comp.: Make cross-crate tracking for incr. comp. opt-in. The current implementation of cross-crate dependency tracking can cause quite long compile times and high memory usage for some crates (see #39208 for example). This PR therefore makes that part of dependency tracking optional. Incremental compilation still works, it will only have very coarse dep-tracking for upstream crates. r? @nikomatsakis
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-11/+11
2017-01-25rename `Tables` to `TypeckTables`Niko Matsakis-4/+4
2017-01-25merge TypeckItemBody and Tables depnodesNiko Matsakis-4/+4