about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2022-07-04 14:38:42 +0100
committerDavid Wood <david.wood@huawei.com>2022-07-06 11:15:13 +0100
commit69d0c1e9ac7f7ea074eae2bac6a1a63cb4af005a (patch)
treeef3f5f7a7f5e8d63741b4340b175a2811c695833
parent44c2558504f79c3f30b484c51df1b202696cd42c (diff)
downloadrust-69d0c1e9ac7f7ea074eae2bac6a1a63cb4af005a.tar.gz
rust-69d0c1e9ac7f7ea074eae2bac6a1a63cb4af005a.zip
incr: cache dwarf objects in work products
Cache DWARF objects alongside object files in work products when those
exist so that DWARF object files are available for thorin in packed mode
in incremental scenarios.

Signed-off-by: David Wood <david.wood@huawei.com>
-rw-r--r--src/driver/aot.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/driver/aot.rs b/src/driver/aot.rs
index 05457ce15e9..50d8fc30d7d 100644
--- a/src/driver/aot.rs
+++ b/src/driver/aot.rs
@@ -66,7 +66,11 @@ fn emit_module(
     let work_product = if backend_config.disable_incr_cache {
         None
     } else {
-        rustc_incremental::copy_cgu_workproduct_to_incr_comp_cache_dir(tcx.sess, &name, &tmp_file)
+        rustc_incremental::copy_cgu_workproduct_to_incr_comp_cache_dir(
+            tcx.sess,
+            &name,
+            &[("o", &tmp_file)],
+        )
     };
 
     ModuleCodegenResult(
@@ -82,7 +86,10 @@ fn reuse_workproduct_for_cgu(
 ) -> CompiledModule {
     let work_product = cgu.previous_work_product(tcx);
     let obj_out = tcx.output_filenames(()).temp_path(OutputType::Object, Some(cgu.name().as_str()));
-    let source_file = rustc_incremental::in_incr_comp_dir_sess(&tcx.sess, &work_product.saved_file);
+    let source_file = rustc_incremental::in_incr_comp_dir_sess(
+        &tcx.sess,
+        &work_product.saved_files.get("o").expect("no saved object file in work product"),
+    );
     if let Err(err) = rustc_fs_util::link_or_copy(&source_file, &obj_out) {
         tcx.sess.err(&format!(
             "unable to copy {} to {}: {}",