Skip to content

Commit 3dfd9df

Browse files
committed
Remove an LTO dependent cgu_reuse_tracker.set_actual_reuse call
1 parent 6b9ee90 commit 3dfd9df

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

compiler/rustc_codegen_llvm/src/back/lto.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use rustc_hir::def_id::LOCAL_CRATE;
1919
use rustc_middle::bug;
2020
use rustc_middle::dep_graph::WorkProduct;
2121
use rustc_middle::middle::exported_symbols::{SymbolExportInfo, SymbolExportLevel};
22-
use rustc_session::cgu_reuse_tracker::CguReuse;
2322
use rustc_session::config::{self, CrateType, Lto};
2423

2524
use std::ffi::{CStr, CString};
@@ -584,7 +583,6 @@ fn thin_lto(
584583
copy_jobs.push(work_product);
585584
info!(" - {}: re-used", module_name);
586585
assert!(cgcx.incr_comp_session_dir.is_some());
587-
cgcx.cgu_reuse_tracker.set_actual_reuse(module_name, CguReuse::PostLto);
588586
continue;
589587
}
590588
}

compiler/rustc_codegen_ssa/src/back/write.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use rustc_metadata::EncodedMetadata;
2626
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
2727
use rustc_middle::middle::exported_symbols::SymbolExportInfo;
2828
use rustc_middle::ty::TyCtxt;
29-
use rustc_session::cgu_reuse_tracker::CguReuseTracker;
3029
use rustc_session::config::{self, CrateType, Lto, OutFileName, OutputFilenames, OutputType};
3130
use rustc_session::config::{Passes, SwitchWithOptPath};
3231
use rustc_session::Session;
@@ -366,8 +365,6 @@ pub struct CodegenContext<B: WriteBackendMethods> {
366365
/// The incremental compilation session directory, or None if we are not
367366
/// compiling incrementally
368367
pub incr_comp_session_dir: Option<PathBuf>,
369-
/// Used to update CGU re-use information during the thinlto phase.
370-
pub cgu_reuse_tracker: CguReuseTracker,
371368
/// Channel back to the main control thread to send messages to
372369
pub coordinator_send: Sender<Box<dyn Any + Send>>,
373370
}
@@ -1119,7 +1116,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
11191116
remark: sess.opts.cg.remark.clone(),
11201117
remark_dir,
11211118
incr_comp_session_dir: sess.incr_comp_session_dir_opt().map(|r| r.clone()),
1122-
cgu_reuse_tracker: sess.cgu_reuse_tracker.clone(),
11231119
coordinator_send,
11241120
expanded_args: tcx.sess.expanded_args.clone(),
11251121
diag_emitter: shared_emitter.clone(),

compiler/rustc_session/src/cgu_reuse_tracker.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,7 @@ impl CguReuseTracker {
7575
debug!("set_actual_reuse({cgu_name:?}, {kind:?})");
7676

7777
let prev_reuse = data.lock().unwrap().actual_reuse.insert(cgu_name.to_string(), kind);
78-
79-
if let Some(prev_reuse) = prev_reuse {
80-
// The only time it is legal to overwrite reuse state is when
81-
// we discover during ThinLTO that we can actually reuse the
82-
// post-LTO version of a CGU.
83-
assert_eq!(prev_reuse, CguReuse::PreLto);
84-
}
78+
assert!(prev_reuse.is_none());
8579
}
8680
}
8781

0 commit comments

Comments
 (0)