incr.comp.: Turn translation item collection and CGU partitioning into a query. #44486
Labels
A-incr-comp
Area: Incremental compilation
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Right now translation item collection and CGU partitioning are run as part of
rustc_trans::base::trans_crate()
. For better integration with red/green tracking this functionality should be moved into a pair of queries:(set of all trans-items, set of all partitions)
. It can have a query key of()
as it only takes other queries as input.cgu_name: &str
and returns the singleCodegenUnit
with that name. It just reads from the result of the first query. It's purpose is to provide a "firewall" so codegen units can be re-used if they don't change.Doing this refactoring will involve moving
TransItem
andCodegenUnit
tolibrustc
, so they can be used in query results. One will also have to provide aHashStable
implementation for the results of the two queries. The implementation forCodegenUnit
should do something like CodegenUnit::compute_symbol_name_hash(). For translation items one could maybe just hash the symbol name.cc @nikomatsakis @alexcrichton
The text was updated successfully, but these errors were encountered: