Skip to content

Commit 69d0c1e

Browse files
committed
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>
1 parent 44c2558 commit 69d0c1e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/driver/aot.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ fn emit_module(
6666
let work_product = if backend_config.disable_incr_cache {
6767
None
6868
} else {
69-
rustc_incremental::copy_cgu_workproduct_to_incr_comp_cache_dir(tcx.sess, &name, &tmp_file)
69+
rustc_incremental::copy_cgu_workproduct_to_incr_comp_cache_dir(
70+
tcx.sess,
71+
&name,
72+
&[("o", &tmp_file)],
73+
)
7074
};
7175

7276
ModuleCodegenResult(
@@ -82,7 +86,10 @@ fn reuse_workproduct_for_cgu(
8286
) -> CompiledModule {
8387
let work_product = cgu.previous_work_product(tcx);
8488
let obj_out = tcx.output_filenames(()).temp_path(OutputType::Object, Some(cgu.name().as_str()));
85-
let source_file = rustc_incremental::in_incr_comp_dir_sess(&tcx.sess, &work_product.saved_file);
89+
let source_file = rustc_incremental::in_incr_comp_dir_sess(
90+
&tcx.sess,
91+
&work_product.saved_files.get("o").expect("no saved object file in work product"),
92+
);
8693
if let Err(err) = rustc_fs_util::link_or_copy(&source_file, &obj_out) {
8794
tcx.sess.err(&format!(
8895
"unable to copy {} to {}: {}",

0 commit comments

Comments
 (0)