about summary refs log tree commit diff
path: root/compiler/rustc_incremental/src
AgeCommit message (Collapse)AuthorLines
2021-02-18Print -Ztime-passes (and misc stats/logs) on stderr, not stdout.Eduard-Mihai Burtescu-4/+4
2021-02-15Use less HirId when referring to items.Camille GILLOT-14/+14
2021-02-15Only store a LocalDefId in hir::ForeignItem.Camille GILLOT-1/+1
2021-02-15Only store a LocalDefId in hir::ImplItem.Camille GILLOT-2/+2
2021-02-15Only store a LocalDefId in hir::TraitItem.Camille GILLOT-2/+2
2021-02-15Only store a LocalDefId in hir::Item.Camille GILLOT-2/+2
Items are guaranteed to be HIR owner.
2021-01-19Auto merge of #80957 - tgnottingham:direct_serialize_depgraph, ↵bors-75/+7
r=michaelwoerister Serialize dependency graph directly from DepGraph Reduce memory usage by serializing dep graph directly from `DepGraph`, rather than copying it into `SerializedDepGraph` and serializing that.
2021-01-12Serialize dependency graph directly from DepGraphTyson Nottingham-75/+7
Reduce memory usage by serializing dep graph directly from `DepGraph`, rather than copying it into `SerializedDepGraph` and serializing that.
2021-01-12Remove DepKind::CrateMetadata and pre-allocation of DepNodesTyson Nottingham-11/+0
Remove much of the special-case handling around crate metadata dependency tracking by replacing `DepKind::CrateMetadata` and the pre-allocation of corresponding `DepNodes` with on-demand invocation of the `crate_hash` query.
2021-01-11Serialize incr comp structures to file via fixed-size bufferTyson Nottingham-39/+47
Reduce a large memory spike that happens during serialization by writing the incr comp structures to file by way of a fixed-size buffer, rather than an unbounded vector. Effort was made to keep the instruction count close to that of the previous implementation. However, buffered writing to a file inherently has more overhead than writing to a vector, because each write may result in a handleable error. To reduce this overhead, arrangements are made so that each LEB128-encoded integer can be written to the buffer with only one capacity and error check. Higher-level optimizations in which entire composite structures can be written with one capacity and error check are possible, but would require much more work. The performance is mostly on par with the previous implementation, with small to moderate instruction count regressions. The memory reduction is significant, however, so it seems like a worth-while trade-off.
2021-01-06Optimize away some `fs::metadata` calls.Dan Gohman-32/+34
This also eliminates a use of a `Path` convenience function, in support of #80741, refactoring `std::path` to focus on pure data structures and algorithms.
2021-01-02reduce borrowing and (de)referencing around match patterns ↵Matthias Krüger-3/+3
(clippy::match_ref_pats)
2020-12-29Remove `compile-fail` test suiteVadim Petrochenkov-1/+1
2020-12-01Auto merge of #74967 - Aaron1011:feature/incr-def-path-table, r=pnkfelixbors-2/+6
Implement lazy decoding of DefPathTable during incremental compilation PR https://github.com/rust-lang/rust/pull/75813 implemented lazy decoding of the `DefPathTable` from crate metadata. However, it requires decoding the entire `DefPathTable` when incremental compilation is active, so that we can map a decoded `DefPathHash` to a `DefId` from an arbitrary crate. This PR adds support for lazy decoding of dependency `DefPathTable`s when incremental compilation si active. When we load the incremental cache and dep graph, we need the ability to map a `DefPathHash` to a `DefId` in the current compilation session (if the corresponding definition still exists). This is accomplished by storing the old `DefId` (that is, the `DefId` from the previous compilation session) for each `DefPathHash` we need to remap. Since a `DefPathHash` includes the owning crate, the old crate is guaranteed to be the right one (if the definition still exists). We then use the old `DefIndex` as an initial guess, which we validate by comparing the expected and actual `DefPathHash`es. In most cases, foreign crates will be completely unchanged, which means that we our guess will be correct. If our guess is wrong, we fall back to decoding the entire `DefPathTable` for the foreign crate. This still represents an improvement over the status quo, since we can skip decoding the entire `DefPathTable` for other crates (where all of our guesses were correct).
2020-11-26Remove ForeignMod struct.Camille GILLOT-1/+1
2020-11-26Store ForeignItem in a side table.Camille GILLOT-0/+4
2020-11-25Fix rebase falloutAaron Hill-2/+7
2020-11-25Lazy DefPath decoding for incremental compilationAaron Hill-4/+3
2020-11-19Only create `OnDiskCache` in incremental compilation modeAaron Hill-4/+11
This lets us skip doing useless work when we're not in incremental compilation mode.
2020-11-07Allow making `RUSTC_BOOTSTRAP` conditional on the crate nameJoshua Nelson-12/+21
The main change is that `UnstableOptions::from_environment` now requires an (optional) crate name. If the crate name is unknown (`None`), then the new feature is not available and you still have to use `RUSTC_BOOTSTRAP=1`. In practice this means the feature is only available for `--crate-name`, not for `#![crate_name]`; I'm interested in supporting the second but I'm not sure how. Other major changes: - Added `Session::is_nightly_build()`, which uses the `crate_name` of the session - Added `nightly_options::match_is_nightly_build`, a convenience method for looking up `--crate-name` from CLI arguments. `Session::is_nightly_build()`should be preferred where possible, since it will take into account `#![crate_name]` (I think). - Added `unstable_features` to `rustdoc::RenderOptions` There is a user-facing change here: things like `RUSTC_BOOTSTRAP=0` no longer active nightly features. In practice this shouldn't be a big deal, since `RUSTC_BOOTSTRAP` is the opposite of stable and everyone uses `RUSTC_BOOTSTRAP=1` anyway. - Add tests Check against `Cheat`, not whether nightly features are allowed. Nightly features are always allowed on the nightly channel. - Only call `is_nightly_build()` once within a function - Use booleans consistently for rustc_incremental Sessions can't be passed through threads, so `read_file` couldn't take a session. To be consistent, also take a boolean in `write_file_header`.
2020-10-28Delete files immediately, instead of collecting into vectorDániel Buga-20/+17
2020-10-28Avoid reallocating cgu_path_componentsDániel Buga-2/+4
2020-10-28Clean up encode_dep_graphDániel Buga-12/+5
2020-10-28Fix typos and replace static vector with sliceDániel Buga-8/+8
2020-09-23/nightly/nightly-rustcErik Hofmayer-1/+1
2020-09-23Updated html_root_url for compiler cratesErik Hofmayer-1/+1
2020-08-30mv compiler to compiler/mark-0/+2912