about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ich/hcx.rs
AgeCommit message (Collapse)AuthorLines
2021-10-03Move ICH to rustc_query_system.Camille GILLOT-209/+0
2021-10-03Remove StableHashProvider.Camille GILLOT-30/+0
2021-10-03Move rustc_middle::middle::cstore to rustc_session.Camille GILLOT-2/+1
2021-09-21use indexmap instead of hashmaplcnr-41/+2
2021-09-11Auto merge of #84373 - cjgillot:resolve-span, r=michaelwoerister,petrochenkovbors-1/+6
Encode spans relative to the enclosing item The aim of this PR is to avoid recomputing queries when code is moved without modification. MCP at https://github.com/rust-lang/compiler-team/issues/443 This is achieved by : 1. storing the HIR owner LocalDefId information inside the span; 2. encoding and decoding spans relative to the enclosing item in the incremental on-disk cache; 3. marking a dependency to the `source_span(LocalDefId)` query when we translate a span from the short (`Span`) representation to its explicit (`SpanData`) representation. Since all client code uses `Span`, step 3 ensures that all manipulations of span byte positions actually create the dependency edge between the caller and the `source_span(LocalDefId)`. This query return the actual absolute span of the parent item. As a consequence, any source code motion that changes the absolute byte position of a node will either: - modify the distance to the parent's beginning, so change the relative span's hash; - dirty `source_span`, and trigger the incremental recomputation of all code that depends on the span's absolute byte position. With this scheme, I believe the dependency tracking to be accurate. For the moment, the spans are marked during lowering. I'd rather do this during def-collection, but the AST MutVisitor is not practical enough just yet. The only difference is that we attach macro-expanded spans to their expansion point instead of the macro itself.
2021-09-10Encode spans relative to their parent.Camille GILLOT-1/+6
2021-09-09Ignore automatically derived impls of `Clone` and `Debug` in dead code analysisFabian Wolff-2/+0
2021-07-13Cache expansion hash.Camille GILLOT-8/+0
2021-07-04Query-ify global limit attribute handlingAaron Hill-0/+2
2021-06-11Hash DefId in rustc_span.Camille GILLOT-10/+2
2021-03-27Remove (lots of) dead codeJoshua Nelson-5/+0
Found with https://github.com/est31/warnalyzer. Dubious changes: - Is anyone else using rustc_apfloat? I feel weird completely deleting x87 support. - Maybe some of the dead code in rustc_data_structures, in case someone wants to use it in the future? - Don't change rustc_serialize I plan to scrap most of the json module in the near future (see https://github.com/rust-lang/compiler-team/issues/418) and fixing the tests needed more work than I expected. TODO: check if any of the comments on the deleted code should be kept.
2021-03-11Remove useless method.Camille GILLOT-7/+0
2021-01-23Add disambiugator to ExpnDataAaron Hill-0/+8
Due to macro expansion, its possible to end up with two distinct `ExpnId`s that have the same `ExpnData` contents. This violates the contract of `HashStable`, since two unequal `ExpnId`s will end up with equal `Fingerprint`s. This commit adds a `disambiguator` field to `ExpnData`, which is used to force two otherwise-equivalent `ExpnData`s to be distinct.
2020-12-03rustc_span: add span_data_to_lines_and_cols to caching source map viewTyson Nottingham-1/+8
Gives a performance increase over calling byte_pos_to_line_and_col twice, partially because it decreases the function calling overhead, potentially because it doesn't populate the line cache with lines that turn out to belong to invalid spans, and likely because of some other incidental improvements made possible by having more context available.
2020-08-30mv compiler to compiler/mark-0/+287