Skip to content

Commit db7d8a8

Browse files
committed
Give fields of ModuleCodegenResult names
1 parent f76ca22 commit db7d8a8

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/driver/aot.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ use cranelift_object::{ObjectBuilder, ObjectModule};
2020
use crate::global_asm::GlobalAsmConfig;
2121
use crate::{prelude::*, BackendConfig};
2222

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+
}
2828

2929
impl<HCX> HashStable<HCX> for ModuleCodegenResult {
3030
fn hash_stable(&self, _: &mut HCX, _: &mut StableHasher) {
@@ -47,7 +47,7 @@ impl OngoingCodegen {
4747
let mut modules = vec![];
4848

4949
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 } =
5151
module_codegen_result;
5252
if let Some((work_product_id, work_product)) = work_product {
5353
work_products.insert(work_product_id, work_product);
@@ -124,23 +124,23 @@ fn emit_module(
124124
)
125125
};
126126

127-
ModuleCodegenResult(
128-
CompiledModule {
127+
ModuleCodegenResult {
128+
module_regular: CompiledModule {
129129
name: name.clone(),
130130
kind,
131131
object: Some(tmp_file),
132132
dwarf_object: None,
133133
bytecode: None,
134134
},
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 {
136136
name: format!("{name}.asm"),
137137
kind,
138138
object: Some(global_asm_object_file),
139139
dwarf_object: None,
140140
bytecode: None,
141141
}),
142142
work_product,
143-
)
143+
}
144144
}
145145

146146
fn reuse_workproduct_for_cgu(tcx: TyCtxt<'_>, cgu: &CodegenUnit<'_>) -> ModuleCodegenResult {
@@ -178,15 +178,15 @@ fn reuse_workproduct_for_cgu(tcx: TyCtxt<'_>, cgu: &CodegenUnit<'_>) -> ModuleCo
178178
false
179179
};
180180

181-
ModuleCodegenResult(
182-
CompiledModule {
181+
ModuleCodegenResult {
182+
module_regular: CompiledModule {
183183
name: cgu.name().to_string(),
184184
kind: ModuleKind::Regular,
185185
object: Some(obj_out_regular),
186186
dwarf_object: None,
187187
bytecode: None,
188188
},
189-
if has_global_asm {
189+
module_global_asm: if has_global_asm {
190190
Some(CompiledModule {
191191
name: cgu.name().to_string(),
192192
kind: ModuleKind::Regular,
@@ -197,8 +197,8 @@ fn reuse_workproduct_for_cgu(tcx: TyCtxt<'_>, cgu: &CodegenUnit<'_>) -> ModuleCo
197197
} else {
198198
None
199199
},
200-
Some((cgu.work_product_id(), work_product)),
201-
)
200+
work_product: Some((cgu.work_product_id(), work_product)),
201+
}
202202
}
203203

204204
fn module_codegen(
@@ -341,7 +341,7 @@ pub(crate) fn run_aot(
341341
crate::allocator::codegen(tcx, &mut allocator_module, &mut allocator_unwind_context);
342342

343343
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(
345345
tcx,
346346
&backend_config,
347347
"allocator_shim".to_string(),
@@ -355,7 +355,7 @@ pub(crate) fn run_aot(
355355
if let Some((id, product)) = work_product {
356356
work_products.insert(id, product);
357357
}
358-
Some(module)
358+
Some(module_regular)
359359
} else {
360360
None
361361
};

0 commit comments

Comments
 (0)