Skip to content

Commit b972010

Browse files
committed
Fix CG_CLIF_DISABLE_INCR_CACHE
1 parent bdc597d commit b972010

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

src/driver/aot.rs

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -394,28 +394,32 @@ pub(crate) fn run_aot(
394394
let modules = tcx.sess.time("codegen mono items", || {
395395
cgus.iter()
396396
.enumerate()
397-
.map(|(i, cgu)| match cgu_reuse[i] {
398-
CguReuse::No => {
399-
let dep_node = cgu.codegen_dep_node(tcx);
400-
tcx.dep_graph
401-
.with_task(
402-
dep_node,
403-
tcx,
404-
(
405-
backend_config.clone(),
406-
global_asm_config.clone(),
407-
cgu.name(),
408-
concurrency_limiter.acquire(tcx.sess.diagnostic()),
409-
),
410-
module_codegen,
411-
Some(rustc_middle::dep_graph::hash_result),
412-
)
413-
.0
414-
}
415-
CguReuse::PreLto => unreachable!("LTO not yet supported"),
416-
CguReuse::PostLto => {
417-
concurrency_limiter.job_already_done();
418-
OngoingModuleCodegen::Sync(reuse_workproduct_for_cgu(tcx, cgu))
397+
.map(|(i, cgu)| {
398+
let cgu_reuse =
399+
if backend_config.disable_incr_cache { CguReuse::No } else { cgu_reuse[i] };
400+
match cgu_reuse {
401+
CguReuse::No => {
402+
let dep_node = cgu.codegen_dep_node(tcx);
403+
tcx.dep_graph
404+
.with_task(
405+
dep_node,
406+
tcx,
407+
(
408+
backend_config.clone(),
409+
global_asm_config.clone(),
410+
cgu.name(),
411+
concurrency_limiter.acquire(tcx.sess.diagnostic()),
412+
),
413+
module_codegen,
414+
Some(rustc_middle::dep_graph::hash_result),
415+
)
416+
.0
417+
}
418+
CguReuse::PreLto => unreachable!("LTO not yet supported"),
419+
CguReuse::PostLto => {
420+
concurrency_limiter.job_already_done();
421+
OngoingModuleCodegen::Sync(reuse_workproduct_for_cgu(tcx, cgu))
422+
}
419423
}
420424
})
421425
.collect::<Vec<_>>()

0 commit comments

Comments
 (0)