diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2020-03-31 10:41:59 +1100 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2020-05-01 08:14:39 -0700 |
| commit | d4e5e1bcffe7feb150d061985eb03c6e09ebb9f7 (patch) | |
| tree | 5a98126d77776fe5d040e1c0ddec26ec04f17681 /src/librustc_codegen_ssa/back/write.rs | |
| parent | fd61d06772d17c6242265d860fbfb5eafd282caa (diff) | |
| download | rust-d4e5e1bcffe7feb150d061985eb03c6e09ebb9f7.tar.gz rust-d4e5e1bcffe7feb150d061985eb03c6e09ebb9f7.zip | |
Don't copy bytecode files into the incr. comp. cache.
It's no longer necessary now that bitcode is embedded into object files. This change meant that `WorkProductFileKind::Bytecode` is no longer necessary, which means that type is no longer necessary, which allowed several places in the code to become simpler.
Diffstat (limited to 'src/librustc_codegen_ssa/back/write.rs')
| -rw-r--r-- | src/librustc_codegen_ssa/back/write.rs | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/src/librustc_codegen_ssa/back/write.rs b/src/librustc_codegen_ssa/back/write.rs index 094c57b2401..22752cf4089 100644 --- a/src/librustc_codegen_ssa/back/write.rs +++ b/src/librustc_codegen_ssa/back/write.rs @@ -23,7 +23,7 @@ use rustc_hir::def_id::{CrateNum, LOCAL_CRATE}; use rustc_incremental::{ copy_cgu_workproducts_to_incr_comp_cache_dir, in_incr_comp_dir, in_incr_comp_dir_sess, }; -use rustc_middle::dep_graph::{WorkProduct, WorkProductFileKind, WorkProductId}; +use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; use rustc_middle::middle::cstore::EncodedMetadata; use rustc_middle::middle::exported_symbols::SymbolExportLevel; use rustc_middle::ty::TyCtxt; @@ -478,10 +478,7 @@ fn copy_all_cgu_workproducts_to_incr_comp_cache_dir( let mut files = vec![]; if let Some(ref path) = module.object { - files.push((WorkProductFileKind::Object, path.clone())); - } - if let Some(ref path) = module.bytecode { - files.push((WorkProductFileKind::Bytecode, path.clone())); + files.push(path.clone()); } if let Some((id, product)) = @@ -818,20 +815,9 @@ fn execute_copy_from_cache_work_item<B: ExtraBackendMethods>( ) -> Result<WorkItemResult<B>, FatalError> { let incr_comp_session_dir = cgcx.incr_comp_session_dir.as_ref().unwrap(); let mut object = None; - let mut bytecode = None; - for (kind, saved_file) in &module.source.saved_files { - let obj_out = match kind { - WorkProductFileKind::Object => { - let path = cgcx.output_filenames.temp_path(OutputType::Object, Some(&module.name)); - object = Some(path.clone()); - path - } - WorkProductFileKind::Bytecode => { - let path = cgcx.output_filenames.temp_path(OutputType::Bitcode, Some(&module.name)); - bytecode = Some(path.clone()); - path - } - }; + for saved_file in &module.source.saved_files { + let obj_out = cgcx.output_filenames.temp_path(OutputType::Object, Some(&module.name)); + object = Some(obj_out.clone()); let source_file = in_incr_comp_dir(&incr_comp_session_dir, &saved_file); debug!( "copying pre-existing module `{}` from {:?} to {}", @@ -851,13 +837,12 @@ fn execute_copy_from_cache_work_item<B: ExtraBackendMethods>( } assert_eq!(object.is_some(), module_config.emit_obj != EmitObj::None); - assert_eq!(bytecode.is_some(), module_config.emit_bc); Ok(WorkItemResult::Compiled(CompiledModule { name: module.name, kind: ModuleKind::Regular, object, - bytecode, + bytecode: None, })) } |
