Closed
Description
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:
- The first query does all of translation item collection and partitioning and returns
(set of all trans-items, set of all partitions)
. It can have a query key of()
as it only takes other queries as input. - The second query has query-key
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
and CodegenUnit
to librustc
, so they can be used in query results. One will also have to provide a HashStable
implementation for the results of the two queries. The implementation for CodegenUnit
should do something like CodegenUnit::compute_symbol_name_hash(). For translation items one could maybe just hash the symbol name.