diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2022-05-13 10:32:03 +0000 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2022-06-06 12:30:10 +0000 |
| commit | 02162c4163f5d1a0e3dc8b552aafaa92d652b279 (patch) | |
| tree | a0128bf5a074d9063575f7cea8c373065a0884be | |
| parent | 85136dbe56dbbd7cdbcb27886a03807ea265ecd1 (diff) | |
| download | rust-02162c4163f5d1a0e3dc8b552aafaa92d652b279.tar.gz rust-02162c4163f5d1a0e3dc8b552aafaa92d652b279.zip | |
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.
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/driver/aot.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/base.rs | 4 | ||||
| -rw-r--r-- | 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) |
