about summary refs log tree commit diff
path: root/compiler/rustc_query_impl
AgeCommit message (Collapse)AuthorLines
2022-01-10Update rayon and rustc-rayonJosh Stone-1/+1
2021-12-23Import `SourceFile`s from crate before decoding foreign `Span`Aaron Hill-0/+14
Fixes #92163 Fixes #92014 When writing to the incremental cache, we encode all `Span`s we encounter, regardless of whether or not their `SourceFile` comes from the local crate, or from a foreign crate. When we decode a `Span`, we use the `StableSourceFileId` we encoded to locate the matching `SourceFile` in the current session. If this id corresponds to a `SourceFile` from another crate, then we need to have already imported that `SourceFile` into our current session. This usually happens automatically during resolution / macro expansion, when we try to resolve definitions from other crates. In certain cases, however, we may try to load a `Span` from a transitive dependency without having ever imported the `SourceFile`s from that crate, leading to an ICE. This PR fixes the issue by calling `imported_source_files()` when we encounter a `SourceFile` with a foreign `CrateNum`. This ensures that all `SourceFile`s from that crate are imported into the current session.
2021-12-19Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obkbors-2/+2
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 `SymbolStr`.Nicholas Nethercote-2/+2
By changing `as_str()` to take `&self` instead of `self`, we can just return `&str`. We're still lying about lifetimes, but it's a smaller lie than before, where `SymbolStr` contained a (fake) `&'static str`!
2021-12-14Remove `in_band_lifetimes` from `rustc_query_impl`LegionMammal978-8/+7
See #91867 for more information.
2021-12-12Query modifierDeadbeef-0/+12
2021-12-09Remove redundant [..]sest31-1/+1
2021-10-28Revert "Add rustc lint, warning when iterating over hashmaps"Mark Rousskov-1/+0
2021-10-25Avoid a branch on key being local for queries that use the same local and ↵bjorn3-8/+20
extern providers
2021-10-25Auto merge of #90210 - cjgillot:qarray2, r=Mark-Simulacrumbors-40/+32
Build the query vtable directly. Continuation of https://github.com/rust-lang/rust/pull/89978. This shrinks the query interface and attempts to reduce the amount of function pointer calls.
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-23Do not require QueryCtxt for cache_on_disk.Camille GILLOT-3/+2
2021-10-23Build the query vtable directly.Camille GILLOT-38/+31
2021-10-21Do not depend on the stored value when trying to cache on disk.Camille GILLOT-2/+2
2021-10-20Build jump table at runtime.Camille GILLOT-59/+71
2021-10-20Invoke callbacks from rustc_middle.Camille GILLOT-35/+2
2021-10-20Merge two query callbacks arrays.Camille GILLOT-67/+34
2021-10-20Make hash_result an Option.Camille GILLOT-12/+6
2021-10-20Move def_path_hash_to_def_id to rustc_middle.Camille GILLOT-18/+1
2021-10-20Rollup merge of #87404 - rylev:artifact-size-profiling, r=wesleywiserYuki Okushi-1/+1
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-15allow `potential_query_instability` everywherelcnr-0/+1
2021-10-11Remove built-in cache_hit trackingMark Rousskov-27/+0
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-09Auto merge of #89343 - Mark-Simulacrum:no-args-queries, r=cjgillotbors-3/+4
Refactor fingerprint reconstruction This PR replaces can_reconstruct_query_key with fingerprint_style, which returns the style of the fingerprint for that query. This allows us to avoid trying to extract a DefId (or equivalent) from keys which *are* reconstructible because they're () but not as DefIds. This is done with the goal of fixing -Zdump-dep-graph, which seems to have broken a while ago (I didn't try to bisect). Currently even on a `fn main() {}` file it'll ICE (you need to also pass -Zquery-dep-graph for it to work at all), and this patch indirectly fixes the cause of that ICE. This also adds a test for it continuing to work.
2021-10-08Auto merge of #89619 - michaelwoerister:incr-vtables, r=nagisabors-0/+11
Turn vtable_allocation() into a query This PR removes the untracked vtable-const-allocation cache from the `tcx` and turns the `vtable_allocation()` method into a query. The change is pretty straightforward and should be backportable without too much effort. Fixes https://github.com/rust-lang/rust/issues/89598.
2021-10-07Turn tcx.vtable_allocation() into a query.Michael Woerister-0/+11
2021-10-07Update to measureme v10Ryan Levick-1/+1
2021-10-07Add support for artifact size profilingRyan Levick-1/+1
2021-10-06Query the fingerprint style during key reconstructionMark Rousskov-3/+4
Keys can be reconstructed from fingerprints that are not DefPathHash, but then we cannot extract a DefId from them.
2021-10-06Do not re-hash foreign spans.Camille GILLOT-11/+16
2021-10-06Access Session while decoding expn_id.Camille GILLOT-1/+6
2021-10-05Auto merge of #89266 - cjgillot:session-ich, r=michaelwoeristerbors-2/+1
Move ICH to rustc_query_system Based on https://github.com/rust-lang/rust/pull/89183 The StableHashingContext does not need to be in rustc_middle. This PR moves it to rustc_query_system. This will avoid a dependency between rustc_ast_lowering and rustc_middle in https://github.com/rust-lang/rust/pull/89124.
2021-10-03Access StableHashingContext in rustc_query_system.Camille GILLOT-1/+0
2021-10-03Remove re-export.Camille GILLOT-2/+2
2021-10-02Prevent macro ambiguity errorsbjorn3-13/+13
The previous macro_rules! parsers failed when an additional modifier was added with ambiguity errors. The error is pretty unclear as to what exactly the cause here is, but this change simplifies the argument parsing code such that the error is avoided.
2021-09-24Auto merge of #89120 - In-line:remove_unneded_visible_parents_map, r=estebankbors-2/+5
Disable visible path calculation for PrettyPrinter in Ok path of compiler
2021-09-20Migrate to 2021Mark Rousskov-1/+1
2021-09-21Disable visible path calculation for PrettyPrinter in Ok path of compilerAlik Aslanyan-2/+5
2021-09-19Auto merge of #88575 - eddyb:fn-abi-queries, r=nagisabors-0/+22
Querify `FnAbi::of_{fn_ptr,instance}` as `fn_abi_of_{fn_ptr,instance}`. *Note: opening this PR as draft because it's based on #88499* This more or less replicates the `LayoutOf::layout_of` setup from #88499, to replace `FnAbi::of_{fn_ptr,instance}` with `FnAbiOf::fn_abi_of_{fn_ptr,instance}`, and also route them through queries (which `layout_of` has used for a while). The two changes at the use sites (other than the names) are: * return type is now wrapped in `&'tcx` * the value *is* interned, which may affect performance * the `extra_args` list is now an interned `&'tcx ty::List<Ty<'tcx>>` * should be cheap (it's empty for anything other than C variadics) Theoretically, a `FnAbiOfHelpers` implementer could choose to keep the `Result<...>` instead of eagerly erroring, but the only existing users of these APIs are codegen backends, so they don't (want to) take advantage of this. At least miri could make use of this, since it prefers propagating errors (it "just" doesn't use `FnAbi` yet - cc `@RalfJung).` The way this is done is probably less efficient than what is possible, because the queries handle the correctness-oriented API (i.e. the split into `fn` pointers vs instances), whereas a lower-level query could end up with more reuse between different instances with identical signatures. r? `@nagisa` cc `@oli-obk` `@bjorn3`
2021-09-18Querify `fn_abi_of_{fn_ptr,instance}`.Eduard-Mihai Burtescu-0/+22
2021-09-14Replace cnum_map with tcx.stable_crate_id_to_crate_num() in OnDiskCache.Michael Woerister-32/+7
2021-09-14Fix up comment about OnDiskCache::foreign_expn_data.Michael Woerister-2/+4
2021-09-14Make DefPathHash->DefId panic for if the mapping fails.Michael Woerister-10/+3
We only use this mapping for cases where we know that it must succeed. Letting it panic otherwise makes it harder to use the API in unsupported ways.
2021-09-14Remove RawDefId tracking infrastructure from incr. comp. framework.Michael Woerister-76/+3
This infrastructure is obsolete now with the new encoding scheme for the DefPathHash->DefIndex maps in crate metadata.
2021-09-14Store DefPathHash->DefIndex map in on-disk-hash-table format in crate metadata.Michael Woerister-72/+14
This encoding allows for random access without an expensive upfront decoding state which in turn allows simplifying the DefPathIndex lookup logic without regressing performance.
2021-09-12Rollup merge of #88709 - BoxyUwU:thir-abstract-const, r=lcnrManish Goregaokar-1/+2
generic_const_exprs: use thir for abstract consts instead of mir Changes `AbstractConst` building to use `thir` instead of `mir` so that there's less chance of consts unifying when they shouldn't because lowering to mir dropped information (see `abstract-consts-as-cast-5.rs` test) r? `@lcnr`
2021-09-10Rename decode to data_untracked.Camille GILLOT-3/+4
2021-09-10Track span dependency using a callback.Camille GILLOT-3/+3
2021-09-10Encode spans relative to their parent.Camille GILLOT-12/+36
2021-09-10Keep a parent LocalDefId in SpanData.Camille GILLOT-1/+1
2021-09-09rename mir -> thir around abstract constsEllen-1/+2