@@ -12,7 +12,9 @@ use cranelift_object::{ObjectBuilder, ObjectModule};
12
12
use rustc_codegen_ssa:: assert_module_sources:: CguReuse ;
13
13
use rustc_codegen_ssa:: back:: link:: ensure_removed;
14
14
use rustc_codegen_ssa:: base:: determine_cgu_reuse;
15
- use rustc_codegen_ssa:: { CodegenResults , CompiledModule , CrateInfo , errors as ssa_errors} ;
15
+ use rustc_codegen_ssa:: {
16
+ CodegenResults , CompiledModule , CrateInfo , ModuleKind , errors as ssa_errors,
17
+ } ;
16
18
use rustc_data_structures:: profiling:: SelfProfilerRef ;
17
19
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
18
20
use rustc_data_structures:: sync:: { IntoDynSyncSend , par_map} ;
@@ -361,6 +363,7 @@ fn emit_cgu(
361
363
invocation_temp,
362
364
prof,
363
365
product. object ,
366
+ ModuleKind :: Regular ,
364
367
name. clone ( ) ,
365
368
producer,
366
369
) ?;
@@ -369,6 +372,7 @@ fn emit_cgu(
369
372
module_regular,
370
373
module_global_asm : global_asm_object_file. map ( |global_asm_object_file| CompiledModule {
371
374
name : format ! ( "{name}.asm" ) ,
375
+ kind : ModuleKind :: Regular ,
372
376
object : Some ( global_asm_object_file) ,
373
377
dwarf_object : None ,
374
378
bytecode : None ,
@@ -385,6 +389,7 @@ fn emit_module(
385
389
invocation_temp : Option < & str > ,
386
390
prof : & SelfProfilerRef ,
387
391
mut object : cranelift_object:: object:: write:: Object < ' _ > ,
392
+ kind : ModuleKind ,
388
393
name : String ,
389
394
producer_str : & str ,
390
395
) -> Result < CompiledModule , String > {
@@ -425,6 +430,7 @@ fn emit_module(
425
430
426
431
Ok ( CompiledModule {
427
432
name,
433
+ kind,
428
434
object : Some ( tmp_file) ,
429
435
dwarf_object : None ,
430
436
bytecode : None ,
@@ -479,6 +485,7 @@ fn reuse_workproduct_for_cgu(
479
485
Ok ( ModuleCodegenResult {
480
486
module_regular : CompiledModule {
481
487
name : cgu. name ( ) . to_string ( ) ,
488
+ kind : ModuleKind :: Regular ,
482
489
object : Some ( obj_out_regular) ,
483
490
dwarf_object : None ,
484
491
bytecode : None ,
@@ -488,6 +495,7 @@ fn reuse_workproduct_for_cgu(
488
495
} ,
489
496
module_global_asm : source_file_global_asm. map ( |source_file| CompiledModule {
490
497
name : cgu. name ( ) . to_string ( ) ,
498
+ kind : ModuleKind :: Regular ,
491
499
object : Some ( obj_out_global_asm) ,
492
500
dwarf_object : None ,
493
501
bytecode : None ,
@@ -643,6 +651,7 @@ fn emit_allocator_module(tcx: TyCtxt<'_>) -> Option<CompiledModule> {
643
651
tcx. sess . invocation_temp . as_deref ( ) ,
644
652
& tcx. sess . prof ,
645
653
product. object ,
654
+ ModuleKind :: Allocator ,
646
655
"allocator_shim" . to_owned ( ) ,
647
656
& crate :: debuginfo:: producer ( tcx. sess ) ,
648
657
) {
0 commit comments