Rename CodegenUnit::work_product to previous_work_product
It returns the previous work product or panics if there is none. This rename makes the purpose of this method clearer.
This commit is contained in:
parent
85136dbe56
commit
02162c4163
3 changed files with 4 additions and 4 deletions
|
@ -85,7 +85,7 @@ fn reuse_workproduct_for_cgu(
|
||||||
work_products: &mut FxHashMap<WorkProductId, WorkProduct>,
|
work_products: &mut FxHashMap<WorkProductId, WorkProduct>,
|
||||||
) -> CompiledModule {
|
) -> CompiledModule {
|
||||||
let mut object = None;
|
let mut object = None;
|
||||||
let work_product = cgu.work_product(tcx);
|
let work_product = cgu.previous_work_product(tcx);
|
||||||
if let Some(saved_file) = &work_product.saved_file {
|
if let Some(saved_file) = &work_product.saved_file {
|
||||||
let obj_out =
|
let obj_out =
|
||||||
tcx.output_filenames(()).temp_path(OutputType::Object, Some(cgu.name().as_str()));
|
tcx.output_filenames(()).temp_path(OutputType::Object, Some(cgu.name().as_str()));
|
||||||
|
|
|
@ -716,7 +716,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
|
||||||
&ongoing_codegen.coordinator_send,
|
&ongoing_codegen.coordinator_send,
|
||||||
CachedModuleCodegen {
|
CachedModuleCodegen {
|
||||||
name: cgu.name().to_string(),
|
name: cgu.name().to_string(),
|
||||||
source: cgu.work_product(tcx),
|
source: cgu.previous_work_product(tcx),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
true
|
true
|
||||||
|
@ -727,7 +727,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
|
||||||
&ongoing_codegen.coordinator_send,
|
&ongoing_codegen.coordinator_send,
|
||||||
CachedModuleCodegen {
|
CachedModuleCodegen {
|
||||||
name: cgu.name().to_string(),
|
name: cgu.name().to_string(),
|
||||||
source: cgu.work_product(tcx),
|
source: cgu.previous_work_product(tcx),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
true
|
true
|
||||||
|
|
|
@ -336,7 +336,7 @@ impl<'tcx> CodegenUnit<'tcx> {
|
||||||
WorkProductId::from_cgu_name(self.name().as_str())
|
WorkProductId::from_cgu_name(self.name().as_str())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn work_product(&self, tcx: TyCtxt<'_>) -> WorkProduct {
|
pub fn previous_work_product(&self, tcx: TyCtxt<'_>) -> WorkProduct {
|
||||||
let work_product_id = self.work_product_id();
|
let work_product_id = self.work_product_id();
|
||||||
tcx.dep_graph
|
tcx.dep_graph
|
||||||
.previous_work_product(&work_product_id)
|
.previous_work_product(&work_product_id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue