about summary refs log tree commit diff
path: root/compiler/rustc_query_system/src
AgeCommit message (Collapse)AuthorLines
2021-10-20Merge two query callbacks arrays.Camille GILLOT-22/+25
2021-10-20Drop has_params.Camille GILLOT-5/+2
2021-10-20Make hash_result an Option.Camille GILLOT-25/+18
2021-10-20Rollup merge of #87404 - rylev:artifact-size-profiling, r=wesleywiserYuki Okushi-3/+7
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-19Auto merge of #89933 - est31:let_else, r=michaelwoeristerbors-7/+4
Adopt let_else across the compiler 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 (cc #87335). The PR also updates the syn crate because the currently used version of the crate doesn't support `let_else` syntax yet. Note: Generally I'm the person who *removes* usages of unstable features from the compiler, not adds more usages of them, but in this instance I think it hopefully helps the feature get stabilized sooner and in a better state. I have written a [comment](https://github.com/rust-lang/rust/issues/87335#issuecomment-944846205) on the tracking issue about my experience and what I feel could be improved before stabilization of `let_else`.
2021-10-18Auto merge of #89124 - cjgillot:owner-info, r=michaelwoeristerbors-56/+54
Index and hash HIR as part of lowering Part of https://github.com/rust-lang/rust/pull/88186 ~Based on https://github.com/rust-lang/rust/pull/88880 (see merge commit).~ Once HIR is lowered, it is later indexed by the `index_hir` query and hashed for `crate_hash`. This PR moves those post-processing steps to lowering itself. As a side objective, the HIR crate data structure is refactored as an `IndexVec<LocalDefId, Option<OwnerInfo<'hir>>>` where `OwnerInfo` stores all the relevant information for an HIR owner. r? `@michaelwoerister` cc `@petrochenkov`
2021-10-16Adopt let_else across the compilerest31-7/+4
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-11Remove built-in cache_hit trackingMark Rousskov-22/+1
This was already only enabled in debug_assertions builds. Generally, it seems like most use cases that would use this could also use the -Zself-profile flag which also tracks cache hits (in all builds), and so the extra cfg's and such are not really necessary. This is largely just a small cleanup though, which primarily is intended to make other changes easier by avoiding the need to deal with this field.
2021-10-10Compute full HIR hash during lowering.Camille GILLOT-26/+10
2021-10-09Forbid hashing HIR outside of indexing.Camille GILLOT-30/+44
2021-10-07Add support for artifact size profilingRyan Levick-3/+7
2021-10-06Query the fingerprint style during key reconstructionMark Rousskov-9/+30
Keys can be reconstructed from fingerprints that are not DefPathHash, but then we cannot extract a DefId from them.
2021-10-03Add some inlining.Camille GILLOT-0/+8
2021-10-03Access StableHashingContext in rustc_query_system.Camille GILLOT-22/+16
2021-10-03Move ICH to rustc_query_system.Camille GILLOT-0/+526
2021-09-18Auto merge of #82183 - michaelwoerister:lazier-defpathhash-loading2, ↵bors-28/+0
r=wesleywiser Simplify lazy DefPathHash decoding by using an on-disk hash table. This PR simplifies the logic around mapping `DefPathHash` values encountered during incremental compilation to valid `DefId`s in the current session. It is able to do so by using an on-disk hash table encoding that allows for looking up values directly, i.e. without deserializing the entire table. The main simplification comes from not having to keep track of `DefPathHashes` being used during the compilation session.
2021-09-15Use explicit log level in tracing instrument macroTomasz Miąsko-2/+2
Specify a log level in tracing instrument macro explicitly. Additionally reduce the used log level from a default info level to a debug level (all of those appear to be developer oriented logs, so there should be no need to include them in release builds).
2021-09-14Remove RawDefId tracking infrastructure from incr. comp. framework.Michael Woerister-28/+0
This infrastructure is obsolete now with the new encoding scheme for the DefPathHash->DefIndex maps in crate metadata.
2021-09-11Auto merge of #78780 - cjgillot:req, r=Mark-Simulacrumbors-372/+266
Refactor query forcing The control flow in those functions was very complex, with several layers of continuations. I tried to simplify the implementation, while keeping essentially the same logic. Now, all code paths go through `try_execute_query` for the actual query execution. Communication with the `dep_graph` and the live caches are the only difference between query getting/ensuring/forcing.
2021-09-01Remove redundant `Span` in `QueryJobInfo`Noah Lev-11/+8
Previously, `QueryJobInfo` was composed of two parts: a `QueryInfo` and a `QueryJob`. However, both `QueryInfo` and `QueryJob` have a `span` field, which seem to be the same. So, the `span` was recorded twice. Now, `QueryJobInfo` is composed of a `QueryStackFrame` (the other field of `QueryInfo`) and a `QueryJob`. So, now, the `span` is only recorded once.
2021-08-27Note that trait aliases cannot be recursiveNoah Lev-9/+16
2021-08-27Note that type aliases cannot be recursiveNoah Lev-1/+42
2021-08-22Use variable.Camille GILLOT-12/+5
2021-08-22Unify `with_task` functions.Camille GILLOT-103/+76
Remove with_eval_always_task.
2021-08-22Remove force_query_with_job.Camille GILLOT-88/+53
2021-08-22Split try_execute_query.Camille GILLOT-16/+31
2021-08-22Decouple JobOwner from cache.Camille GILLOT-73/+66
2021-08-22Complete job outside of force_query_with_job.Camille GILLOT-14/+11
2021-08-22Do not compute the dep_node twice.Camille GILLOT-33/+21
2021-08-22Make all query forcing go through try_execute_query.Camille GILLOT-40/+31
try_execute_query is now able to centralize the path for query get/ensure/force. try_execute_query now takes the dep_node as a parameter, so it can accommodate `force`. This dep_node is an Option to avoid computing it in the `get` fast path. try_execute_query now returns both the result and the dep_node_index to allow the caller to handle the dep graph. The caller is responsible for marking the dependency.
2021-08-22Remove try_mark_green_and_read.Camille GILLOT-16/+8
2021-08-22Move assertion inwards.Camille GILLOT-17/+18
`with_taks_impl` is only called from `with_eval_always_task` and `with_task` . The former is only used in query invocation, while the latter is also used to start the `tcx` and to trigger codegen. This move should not change significantly the number of calls to this assertion.
2021-08-22Simplify control flow.Camille GILLOT-33/+28
2021-08-21Improve errors for recursive type aliasesNoah Lev-4/+8
2021-08-22Only clone key when needed.Camille GILLOT-4/+6
2021-08-22Move dep_graph checking into try_load_from_disk_and_cache_in_memory.Camille GILLOT-23/+12
2021-08-12Prevent double panic when handling incremental fingerprint mismatchAaron Hill-6/+28
When an incremental fingerprint mismatch occurs, we debug-print our `DepNode` and query result. Unfortunately, the debug printing process may cause us to run additional queries, which can result in a re-entrant fingerprint mismatch error. To avoid a double panic, this commit adds a thread-local variable to detect re-entrant calls.
2021-08-01Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisabors-2/+2
more clippy::complexity fixes (also a couple of clippy::perf fixes)
2021-07-25Restrict field visibilityAaron Hill-1/+1
2021-07-25Create `QuerySideEffects` and use it for diagnosticsAaron Hill-59/+53
2021-07-25clippy::useless_formatMatthias Krüger-2/+2
2021-07-07Add docs to new methodsRyan Levick-1/+2
2021-07-07Profile incremental hashingRyan Levick-3/+24
2021-06-15Auto merge of #85154 - cjgillot:lessfn, r=bjorn3bors-35/+53
Reduce amount of function pointers in query invocation. r? `@ghost`
2021-06-07Auto merge of #85903 - bjorn3:rustc_serialize_cleanup, r=varkorbors-6/+6
Remove unused functions and arguments from rustc_serialize
2021-06-04Rollup merge of #85850 - bjorn3:less_feature_gates, r=jyn514Yuki Okushi-4/+0
Remove unused feature gates The first commit removes a usage of a feature gate, but I don't expect it to be controversial as the feature gate was only used to workaround a limitation of rust in the past. (closures never being `Clone`) The second commit uses `#[allow_internal_unstable]` to avoid leaking the `trusted_step` feature gate usage from inside the index newtype macro. It didn't work for the `min_specialization` feature gate though. The third commit removes (almost) all feature gates from the compiler that weren't used anyway.
2021-06-01Make the reasoning more explicit.Camille GILLOT-5/+9
2021-06-01Avoid creating anonymous nodes with zero or one dependency.Camille GILLOT-27/+49
2021-06-01Remove unused functions and arguments from rustc_serializebjorn3-6/+6