about summary refs log tree commit diff
path: root/compiler/rustc_query_system/src/ich
AgeCommit message (Collapse)AuthorLines
2023-11-26Cut code size for feature hashingMark Rousskov-4/+4
This locally cuts ~32 kB of .text instructions.
2023-11-21Add HashStable_NoContext to simplify HashStable implementations in rustc_type_irMichael Goulet-2/+0
2023-11-16Reduce exposure of things.Nicholas Nethercote-1/+1
2023-09-07Use `Freeze` for `SourceFile.lines`John Kåre Alsaker-4/+5
2023-09-03Use relative positions inside a SourceFile.Camille GILLOT-33/+7
2023-05-24Use `Option::is_some_and` and `Result::is_ok_and` in the compilerMaybe Waffle-2/+2
2023-04-16Remove some unnecessary hash truncationsBen Kimock-1/+1
2023-02-21Use a lock-free datastructure for `source_span`Oli Scherer-1/+1
2023-02-20Make untracked.source_span lockable so that resolution can still write to it ↵Oli Scherer-1/+1
when using TyCtxt
2023-02-20Make untracked.cstore lockable so that resolution can still write to it when ↵Oli Scherer-1/+1
using TyCtxt
2022-12-09Fold `Definitions` into the untracked dataOli Scherer-5/+3
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-14/+6
2022-11-11Hash spans when interning.Camille GILLOT-37/+2
2022-09-30create def ids for impl traits during ast loweringSantiago Pastorino-2/+2
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-2/+5
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-07Use HashStable_Generic in rustc_type_irEric Holk-0/+2
A lot of the types in this crate implemented HashStable directly to avoid circular dependencies. One way around that is to use HashStable_Generic. We adopt that here to avoid a lot of boilerplate. This doesn't update all the types, because some would require `I: Interner + HashStable`.
2022-08-16Auto merge of #100441 - nnethercote:shrink-ast-Attribute, r=petrochenkovbors-3/+3
Shrink `ast::Attribute`. r? `@ghost`
2022-08-16Shrink `ast::Attribute`.Nicholas Nethercote-3/+3
2022-08-07Remove unused hashing infra.Camille GILLOT-22/+7
2022-08-07Derive HashStable for HIR Expr and Ty.Camille GILLOT-14/+0
2022-08-07Stop forcing the hashing of bodies in types and expressions.Camille GILLOT-14/+8
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-4/+4
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-06Make AST lowering a query.Camille GILLOT-6/+6
2022-07-06Allow to create definitions inside the query system.Camille GILLOT-0/+1
2022-06-17Auto merge of #98106 - cjgillot:split-definitions, r=michaelwoeristerbors-2/+9
Split up `Definitions` and `ResolverAstLowering`. Split off https://github.com/rust-lang/rust/pull/95573 r? `@michaelwoerister`
2022-06-14Separate `source_span` and `expn_that_defined` from `Definitions`.Camille GILLOT-2/+9
2022-06-14Remove thread-local `IGNORED_ATTRIBUTES`.Nicholas Nethercote-10/+1
It's just a copy of the read-only global `ich::IGNORED_ATTRIBUTES`, and can be removed without any effect.
2022-06-02Address review comments.Nicholas Nethercote-14/+11
2022-06-01Lazify `SourceFile::lines`.Nicholas Nethercote-5/+12
`SourceFile::lines` is a big part of metadata. It's stored in a compressed form (a difference list) to save disk space. Decoding it is a big fraction of compile time for very small crates/programs. This commit introduces a new type `SourceFileLines` which has a `Lines` form and a `Diffs` form. The latter is used when the metadata is first read, and it is only decoded into the `Lines` form when line data is actually needed. This avoids the decoding cost for many files, especially in `std`. It's a performance win of up to 15% for tiny crates/programs where metadata decoding is a high part of compilation costs. A `Lock` is needed because the methods that access lines data (which can trigger decoding) take `&self` rather than `&mut self`. To allow for this, `SourceFile::lines` now takes a `FnMut` that operates on the lines slice rather than returning the lines slice.
2022-04-12Remove NodeIdHashingMode.Camille GILLOT-107/+8
2022-03-31Move stable hash from TyS into a datastructure that can be shared with other ↵Oli Scherer-0/+8
interned types.
2022-01-05Address review commentsAaron Hill-3/+6
2022-01-05Adjust assert_default_hashing_controlsAaron Hill-0/+7
2022-01-05Ensure that `Fingerprint` caching respects hashing configurationAaron Hill-23/+28
Fixes #92266 In some `HashStable` impls, we use a cache to avoid re-computing the same `Fingerprint` from the same structure (e.g. an `AdtDef`). However, the `StableHashingContext` used can be configured to perform hashing in different ways (e.g. skipping `Span`s). This configuration information is not included in the cache key, which will cause an incorrect `Fingerprint` to be used if we hash the same structure with different `StableHashingContext` settings. To fix this, the configuration settings of `StableHashingContext` are split out into a separate `HashingControls` struct. This struct is used as part of the cache key, ensuring that our caches always produce the correct result for the given settings. With this in place, we now turn off `Span` hashing during the entire process of computing the hash included in legacy symbols. This current has no effect, but will matter when a future PR starts hashing more `Span`s that we currently skip.
2021-12-24Remove special-cased stable hashing for HIR moduleAaron Hill-24/+1
All other 'containers' (e.g. `impl` blocks) hashed their contents in the normal, order-dependent way. However, `Mod` was hashing its contents in a (sort-of) order-independent way. However, the exact order is exposed to consumers through `Mod.item_ids`, and through query results like `hir_module_items`. Therefore, stable hashing needs to take the order of items into account, to avoid fingerprint ICEs. Unforuntately, I was unable to directly build a reproducer for the ICE, due to the behavior of `Fingerprint::combine_commutative`. This operation swaps the upper and lower `u64` when constructing the result, which makes the function non-associative. Since we start the hashing of module items by combining `Fingerprint::ZERO` with the first item, it's difficult to actually build an example where changing the order of module items leaves the final hash unchanged. However, this appears to have been hit in practice in #92218 While we're not able to reproduce it, the fact that proc-macros are involved (which can give an entire module the same span, preventing any span-related invalidations) makes me confident that the root cause of that issue is our method of hashing module items. This PR removes all of the special handling for `Mod`, instead deriving a `HashStable` implementation. This makes `Mod` consistent with other 'contains' like `Impl`, which hash their contents through the typical derive of `HashStable`.
2021-10-21Use SortedMap in HIR.Camille GILLOT-4/+4
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-03Add some inlining.Camille GILLOT-0/+8
2021-10-03Move ICH to rustc_query_system.Camille GILLOT-0/+524