summary refs log tree commit diff
path: root/compiler/rustc_incremental/src
AgeCommit message (Collapse)AuthorLines
2022-05-10only_local: always check for misuselcnr-5/+2
2022-05-02fix most compiler/ doctestsElliot Roberts-1/+2
2022-04-21Rollup merge of #95434 - cjgillot:dump-dep-kind, r=oli-obkDylan DPC-25/+28
Only output DepKind in dump-dep-graph. When printing the whole DepNode, the output file is simply too massive to be actually useful for profiling. This trimmed down version mixes a lot of information together, but it also allows to ask questions such that "why does this query ever access HIR?".
2022-04-17Auto merge of #95655 - kckeiks:create-hir-crate-items-query, r=cjgillotbors-21/+20
Refactor HIR item-like traversal (part 1) Issue #95004 - Create hir_crate_items query which traverses tcx.hir_crate(()).owners to return a hir::ModuleItems - use tcx.hir_crate_items in tcx.hir().items() to return an iterator of hir::ItemId - use tcx.hir_crate_items to introduce a tcx.hir().par_items(impl Fn(hir::ItemId)) to traverse all items in parallel; Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com> cc `@cjgillot`
2022-04-09replace tcx.hir().item with tcx.def_span queryMiguel Guarniz-9/+6
2022-04-08remove ItemLikeVisitor impls in incremental, interface, metadata and ↵Miguel Guarniz-19/+0
symbol_mangling crates Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-04-08remove some uses of visit_all_item_likes in incremental, metadata and ↵Miguel Guarniz-1/+22
interface crates Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-04-08check_doc_keyword: don't alloc string for emptiness checkklensy-14/+9
check_doc_alias_value: get argument as Symbol to prevent needless string convertions check_doc_attrs: don't alloc vec, iterate over slice. Vec introduced in #83149, but no perf run posted on merge replace as_str() check with symbol check get_single_str_from_tts: don't prealloc string trivial string to str replace LifetimeScopeForPath::NonElided use Vec<Symbol> instead of Vec<String> AssertModuleSource use BTreeSet<Symbol> instead of BTreeSet<String> CrateInfo.crate_name replace FxHashMap<CrateNum, String> with FxHashMap<CrateNum, Symbol>
2022-03-30Spellchecking some commentsYuri Astrakhan-1/+1
This PR attempts to clean up some minor spelling mistakes in comments
2022-03-29Only output DepKind in dump-dep-graph.Camille GILLOT-25/+28
When printing the whole DepNode, the output file is simply too massive to be actually useful for profiling. This trimmed down version mixes a lot of information together, but it also allows to ask questions such that "why does this query ever access HIR?".
2022-03-25incr. comp.: Let compiler retry finalizing session directory a few times.Michael Woerister-2/+23
See https://github.com/rust-lang/rust/issues/86929.
2022-03-16rustc_error: make ErrorReported impossible to constructmark-6/+5
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
2022-03-03all: fix some typoscuishuang-1/+1
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-03-02rename ErrorReported -> ErrorGuaranteedmark-7/+7
2022-02-25Switch bootstrap cfgsMark Rousskov-1/+1
2022-02-19Adopt let else in more placesest31-32/+21
2022-02-01add a rustc::query_stability lintlcnr-0/+1
2022-01-22Make `Decodable` and `Decoder` infallible.Nicholas Nethercote-12/+3
`Decoder` has two impls: - opaque: this impl is already partly infallible, i.e. in some places it currently panics on failure (e.g. if the input is too short, or on a bad `Result` discriminant), and in some places it returns an error (e.g. on a bad `Option` discriminant). The number of places where either happens is surprisingly small, just because the binary representation has very little redundancy and a lot of input reading can occur even on malformed data. - json: this impl is fully fallible, but it's only used (a) for the `.rlink` file production, and there's a `FIXME` comment suggesting it should change to a binary format, and (b) in a few tests in non-fundamental ways. Indeed #85993 is open to remove it entirely. And the top-level places in the compiler that call into decoding just abort on error anyway. So the fallibility is providing little value, and getting rid of it leads to some non-trivial performance improvements. Much of this commit is pretty boring and mechanical. Some notes about a few interesting parts: - The commit removes `Decoder::{Error,error}`. - `InternIteratorElement::intern_with`: the impl for `T` now has the same optimization for small counts that the impl for `Result<T, E>` has, because it's now much hotter. - Decodable impls for SmallVec, LinkedList, VecDeque now all use `collect`, which is nice; the one for `Vec` uses unsafe code, because that gave better perf on some benchmarks.
2022-01-17Rollup merge of #92825 - pierwill:rustc-version-force-rename, r=Mark-SimulacrumMatthias Krüger-1/+1
Rename environment variable for overriding rustc version
2022-01-16Replace NestedVisitorMap with NestedFilterCameron Steffen-9/+9
2022-01-15Reduce use of local_def_id_to_hir_id.Camille GILLOT-2/+1
2022-01-12Rename environment variable for overriding rustc versionpierwill-1/+1
2022-01-09eplace usages of vec![].into_iter with [].into_iterLucas Kent-5/+5
2021-12-21Add `#[rustc_clean(loaded_from_disk)]` to assert loading of query resultAaron Hill-2/+40
Currently, you can use `#[rustc_clean]` to assert to that a particular query (technically, a `DepNode`) is green or red. However, a green `DepNode` does not mean that the query result was actually deserialized from disk - we might have never re-run a query that needed the result. Some incremental tests are written as regression tests for ICEs that occured during query result decoding. Using `#[rustc_clean(loaded_from_disk="typeck")]`, you can now assert that the result of a particular query (e.g. `typeck`) was actually loaded from disk, in addition to being green.
2021-12-19Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obkbors-3/+3
Remove `SymbolStr` This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences. Best reviewed one commit at a time. r? `@oli-obk`
2021-12-15Remove unnecessary sigils around `Symbol::as_str()` calls.Nicholas Nethercote-3/+3
2021-12-13Remove `in_band_lifetimes` from `rustc_incremental`Peter Jaszkowiak-8/+7
2021-12-10Rollup merge of #91625 - est31:remove_indexes, r=oli-obkMatthias Krüger-1/+1
Remove redundant [..]s
2021-12-09Remove redundant [..]sest31-1/+1
2021-12-07Document all public items in `rustc_incremental`pierwill-13/+63
Also: - Review and edit current docs - Enforce documentation for crate Co-authored-by: r00ster <r00ster91@protonmail.com> Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
2021-11-12Add `-Zassert-incr-state` to assert state of incremental cachepierwill-1/+23
2021-11-09Remove `rustc_incremental::persist::fs::dep_graph_path_from`pierwill-4/+1
2021-10-28Revert "Add rustc lint, warning when iterating over hashmaps"Mark Rousskov-1/+0
2021-10-24Rollup merge of #89558 - lcnr:query-stable-lint, r=estebankMatthias Krüger-0/+1
Add rustc lint, warning when iterating over hashmaps r? rust-lang/wg-incr-comp
2021-10-20Merge two query callbacks arrays.Camille GILLOT-32/+29
2021-10-20Rollup merge of #87404 - rylev:artifact-size-profiling, r=wesleywiserYuki Okushi-0/+6
Add support for artifact size profiling This adds support for profiling artifact file sizes (incremental compilation artifacts and query cache to begin with). Eventually we want to track this in perf.rlo so we can ensure that file sizes do not change dramatically on each pull request. This relies on support in measureme: https://github.com/rust-lang/measureme/pull/169. Once that lands we can update this PR to not point to a git dependency. This was worked on together with `@michaelwoerister.` r? `@wesleywiser`
2021-10-16Adopt let_else across the compilerest31-8/+6
This performs a substitution of code following the pattern: let <id> = if let <pat> = ... { identity } else { ... : ! }; To simplify it to: let <pat> = ... { identity } else { ... : ! }; By adopting the let_else feature.
2021-10-15allow `potential_query_instability` everywherelcnr-0/+1
2021-10-07Add support for artifact size profilingRyan Levick-0/+6
2021-09-29Avoid more invocations of hir_crate query.Camille GILLOT-3/+2
2021-09-06Auto merge of #83214 - cjgillot:dep-map, r=michaelwoeristerbors-64/+84
Mmap the incremental data instead of reading it. Instead of reading the full incremental state using `fs::read_file`, we memmap it using a private read-only file-backed map. This allows the system to reclaim any memory we are not using, while ensuring we are not polluted by outside modifications to the file. Suggested in https://github.com/rust-lang/rust/pull/83036#issuecomment-800458082 by `@bjorn3`
2021-09-02Stop using walk_crate.Camille GILLOT-1/+1
2021-08-28Drop the query result memmap before serializing it back.Camille GILLOT-1/+15
2021-08-28Move save_in to file_format.Camille GILLOT-58/+61
2021-08-28Mmap the incremental data instead of reading it.Camille GILLOT-6/+9
2021-08-21Remove `Session.used_attrs` and move logic to `CheckAttrVisitor`Aaron Hill-24/+23
Instead of updating global state to mark attributes as used, we now explicitly emit a warning when an attribute is used in an unsupported position. As a side effect, we are to emit more detailed warning messages (instead of just a generic "unused" message). `Session.check_name` is removed, since its only purpose was to mark the attribute as used. All of the callers are modified to use `Attribute.has_name` Additionally, `AttributeType::AssumedUsed` is removed - an 'assumed used' attribute is implemented by simply not performing any checks in `CheckAttrVisitor` for a particular attribute. We no longer emit unused attribute warnings for the `#[rustc_dummy]` attribute - it's an internal attribute used for tests, so it doesn't mark sense to treat it as 'unused'. With this commit, a large source of global untracked state is removed.
2021-07-18Move OnDiskCache to rustc_query_impl.Camille GILLOT-6/+4
2021-07-06Revert "Revert "Merge CrateDisambiguator into StableCrateId""bjorn3-13/+6
This reverts commit 8176ab8bc18fdd7d3c2cf7f720c51166364c33a3.
2021-06-30Simplify DepGraph creation.Camille GILLOT-6/+9
2021-06-08Do not require the DefPathTable to construct the on-disk cache.Camille GILLOT-6/+2