Skip to content

Commit 4f8f35d

Browse files
committed
Port metadata reuse to cg_clif.
1 parent 0f1f693 commit 4f8f35d

File tree

1 file changed

+15
-0
lines changed
  • compiler/rustc_codegen_cranelift/src/driver

1 file changed

+15
-0
lines changed

compiler/rustc_codegen_cranelift/src/driver/aot.rs

+15
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ impl OngoingCodegen {
6565
backend_config: &BackendConfig,
6666
) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) {
6767
let mut work_products = FxIndexMap::default();
68+
69+
if !backend_config.disable_incr_cache {
70+
if let Some(path) = self.metadata.path() {
71+
if let Some((id, product)) =
72+
rustc_incremental::copy_cgu_workproduct_to_incr_comp_cache_dir(
73+
sess,
74+
"metadata",
75+
&[("rmeta", path)],
76+
)
77+
{
78+
work_products.insert(id, product);
79+
}
80+
}
81+
}
82+
6883
let mut modules = vec![];
6984

7085
for module_codegen in self.modules {

0 commit comments

Comments
 (0)