Skip to content

Commit 086dba2

Browse files
committed
Sync from rust b48576b
2 parents 91ae865 + 1986ad7 commit 086dba2

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/driver/aot.rs

+14-6
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,14 @@ impl OngoingCodegen {
103103
("o", &module_regular.object.as_ref().unwrap()),
104104
("asm.o", &module_global_asm.object.as_ref().unwrap()),
105105
],
106+
&[],
106107
)
107108
} else {
108109
rustc_incremental::copy_cgu_workproduct_to_incr_comp_cache_dir(
109110
sess,
110111
&module_regular.name,
111112
&[("o", &module_regular.object.as_ref().unwrap())],
113+
&[],
112114
)
113115
};
114116
if let Some((work_product_id, work_product)) = work_product {
@@ -381,6 +383,7 @@ fn emit_cgu(
381383
bytecode: None,
382384
assembly: None,
383385
llvm_ir: None,
386+
links_from_incr_cache: Vec::new(),
384387
}),
385388
existing_work_product: None,
386389
})
@@ -437,6 +440,7 @@ fn emit_module(
437440
bytecode: None,
438441
assembly: None,
439442
llvm_ir: None,
443+
links_from_incr_cache: Vec::new(),
440444
})
441445
}
442446

@@ -460,22 +464,23 @@ fn reuse_workproduct_for_cgu(
460464
err
461465
));
462466
}
467+
463468
let obj_out_global_asm =
464469
crate::global_asm::add_file_stem_postfix(obj_out_regular.clone(), ".asm");
465-
let has_global_asm = if let Some(asm_o) = work_product.saved_files.get("asm.o") {
470+
let source_file_global_asm = if let Some(asm_o) = work_product.saved_files.get("asm.o") {
466471
let source_file_global_asm = rustc_incremental::in_incr_comp_dir_sess(&tcx.sess, asm_o);
467472
if let Err(err) = rustc_fs_util::link_or_copy(&source_file_global_asm, &obj_out_global_asm)
468473
{
469474
return Err(format!(
470475
"unable to copy {} to {}: {}",
471-
source_file_regular.display(),
472-
obj_out_regular.display(),
476+
source_file_global_asm.display(),
477+
obj_out_global_asm.display(),
473478
err
474479
));
475480
}
476-
true
481+
Some(source_file_global_asm)
477482
} else {
478-
false
483+
None
479484
};
480485

481486
Ok(ModuleCodegenResult {
@@ -487,15 +492,17 @@ fn reuse_workproduct_for_cgu(
487492
bytecode: None,
488493
assembly: None,
489494
llvm_ir: None,
495+
links_from_incr_cache: vec![source_file_regular],
490496
},
491-
module_global_asm: has_global_asm.then(|| CompiledModule {
497+
module_global_asm: source_file_global_asm.map(|source_file| CompiledModule {
492498
name: cgu.name().to_string(),
493499
kind: ModuleKind::Regular,
494500
object: Some(obj_out_global_asm),
495501
dwarf_object: None,
496502
bytecode: None,
497503
assembly: None,
498504
llvm_ir: None,
505+
links_from_incr_cache: vec![source_file],
499506
}),
500507
existing_work_product: Some((cgu.work_product_id(), work_product)),
501508
})
@@ -637,6 +644,7 @@ fn emit_metadata_module(tcx: TyCtxt<'_>, metadata: &EncodedMetadata) -> Compiled
637644
bytecode: None,
638645
assembly: None,
639646
llvm_ir: None,
647+
links_from_incr_cache: Vec::new(),
640648
}
641649
}
642650

0 commit comments

Comments
 (0)