diff options
| author | Isaac Whitfield <iw@whitfin.io> | 2018-05-09 08:16:08 -0700 |
|---|---|---|
| committer | Isaac Whitfield <iw@whitfin.io> | 2018-05-11 08:09:53 -0700 |
| commit | 0a4fbe326a4a05ff01d07d362cc554bd8414ce89 (patch) | |
| tree | e666daaec5f7ad0a19a7cfaa7de19662da1354ab | |
| parent | 5c83422a5bdf8eacd4bbc727fb880b99ed66b04f (diff) | |
| download | rust-0a4fbe326a4a05ff01d07d362cc554bd8414ce89.tar.gz rust-0a4fbe326a4a05ff01d07d362cc554bd8414ce89.zip | |
Update naming in line with PR comments
| -rw-r--r-- | src/librustc_incremental/lib.rs | 4 | ||||
| -rw-r--r-- | src/librustc_incremental/persist/mod.rs | 4 | ||||
| -rw-r--r-- | src/librustc_incremental/persist/save.rs | 14 | ||||
| -rw-r--r-- | src/librustc_incremental/persist/work_product.rs | 9 | ||||
| -rw-r--r-- | src/librustc_trans/back/write.rs | 10 | ||||
| -rw-r--r-- | src/librustc_trans/lib.rs | 2 |
6 files changed, 23 insertions, 20 deletions
diff --git a/src/librustc_incremental/lib.rs b/src/librustc_incremental/lib.rs index af33e878032..ababce69e31 100644 --- a/src/librustc_incremental/lib.rs +++ b/src/librustc_incremental/lib.rs @@ -36,9 +36,9 @@ pub use persist::dep_graph_tcx_init; pub use persist::load_dep_graph; pub use persist::load_query_result_cache; pub use persist::LoadResult; -pub use persist::create_trans_partition; +pub use persist::copy_cgu_workproducts_to_incr_comp_cache_dir; pub use persist::save_dep_graph; -pub use persist::save_work_products; +pub use persist::save_work_product_index; pub use persist::in_incr_comp_dir; pub use persist::prepare_session_directory; pub use persist::finalize_session_directory; diff --git a/src/librustc_incremental/persist/mod.rs b/src/librustc_incremental/persist/mod.rs index 3c23b7c6417..e1f00db56d5 100644 --- a/src/librustc_incremental/persist/mod.rs +++ b/src/librustc_incremental/persist/mod.rs @@ -29,6 +29,6 @@ pub use self::load::load_dep_graph; pub use self::load::load_query_result_cache; pub use self::load::LoadResult; pub use self::save::save_dep_graph; -pub use self::save::save_work_products; -pub use self::work_product::create_trans_partition; +pub use self::save::save_work_product_index; +pub use self::work_product::copy_cgu_workproducts_to_incr_comp_cache_dir; pub use self::work_product::delete_workproduct_files; diff --git a/src/librustc_incremental/persist/save.rs b/src/librustc_incremental/persist/save.rs index 497d24fae5b..be725b17933 100644 --- a/src/librustc_incremental/persist/save.rs +++ b/src/librustc_incremental/persist/save.rs @@ -55,17 +55,17 @@ pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { }) } -pub fn save_work_products(sess: &Session, - dep_graph: &DepGraph, - new_work_products: FxHashMap<WorkProductId, WorkProduct>) { +pub fn save_work_product_index(sess: &Session, + dep_graph: &DepGraph, + new_work_products: FxHashMap<WorkProductId, WorkProduct>) { if sess.opts.incremental.is_none() { return; } - debug!("save_work_products()"); + debug!("save_work_product_index()"); dep_graph.assert_ignored(); let path = work_products_path(sess); - save_in(sess, path, |e| encode_work_products(&new_work_products, e)); + save_in(sess, path, |e| encode_work_product_index(&new_work_products, e)); // We also need to clean out old work-products, as not all of them are // deleted during invalidation. Some object files don't change their @@ -234,8 +234,8 @@ fn encode_dep_graph(tcx: TyCtxt, Ok(()) } -fn encode_work_products(work_products: &FxHashMap<WorkProductId, WorkProduct>, - encoder: &mut Encoder) -> io::Result<()> { +fn encode_work_product_index(work_products: &FxHashMap<WorkProductId, WorkProduct>, + encoder: &mut Encoder) -> io::Result<()> { let serialized_products: Vec<_> = work_products .iter() .map(|(id, work_product)| { diff --git a/src/librustc_incremental/persist/work_product.rs b/src/librustc_incremental/persist/work_product.rs index 23e3664cdba..d163ad1f3f3 100644 --- a/src/librustc_incremental/persist/work_product.rs +++ b/src/librustc_incremental/persist/work_product.rs @@ -17,10 +17,11 @@ use rustc::util::fs::link_or_copy; use std::path::PathBuf; use std::fs as std_fs; -pub fn create_trans_partition(sess: &Session, - cgu_name: &str, - files: &[(WorkProductFileKind, PathBuf)]) - -> Option<(WorkProductId, WorkProduct)> { +pub fn copy_cgu_workproducts_to_incr_comp_cache_dir( + sess: &Session, + cgu_name: &str, + files: &[(WorkProductFileKind, PathBuf)] +) -> Option<(WorkProductId, WorkProduct)> { debug!("create_trans_partition({:?},{:?})", cgu_name, files); diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs index afa9bca2ba9..888173d4fc5 100644 --- a/src/librustc_trans/back/write.rs +++ b/src/librustc_trans/back/write.rs @@ -17,7 +17,7 @@ use back::linker::LinkerInfo; use back::symbol_export::ExportedSymbols; use base; use consts; -use rustc_incremental::{create_trans_partition, in_incr_comp_dir}; +use rustc_incremental::{copy_cgu_workproducts_to_incr_comp_cache_dir, in_incr_comp_dir}; use rustc::dep_graph::{WorkProduct, WorkProductId, WorkProductFileKind}; use rustc::middle::cstore::{LinkMeta, EncodedMetadata}; use rustc::session::config::{self, OutputFilenames, OutputType, Passes, SomePasses, @@ -1021,7 +1021,7 @@ pub fn start_async_translation(tcx: TyCtxt, } } -fn generate_module_artifacts( +fn copy_all_cgu_workproducts_to_incr_comp_cache_dir( sess: &Session, compiled_modules: &CompiledModules ) -> FxHashMap<WorkProductId, WorkProduct> { @@ -1044,7 +1044,8 @@ fn generate_module_artifacts( files.push((WorkProductFileKind::BytecodeCompressed, path.clone())); } - if let Some((id, product)) = create_trans_partition(sess, &module.name, &files) { + if let Some((id, product)) = + copy_cgu_workproducts_to_incr_comp_cache_dir(sess, &module.name, &files) { work_products.insert(id, product); } } @@ -2265,7 +2266,8 @@ impl OngoingCrateTranslation { time_graph.dump(&format!("{}-timings", self.crate_name)); } - let work_products = generate_module_artifacts(sess, &compiled_modules); + let work_products = copy_all_cgu_workproducts_to_incr_comp_cache_dir(sess, + &compiled_modules); produce_final_output_artifacts(sess, &compiled_modules, diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index bc8747ca4f5..30780b8c965 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -221,7 +221,7 @@ impl TransCrate for LlvmTransCrate { time(sess, "serialize work products", - move || rustc_incremental::save_work_products(sess, &dep_graph, work_products)); + move || rustc_incremental::save_work_product_index(sess, &dep_graph, work_products)); sess.compile_status()?; |
