diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-12-12 11:40:36 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-12-13 10:21:22 +0000 |
| commit | ead78fdfdf6692b2ecef7f47dfc934011c51fe4c (patch) | |
| tree | 3bf221ad8994bd04b02810c588562dc4b4352685 /compiler/rustc_codegen_ssa/src/back | |
| parent | 8e37e151835d96d6a7415e93e6876561485a3354 (diff) | |
| download | rust-ead78fdfdf6692b2ecef7f47dfc934011c51fe4c.tar.gz rust-ead78fdfdf6692b2ecef7f47dfc934011c51fe4c.zip | |
Remove jobserver from Session
It is effectively a global resource and the jobserver::Client in Session was a clone of GLOBAL_CLIENT anyway.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/write.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index 501f7517919..683defcafee 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -6,9 +6,9 @@ use std::sync::Arc; use std::sync::mpsc::{Receiver, Sender, channel}; use std::{fs, io, mem, str, thread}; -use jobserver::{Acquired, Client}; use rustc_ast::attr; use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; +use rustc_data_structures::jobserver::{self, Acquired}; use rustc_data_structures::memmap::Mmap; use rustc_data_structures::profiling::{SelfProfilerRef, VerboseTimingGuard}; use rustc_errors::emitter::Emitter; @@ -456,7 +456,6 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>( metadata_module: Option<CompiledModule>, ) -> OngoingCodegen<B> { let (coordinator_send, coordinator_receive) = channel(); - let sess = tcx.sess; let crate_attrs = tcx.hir().attrs(rustc_hir::CRATE_HIR_ID); let no_builtins = attr::contains_name(crate_attrs, sym::no_builtins); @@ -477,7 +476,6 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>( shared_emitter, codegen_worker_send, coordinator_receive, - sess.jobserver.clone(), Arc::new(regular_config), Arc::new(metadata_config), Arc::new(allocator_config), @@ -1093,7 +1091,6 @@ fn start_executing_work<B: ExtraBackendMethods>( shared_emitter: SharedEmitter, codegen_worker_send: Sender<CguMessage>, coordinator_receive: Receiver<Box<dyn Any + Send>>, - jobserver: Client, regular_config: Arc<ModuleConfig>, metadata_config: Arc<ModuleConfig>, allocator_config: Arc<ModuleConfig>, @@ -1145,7 +1142,7 @@ fn start_executing_work<B: ExtraBackendMethods>( // get tokens on `coordinator_receive` which will // get managed in the main loop below. let coordinator_send2 = coordinator_send.clone(); - let helper = jobserver + let helper = jobserver::client() .into_helper_thread(move |token| { drop(coordinator_send2.send(Box::new(Message::Token::<B>(token)))); }) |
