Update naming in line with PR comments

This commit is contained in:
Isaac Whitfield 2018-05-09 08:16:08 -07:00
parent 5c83422a5b
commit 0a4fbe326a
6 changed files with 23 additions and 20 deletions

View file

@ -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;

View file

@ -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;

View 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 @@ 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)| {

View file

@ -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);