]> git.lizzy.rs Git - rust.git/commitdiff
Update naming in line with PR comments
authorIsaac Whitfield <iw@whitfin.io>
Wed, 9 May 2018 15:16:08 +0000 (08:16 -0700)
committerIsaac Whitfield <iw@whitfin.io>
Fri, 11 May 2018 15:09:53 +0000 (08:09 -0700)
src/librustc_incremental/lib.rs
src/librustc_incremental/persist/mod.rs
src/librustc_incremental/persist/save.rs
src/librustc_incremental/persist/work_product.rs
src/librustc_trans/back/write.rs
src/librustc_trans/lib.rs

index af33e878032640ef8ebc9cf046cae6e2e17d0bd8..ababce69e3170d850e939df33dfefdc3b4039ad6 100644 (file)
@@ -36,9 +36,9 @@
 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;
index 3c23b7c6417bc9793c4fedbe4bd5105528abb2d4..e1f00db56d5cbc0572214a3a15d94941e7a8b09e 100644 (file)
@@ -29,6 +29,6 @@
 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;
index 497d24fae5bfec8ced7ab6aff410cace0eb87dc2..be725b17933215661af70724ba01e6b4c432a7b7 100644 (file)
@@ -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 @@ struct Stat {
     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)| {
index 23e3664cdba13991981e9cbdf6b8bc4aacc88c75..d163ad1f3f322b6c9dc69aefb2e1bcf07f2d326a 100644 (file)
 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);
index afa9bca2ba98c9c2456f28cc713c13b4eeacf1ba..888173d4fc515053a7c2173f5e7d0db6c78dcbe8 100644 (file)
@@ -17,7 +17,7 @@
 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 @@ pub(crate) fn join(
             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,
index bc8747ca4f5c76e2543701241f4eb2cddeb428d9..30780b8c965637704a683b5e16552ecd4e8bc0d6 100644 (file)
@@ -221,7 +221,7 @@ fn join_trans_and_link(
 
         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()?;