rust/compiler/rustc_interface/src
bors 4cbda829c0 Auto merge of #74967 - Aaron1011:feature/incr-def-path-table, r=pnkfelix
Implement lazy decoding of DefPathTable during incremental compilation

PR https://github.com/rust-lang/rust/pull/75813 implemented lazy decoding of the `DefPathTable` from crate metadata. However, it requires decoding the entire `DefPathTable` when incremental compilation is active, so that we can map a decoded `DefPathHash` to a `DefId` from an arbitrary crate.

This PR adds support for lazy decoding of dependency `DefPathTable`s when incremental compilation si active.

When we load the incremental cache and dep
graph, we need the ability to map a `DefPathHash` to a `DefId` in the
current compilation session (if the corresponding definition still
exists).

This is accomplished by storing the old `DefId` (that is, the `DefId`
from the previous compilation session) for each `DefPathHash` we need to
remap. Since a `DefPathHash` includes the owning crate, the old crate is
guaranteed to be the right one (if the definition still exists). We then
use the old `DefIndex` as an initial guess, which we validate by
comparing the expected and actual `DefPathHash`es. In most cases,
foreign crates will be completely unchanged, which means that we our
guess will be correct. If our guess is wrong, we fall back to decoding
the entire `DefPathTable` for the foreign crate. This still represents
an improvement over the status quo, since we can skip decoding the
entire `DefPathTable` for other crates (where all of our guesses were
correct).
2020-12-01 14:30:02 +00:00
..
callbacks.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
interface.rs Add method to get the register_lints function from the compiler 2020-11-24 10:37:14 +01:00
lib.rs Merge set_panic and set_print into set_output_capture. 2020-11-10 21:58:13 +01:00
passes.rs Auto merge of #74967 - Aaron1011:feature/incr-def-path-table, r=pnkfelix 2020-12-01 14:30:02 +00:00
proc_macro_decls.rs Store ForeignItem in a side table. 2020-11-26 21:29:27 +01:00
queries.rs Move Steal to rustc_data_structures. 2020-11-14 01:30:56 +01:00
tests.rs TRACK '-Z polonius' flag 2020-11-24 20:08:54 -08:00
util.rs Properly handle attributes on statements 2020-11-26 17:08:35 -05:00