@@ -103,12 +103,14 @@ impl OngoingCodegen {
103
103
( "o" , & module_regular. object . as_ref ( ) . unwrap ( ) ) ,
104
104
( "asm.o" , & module_global_asm. object . as_ref ( ) . unwrap ( ) ) ,
105
105
] ,
106
+ & [ ] ,
106
107
)
107
108
} else {
108
109
rustc_incremental:: copy_cgu_workproduct_to_incr_comp_cache_dir (
109
110
sess,
110
111
& module_regular. name ,
111
112
& [ ( "o" , & module_regular. object . as_ref ( ) . unwrap ( ) ) ] ,
113
+ & [ ] ,
112
114
)
113
115
} ;
114
116
if let Some ( ( work_product_id, work_product) ) = work_product {
@@ -381,6 +383,7 @@ fn emit_cgu(
381
383
bytecode : None ,
382
384
assembly : None ,
383
385
llvm_ir : None ,
386
+ links_from_incr_cache : Vec :: new ( ) ,
384
387
} ) ,
385
388
existing_work_product : None ,
386
389
} )
@@ -437,6 +440,7 @@ fn emit_module(
437
440
bytecode : None ,
438
441
assembly : None ,
439
442
llvm_ir : None ,
443
+ links_from_incr_cache : Vec :: new ( ) ,
440
444
} )
441
445
}
442
446
@@ -460,22 +464,23 @@ fn reuse_workproduct_for_cgu(
460
464
err
461
465
) ) ;
462
466
}
467
+
463
468
let obj_out_global_asm =
464
469
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" ) {
466
471
let source_file_global_asm = rustc_incremental:: in_incr_comp_dir_sess ( & tcx. sess , asm_o) ;
467
472
if let Err ( err) = rustc_fs_util:: link_or_copy ( & source_file_global_asm, & obj_out_global_asm)
468
473
{
469
474
return Err ( format ! (
470
475
"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( ) ,
473
478
err
474
479
) ) ;
475
480
}
476
- true
481
+ Some ( source_file_global_asm )
477
482
} else {
478
- false
483
+ None
479
484
} ;
480
485
481
486
Ok ( ModuleCodegenResult {
@@ -487,15 +492,17 @@ fn reuse_workproduct_for_cgu(
487
492
bytecode : None ,
488
493
assembly : None ,
489
494
llvm_ir : None ,
495
+ links_from_incr_cache : vec ! [ source_file_regular] ,
490
496
} ,
491
- module_global_asm : has_global_asm . then ( | | CompiledModule {
497
+ module_global_asm : source_file_global_asm . map ( |source_file | CompiledModule {
492
498
name : cgu. name ( ) . to_string ( ) ,
493
499
kind : ModuleKind :: Regular ,
494
500
object : Some ( obj_out_global_asm) ,
495
501
dwarf_object : None ,
496
502
bytecode : None ,
497
503
assembly : None ,
498
504
llvm_ir : None ,
505
+ links_from_incr_cache : vec ! [ source_file] ,
499
506
} ) ,
500
507
existing_work_product : Some ( ( cgu. work_product_id ( ) , work_product) ) ,
501
508
} )
@@ -637,6 +644,7 @@ fn emit_metadata_module(tcx: TyCtxt<'_>, metadata: &EncodedMetadata) -> Compiled
637
644
bytecode : None ,
638
645
assembly : None ,
639
646
llvm_ir : None ,
647
+ links_from_incr_cache : Vec :: new ( ) ,
640
648
}
641
649
}
642
650
0 commit comments