Skip to content

Commit 0a4fbe3

Browse files
committed
Update naming in line with PR comments
1 parent 5c83422 commit 0a4fbe3

File tree

6 files changed

+23
-20
lines changed

6 files changed

+23
-20
lines changed

src/librustc_incremental/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ pub use persist::dep_graph_tcx_init;
3636
pub use persist::load_dep_graph;
3737
pub use persist::load_query_result_cache;
3838
pub use persist::LoadResult;
39-
pub use persist::create_trans_partition;
39+
pub use persist::copy_cgu_workproducts_to_incr_comp_cache_dir;
4040
pub use persist::save_dep_graph;
41-
pub use persist::save_work_products;
41+
pub use persist::save_work_product_index;
4242
pub use persist::in_incr_comp_dir;
4343
pub use persist::prepare_session_directory;
4444
pub use persist::finalize_session_directory;

src/librustc_incremental/persist/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ pub use self::load::load_dep_graph;
2929
pub use self::load::load_query_result_cache;
3030
pub use self::load::LoadResult;
3131
pub use self::save::save_dep_graph;
32-
pub use self::save::save_work_products;
33-
pub use self::work_product::create_trans_partition;
32+
pub use self::save::save_work_product_index;
33+
pub use self::work_product::copy_cgu_workproducts_to_incr_comp_cache_dir;
3434
pub use self::work_product::delete_workproduct_files;

src/librustc_incremental/persist/save.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
5555
})
5656
}
5757

58-
pub fn save_work_products(sess: &Session,
59-
dep_graph: &DepGraph,
60-
new_work_products: FxHashMap<WorkProductId, WorkProduct>) {
58+
pub fn save_work_product_index(sess: &Session,
59+
dep_graph: &DepGraph,
60+
new_work_products: FxHashMap<WorkProductId, WorkProduct>) {
6161
if sess.opts.incremental.is_none() {
6262
return;
6363
}
6464

65-
debug!("save_work_products()");
65+
debug!("save_work_product_index()");
6666
dep_graph.assert_ignored();
6767
let path = work_products_path(sess);
68-
save_in(sess, path, |e| encode_work_products(&new_work_products, e));
68+
save_in(sess, path, |e| encode_work_product_index(&new_work_products, e));
6969

7070
// We also need to clean out old work-products, as not all of them are
7171
// deleted during invalidation. Some object files don't change their
@@ -234,8 +234,8 @@ fn encode_dep_graph(tcx: TyCtxt,
234234
Ok(())
235235
}
236236

237-
fn encode_work_products(work_products: &FxHashMap<WorkProductId, WorkProduct>,
238-
encoder: &mut Encoder) -> io::Result<()> {
237+
fn encode_work_product_index(work_products: &FxHashMap<WorkProductId, WorkProduct>,
238+
encoder: &mut Encoder) -> io::Result<()> {
239239
let serialized_products: Vec<_> = work_products
240240
.iter()
241241
.map(|(id, work_product)| {

src/librustc_incremental/persist/work_product.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ use rustc::util::fs::link_or_copy;
1717
use std::path::PathBuf;
1818
use std::fs as std_fs;
1919

20-
pub fn create_trans_partition(sess: &Session,
21-
cgu_name: &str,
22-
files: &[(WorkProductFileKind, PathBuf)])
23-
-> Option<(WorkProductId, WorkProduct)> {
20+
pub fn copy_cgu_workproducts_to_incr_comp_cache_dir(
21+
sess: &Session,
22+
cgu_name: &str,
23+
files: &[(WorkProductFileKind, PathBuf)]
24+
) -> Option<(WorkProductId, WorkProduct)> {
2425
debug!("create_trans_partition({:?},{:?})",
2526
cgu_name,
2627
files);

src/librustc_trans/back/write.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use back::linker::LinkerInfo;
1717
use back::symbol_export::ExportedSymbols;
1818
use base;
1919
use consts;
20-
use rustc_incremental::{create_trans_partition, in_incr_comp_dir};
20+
use rustc_incremental::{copy_cgu_workproducts_to_incr_comp_cache_dir, in_incr_comp_dir};
2121
use rustc::dep_graph::{WorkProduct, WorkProductId, WorkProductFileKind};
2222
use rustc::middle::cstore::{LinkMeta, EncodedMetadata};
2323
use rustc::session::config::{self, OutputFilenames, OutputType, Passes, SomePasses,
@@ -1021,7 +1021,7 @@ pub fn start_async_translation(tcx: TyCtxt,
10211021
}
10221022
}
10231023

1024-
fn generate_module_artifacts(
1024+
fn copy_all_cgu_workproducts_to_incr_comp_cache_dir(
10251025
sess: &Session,
10261026
compiled_modules: &CompiledModules
10271027
) -> FxHashMap<WorkProductId, WorkProduct> {
@@ -1044,7 +1044,8 @@ fn generate_module_artifacts(
10441044
files.push((WorkProductFileKind::BytecodeCompressed, path.clone()));
10451045
}
10461046

1047-
if let Some((id, product)) = create_trans_partition(sess, &module.name, &files) {
1047+
if let Some((id, product)) =
1048+
copy_cgu_workproducts_to_incr_comp_cache_dir(sess, &module.name, &files) {
10481049
work_products.insert(id, product);
10491050
}
10501051
}
@@ -2265,7 +2266,8 @@ impl OngoingCrateTranslation {
22652266
time_graph.dump(&format!("{}-timings", self.crate_name));
22662267
}
22672268

2268-
let work_products = generate_module_artifacts(sess, &compiled_modules);
2269+
let work_products = copy_all_cgu_workproducts_to_incr_comp_cache_dir(sess,
2270+
&compiled_modules);
22692271

22702272
produce_final_output_artifacts(sess,
22712273
&compiled_modules,

src/librustc_trans/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl TransCrate for LlvmTransCrate {
221221

222222
time(sess,
223223
"serialize work products",
224-
move || rustc_incremental::save_work_products(sess, &dep_graph, work_products));
224+
move || rustc_incremental::save_work_product_index(sess, &dep_graph, work_products));
225225

226226
sess.compile_status()?;
227227

0 commit comments

Comments
 (0)