From 02162c4163f5d1a0e3dc8b552aafaa92d652b279 Mon Sep 17 00:00:00 2001 From: bjorn3 <bjorn3@users.noreply.github.com> Date: Fri, 13 May 2022 10:32:03 +0000 Subject: [PATCH] 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. --- compiler/rustc_codegen_cranelift/src/driver/aot.rs | 2 +- compiler/rustc_codegen_ssa/src/base.rs | 4 ++-- compiler/rustc_middle/src/mir/mono.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_codegen_cranelift/src/driver/aot.rs b/compiler/rustc_codegen_cranelift/src/driver/aot.rs index 5e1e1c81d26..0faf1221c83 100644 --- a/compiler/rustc_codegen_cranelift/src/driver/aot.rs +++ b/compiler/rustc_codegen_cranelift/src/driver/aot.rs @@ -85,7 +85,7 @@ fn reuse_workproduct_for_cgu( work_products: &mut FxHashMap<WorkProductId, WorkProduct>, ) -> CompiledModule { 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 { let obj_out = tcx.output_filenames(()).temp_path(OutputType::Object, Some(cgu.name().as_str())); diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs index 420adec456f..c52a908e90f 100644 --- a/compiler/rustc_codegen_ssa/src/base.rs +++ b/compiler/rustc_codegen_ssa/src/base.rs @@ -716,7 +716,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>( &ongoing_codegen.coordinator_send, CachedModuleCodegen { name: cgu.name().to_string(), - source: cgu.work_product(tcx), + source: cgu.previous_work_product(tcx), }, ); true @@ -727,7 +727,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>( &ongoing_codegen.coordinator_send, CachedModuleCodegen { name: cgu.name().to_string(), - source: cgu.work_product(tcx), + source: cgu.previous_work_product(tcx), }, ); true diff --git a/compiler/rustc_middle/src/mir/mono.rs b/compiler/rustc_middle/src/mir/mono.rs index d389fa8c0eb..021f2782736 100644 --- a/compiler/rustc_middle/src/mir/mono.rs +++ b/compiler/rustc_middle/src/mir/mono.rs @@ -336,7 +336,7 @@ impl<'tcx> CodegenUnit<'tcx> { 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(); tcx.dep_graph .previous_work_product(&work_product_id)