@@ -20,11 +20,11 @@ use cranelift_object::{ObjectBuilder, ObjectModule};
20
20
use crate :: global_asm:: GlobalAsmConfig ;
21
21
use crate :: { prelude:: * , BackendConfig } ;
22
22
23
- struct ModuleCodegenResult (
24
- CompiledModule ,
25
- Option < CompiledModule > ,
26
- Option < ( WorkProductId , WorkProduct ) > ,
27
- ) ;
23
+ struct ModuleCodegenResult {
24
+ module_regular : CompiledModule ,
25
+ module_global_asm : Option < CompiledModule > ,
26
+ work_product : Option < ( WorkProductId , WorkProduct ) > ,
27
+ }
28
28
29
29
impl < HCX > HashStable < HCX > for ModuleCodegenResult {
30
30
fn hash_stable ( & self , _: & mut HCX , _: & mut StableHasher ) {
@@ -47,7 +47,7 @@ impl OngoingCodegen {
47
47
let mut modules = vec ! [ ] ;
48
48
49
49
for module_codegen_result in self . modules {
50
- let ModuleCodegenResult ( module_regular, module_global_asm, work_product) =
50
+ let ModuleCodegenResult { module_regular, module_global_asm, work_product } =
51
51
module_codegen_result;
52
52
if let Some ( ( work_product_id, work_product) ) = work_product {
53
53
work_products. insert ( work_product_id, work_product) ;
@@ -124,23 +124,23 @@ fn emit_module(
124
124
)
125
125
} ;
126
126
127
- ModuleCodegenResult (
128
- CompiledModule {
127
+ ModuleCodegenResult {
128
+ module_regular : CompiledModule {
129
129
name : name. clone ( ) ,
130
130
kind,
131
131
object : Some ( tmp_file) ,
132
132
dwarf_object : None ,
133
133
bytecode : None ,
134
134
} ,
135
- global_asm_object_file. map ( |global_asm_object_file| CompiledModule {
135
+ module_global_asm : global_asm_object_file. map ( |global_asm_object_file| CompiledModule {
136
136
name : format ! ( "{name}.asm" ) ,
137
137
kind,
138
138
object : Some ( global_asm_object_file) ,
139
139
dwarf_object : None ,
140
140
bytecode : None ,
141
141
} ) ,
142
142
work_product,
143
- )
143
+ }
144
144
}
145
145
146
146
fn reuse_workproduct_for_cgu ( tcx : TyCtxt < ' _ > , cgu : & CodegenUnit < ' _ > ) -> ModuleCodegenResult {
@@ -178,15 +178,15 @@ fn reuse_workproduct_for_cgu(tcx: TyCtxt<'_>, cgu: &CodegenUnit<'_>) -> ModuleCo
178
178
false
179
179
} ;
180
180
181
- ModuleCodegenResult (
182
- CompiledModule {
181
+ ModuleCodegenResult {
182
+ module_regular : CompiledModule {
183
183
name : cgu. name ( ) . to_string ( ) ,
184
184
kind : ModuleKind :: Regular ,
185
185
object : Some ( obj_out_regular) ,
186
186
dwarf_object : None ,
187
187
bytecode : None ,
188
188
} ,
189
- if has_global_asm {
189
+ module_global_asm : if has_global_asm {
190
190
Some ( CompiledModule {
191
191
name : cgu. name ( ) . to_string ( ) ,
192
192
kind : ModuleKind :: Regular ,
@@ -197,8 +197,8 @@ fn reuse_workproduct_for_cgu(tcx: TyCtxt<'_>, cgu: &CodegenUnit<'_>) -> ModuleCo
197
197
} else {
198
198
None
199
199
} ,
200
- Some ( ( cgu. work_product_id ( ) , work_product) ) ,
201
- )
200
+ work_product : Some ( ( cgu. work_product_id ( ) , work_product) ) ,
201
+ }
202
202
}
203
203
204
204
fn module_codegen (
@@ -341,7 +341,7 @@ pub(crate) fn run_aot(
341
341
crate :: allocator:: codegen ( tcx, & mut allocator_module, & mut allocator_unwind_context) ;
342
342
343
343
let allocator_module = if created_alloc_shim {
344
- let ModuleCodegenResult ( module , module_global_asm, work_product) = emit_module (
344
+ let ModuleCodegenResult { module_regular , module_global_asm, work_product } = emit_module (
345
345
tcx,
346
346
& backend_config,
347
347
"allocator_shim" . to_string ( ) ,
@@ -355,7 +355,7 @@ pub(crate) fn run_aot(
355
355
if let Some ( ( id, product) ) = work_product {
356
356
work_products. insert ( id, product) ;
357
357
}
358
- Some ( module )
358
+ Some ( module_regular )
359
359
} else {
360
360
None
361
361
} ;
0 commit comments