@@ -464,22 +464,23 @@ fn reuse_workproduct_for_cgu(
464
464
err
465
465
) ) ;
466
466
}
467
+
467
468
let obj_out_global_asm =
468
469
crate :: global_asm:: add_file_stem_postfix ( obj_out_regular. clone ( ) , ".asm" ) ;
469
- 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" ) {
470
471
let source_file_global_asm = rustc_incremental:: in_incr_comp_dir_sess ( & tcx. sess , asm_o) ;
471
472
if let Err ( err) = rustc_fs_util:: link_or_copy ( & source_file_global_asm, & obj_out_global_asm)
472
473
{
473
474
return Err ( format ! (
474
475
"unable to copy {} to {}: {}" ,
475
- source_file_regular . display( ) ,
476
- obj_out_regular . display( ) ,
476
+ source_file_global_asm . display( ) ,
477
+ obj_out_global_asm . display( ) ,
477
478
err
478
479
) ) ;
479
480
}
480
- true
481
+ Some ( source_file_global_asm )
481
482
} else {
482
- false
483
+ None
483
484
} ;
484
485
485
486
Ok ( ModuleCodegenResult {
@@ -491,17 +492,17 @@ fn reuse_workproduct_for_cgu(
491
492
bytecode : None ,
492
493
assembly : None ,
493
494
llvm_ir : None ,
494
- links_from_incr_cache : Vec :: new ( ) ,
495
+ links_from_incr_cache : vec ! [ source_file_regular ] ,
495
496
} ,
496
- module_global_asm : has_global_asm . then ( | | CompiledModule {
497
+ module_global_asm : source_file_global_asm . map ( |source_file | CompiledModule {
497
498
name : cgu. name ( ) . to_string ( ) ,
498
499
kind : ModuleKind :: Regular ,
499
500
object : Some ( obj_out_global_asm) ,
500
501
dwarf_object : None ,
501
502
bytecode : None ,
502
503
assembly : None ,
503
504
llvm_ir : None ,
504
- links_from_incr_cache : Vec :: new ( ) ,
505
+ links_from_incr_cache : vec ! [ source_file ] ,
505
506
} ) ,
506
507
existing_work_product : Some ( ( cgu. work_product_id ( ) , work_product) ) ,
507
508
} )
@@ -752,6 +753,7 @@ pub(crate) fn run_aot(
752
753
753
754
let metadata_module =
754
755
if need_metadata_module { Some ( emit_metadata_module ( tcx, & metadata) ) } else { None } ;
756
+
755
757
Box :: new ( OngoingCodegen {
756
758
modules,
757
759
allocator_module,
0 commit comments